Skip to content

Instantly share code, notes, and snippets.

View tangyouze's full-sized avatar
🎯
Focusing

tyz tangyouze

🎯
Focusing
  • @1token-trade
  • Shanghai
View GitHub Profile
@bokwoon95
bokwoon95 / deref.go
Last active November 4, 2022 23:11
Go Generics type signature for ensuring argument is a pointer
// https://go.dev/play/p/BT-OUMK5Rtp
package main
import (
"fmt"
)
// Deref will dereference a generic pointer.
// It will fail at compile time if pt is not a pointer.
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 4, 2025 08:04
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@senko
senko / onchange.sh
Last active April 1, 2025 17:30
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <[email protected]>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of