⚡DevCheats
Cloudflare Edge
🚀Ultra-fast developer cheat sheets & verified snippets

Copy-Paste Code Snippets
Without The Fluff

Curated, single-click copy commands with gotchas, memory trade-offs, and tested alternatives. Zero AI gibberish.

Browse by Technology

Trending Code Snippets & Answers

🐳docker

Docker Restart All Containers Command

Restart all active, stopped, or exited Docker containers in seconds using quiet ID output piping.

docker restart $(docker ps -aq)
🐳docker

Docker Prune All Unused Resources (Clean Disk Space)

Clean up gigabytes of reclaimed disk space by wiping dangling images, containers, networks, and unused cache.

docker system prune -a --volumes
🐍python

How to Reverse a List in Python (Best Practices)

The fastest and most Pythonic ways to reverse a list, with slice notation and memory-safe in-place mutation.

reversed_list = items[::-1]
🐍python

How to Drop a Column in Pandas DataFrame

Drop single or multiple columns by name or index cleanly without KeyError warnings.

df = df.drop(columns=["unwanted_col", "temp_col"])
🌿git

Git Undo Last Commit (Keep Changes Staged)

Safely undo the previous commit without losing any written code or modifications.

git reset --soft HEAD~1
🌿git

How to Rename a Local and Remote Git Branch

Step-by-step commands to rename a branch locally, push the new branch, and reset the upstream tracking.

git branch -m old-name new-name git push origin -u new-name git push origin --delete old-name
⚡javascript

Regex for Email Validation in JavaScript

Production-ready, battle-tested regular expression pattern to validate RFC 5322 email formats in JavaScript/TypeScript.

const isValidEmail = (email) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
🐧linux

Find and Kill Process Running on Specific Port in Linux

Free up occupied ports (e.g., port 3000 or 8080) blocked by zombie node/python processes.

sudo fuser -k 3000/tcp