Developer Resources
Handy cheatsheets and quick references for everyday development.
Git
git switch -c featureCreate and switch to a new branch
git restore --staged <file>Unstage a file
git rebase -i HEAD~3Interactively rewrite the last 3 commits
git log --oneline --graphCompact commit graph
git stash popReapply the most recent stash
git reset --hard origin/mainDiscard local changes to match remote
Docker
docker ps -aList all containers
docker compose up -dStart services in the background
docker exec -it <id> shOpen a shell inside a container
docker logs -f <id>Follow container logs
docker system prune -afRemove unused data (careful)
docker build -t app .Build an image from the Dockerfile
Linux
grep -rn 'text' .Recursively search for text with line numbers
chmod +x script.shMake a script executable
tar -xzf file.tar.gzExtract a gzipped tarball
ss -tulpnList listening ports
systemctl status nginxCheck a service's status
df -hShow disk usage, human readable
SQL
SELECT * FROM t LIMIT 10;Preview the first rows
CREATE INDEX idx ON t(col);Add an index to speed lookups
EXPLAIN ANALYZE <query>;Inspect a query plan
LEFT JOIN b ON a.id = b.a_idKeep all left rows
GROUP BY col HAVING COUNT(*) > 1Filter groups after aggregation
UPDATE t SET x=1 WHERE id=5;Update matching rows
Next.js
export const revalidate = 60ISR: revalidate a route every 60s
'use client'Mark a component as client-side
generateStaticParams()Pre-render dynamic routes at build
revalidatePath('/news')Invalidate a cached route after a mutation
notFound()Render the 404 boundary
<Image fill sizes=... />Responsive optimized images
Security
openssl rand -base64 32Generate a strong secret
ssh-keygen -t ed25519Create a modern SSH key
curl -I https://siteInspect response headers
chmod 600 ~/.ssh/id_ed25519Lock down a private key
dig +short example.comQuick DNS lookup
nmap -sV hostService/version detection