Skip to content

Instantly share code, notes, and snippets.

View 607011's full-sized avatar
๐Ÿ
Yes, please?!

Oliver Lau 607011

๐Ÿ
Yes, please?!
View GitHub Profile
@607011
607011 / pre-commit
Created March 20, 2025 05:18
git pre-commit hook for Rust projects
#!/bin/sh
# Run cargo fmt check
echo "Running cargo fmt check ..."
cargo fmt --all -- --check
if [ $? -ne 0 ]; then
echo "cargo fmt check failed! Fix the errors before committing."
exit 1
fi
@607011
607011 / look-and-say.py
Created April 2, 2025 06:10
Generate "look-and-say" integer sequence
#!/usr/bin/env python3
"""
https://oeis.org/A005150
"""
s = "1"
seq = [s]
for i in range(10):
result = ""
@607011
607011 / salt.sh
Created June 3, 2025 11:46
Generate 16-byte long salts or nonces
head -c 16 /dev/urandom | hexdump -e '1/1 "%02x"'