Skip to content

Instantly share code, notes, and snippets.

@hurricane-voronin
hurricane-voronin / README.md
Last active May 10, 2024 16:59
Naming Classes Without a 'Manager'
@paduvi
paduvi / FlatCnnLayer.py
Last active May 10, 2024 16:59
Hierarchical Softmax CNN Classification
import torch
import torch.nn as nn
import torch.nn.init as init
dropout_prob = 0.5
class FlatCnnLayer(nn.Module):
def __init__(self, embedding_size, sequence_length, filter_sizes=[3, 4, 5], out_channels=128):
super(FlatCnnLayer, self).__init__()
@mjbalcueva
mjbalcueva / calendar.tsx
Last active May 10, 2024 16:58
shadcn ui calendar custom year and month dropdown
"use client"
import * as React from "react"
import { buttonVariants } from "@/components/ui/button"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { cn } from "@/lib/utils"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { DayPicker, DropdownProps } from "react-day-picker"
@mjbalcueva
mjbalcueva / password-input.tsx
Last active May 10, 2024 16:58
shadcn ui custom password input
"use client"
import { forwardRef, useState } from "react"
import { EyeIcon, EyeOffIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, InputProps } from "@/components/ui/input"
import { cn } from "@/lib/utils"
const PasswordInput = forwardRef<HTMLInputElement, InputProps>(
({ className, ...props }, ref) => {
@txhammer68
txhammer68 / linux.md
Last active May 10, 2024 16:57
Linux Tips

Linux Tips (Debian Based distros)

Some usefull tips i have collected over the years, use at own risk.

  • Users & Groups

    • Add user to group
      sudo usermod -a -G cdrom userName
      sudo usermod -aG vboxsf $USER
  • Change root password
    sudo passwd root

@Zeinok
Zeinok / wine-breeze-dark-theme.md
Last active May 10, 2024 16:57
Breeze Dark theme for Wine

Made possible with this reddit post.

Install

wine regedit wine-breeze-dark.reg

Uninstall (Reset Wine color scheme)

wine regedit wine-reset-theme.reg

@htruong
htruong / chroot-to-pi.sh
Last active May 10, 2024 16:54
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 10, 2024 16:54
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active May 10, 2024 16:52
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@phillip-le
phillip-le / assert-to-have-received-put-command-command.ts
Last active May 10, 2024 16:52
Unit Testing AWS SDK in TypeScript
it('should persist user to dynamodb', async () => {
await createUser(userInput);
expect(mockDynamoDbDocumentClient).toHaveReceivedCommandWith(PutCommand, {
TableName: 'TestUserTable',
Item: userToCreate,
});
});