Skip to content

Instantly share code, notes, and snippets.

# Count
(gh repo list --limit 1000 --json name | ConvertFrom-Json).Count
(gh gist list --limit 100).Count
# Setup dir
$dir = "D:\github-backup-$(Get-Date -Format 'yyyy-MM-dd-HHmm')"; mkdir $dir; cd $dir
# Clone mirrors
(gh repo list --limit 1000 --json url | ConvertFrom-Json) | % { git clone --mirror $_.url }
@ctx-0
ctx-0 / .pre-commit-config.yaml
Last active February 28, 2026 08:18
Strip metadata using exiftool pre-commit hook
repos:
- repo: local
hooks:
- id: exiftool-strip
name: Strip metadata with exiftool
entry: exiftool -overwrite_original -all=
language: system
files: \.(jpg|jpeg|png|tiff|tif|gif|bmp|pdf|docx|xlsx|pptx|mp3|mp4|mov|heic|webp|raw|dng|psd)$
pass_filenames: true
stages: [pre-commit]
quick redis
docker run -d --name redis -p 6379:6379 redis
docker exec -it redis redis-cli
@ctx-0
ctx-0 / README.md
Last active February 8, 2026 20:09
Managing ssh keys for multiple github accounts

keygen

# For your personal account
ssh-keygen -t ed25519 -C "personal@example.com" -f ~/.ssh/id_ed25519_personal

# For your work account
ssh-keygen -t ed25519 -C "work@company.com" -f ~/.ssh/id_ed25519_work
@ctx-0
ctx-0 / bloom.md
Last active February 11, 2026 23:06
(Redis) Bloom Filter

(Redis) Bloom Filter

docker run -d --name redis -p 6379:6379 redis:8.4

BF.RESERVE key error_rate capacity [EXPANSION expansion]

@ctx-0
ctx-0 / mongo.md
Last active February 8, 2026 11:30
Debugging mongo memory issues

Get collection size (& other stats)

db.collection.stats()  
db.yourCollection.stats(1024) // in kb  

Get document size

Object.bsonsize(document)