Cheat Sheet
Cheat Sheet
Section titled “Cheat Sheet”Keep this page bookmarked! Here’s a quick reference for everything you learned.
Terminal / Command Line
Section titled “Terminal / Command Line”Navigation
Section titled “Navigation”| Command | What It Does | Example |
|---|---|---|
cd folder | Go into a folder | cd my-project |
cd .. | Go up one folder | cd .. |
pwd (Mac) / cd (Win) | Show current location | pwd |
ls (Mac) / dir (Win) | List files | ls |
mkdir name | Create a folder | mkdir my-project |
Opening Terminal
Section titled “Opening Terminal”- Windows:
Win + R, typecmd, press Enter - Mac:
Cmd + Space, typeTerminal, press Enter
GitHub Desktop
Section titled “GitHub Desktop”Creating a New Repository
Section titled “Creating a New Repository”- File → New Repository (or Ctrl+N / Cmd+N)
- Fill in name, description, and local path
- Check “Initialize with a README”
- Click “Create Repository”
Daily Workflow
Section titled “Daily Workflow”- Make changes in your code editor and save
- Open GitHub Desktop - changes appear in “Changes” tab
- Review changes - click files to see what changed
- Write summary - describe what you changed
- Commit to main - click the button
- Push origin - click the button at top
Publishing to GitHub
Section titled “Publishing to GitHub”- Click “Publish repository” button
- Uncheck “Keep this code private” (for GitHub Pages)
- Click “Publish repository”
Useful Actions
Section titled “Useful Actions”| Action | How To Do It |
|---|---|
| View on GitHub | Repository → View on GitHub |
| Open in editor | Right-click repo → Open in Visual Studio Code |
| Discard changes | Right-click file → Discard changes |
| See history | Click “History” tab |
| Pull latest | Repository → Pull |
| Clone a repo | File → Clone Repository |
Claude Code
Section titled “Claude Code”Basic Commands
Section titled “Basic Commands”# Start Claude Codeclaude
# Exit Claude Codeexit# or press Ctrl+CInside Claude Code
Section titled “Inside Claude Code”| Command | What It Does |
|---|---|
/help | Show available commands |
/clear | Clear conversation |
| Type normally | Chat with Claude |
Useful Prompts
Section titled “Useful Prompts”# Create a projectCreate a [type] website with [features]
# Fix somethingThe [feature] isn't working. Can you check why?
# Explain somethingCan you explain what [code/concept] does?
# Change somethingCan you change [feature] to [new behavior]?Node.js / npm
Section titled “Node.js / npm”# Check Node versionnode --version
# Check npm versionnpm --version
# Install a package globallynpm install -g package-name
# Install project dependenciesnpm install
# Run a script from package.jsonnpm run scriptname
# Start a local servernpx serve# ornpm install -g serve && serveLocal Testing
Section titled “Local Testing”Python Server
Section titled “Python Server”# Python 3python -m http.server 8000
# Python 2python -m SimpleHTTPServer 8000
# Then open: http://localhost:8000Node Server
Section titled “Node Server”npx serve# ornpm install -g serve && serveBrowser Developer Tools
Section titled “Browser Developer Tools”- Windows:
F12orCtrl + Shift + I - Mac:
Cmd + Option + I
Hard Refresh (Clear Cache)
Section titled “Hard Refresh (Clear Cache)”- Windows:
Ctrl + Shift + R - Mac:
Cmd + Shift + R
GitHub Pages
Section titled “GitHub Pages”Setup Steps
Section titled “Setup Steps”- Go to repository Settings
- Click Pages in sidebar
- Set Source to Deploy from a branch
- Select main branch, / (root) folder
- Click Save
Your URL Format
Section titled “Your URL Format”https://USERNAME.github.io/REPO-NAME/Claude API
Section titled “Claude API”Installation
Section titled “Installation”npm install @anthropic-ai/sdkBasic API Call
Section titled “Basic API Call”import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY,});
const message = await client.messages.create({ model: "claude-sonnet-4-20250514", max_tokens: 1024, messages: [{ role: "user", content: "Hello!" }],});
console.log(message.content[0].text);PostHog Analytics
Section titled “PostHog Analytics”Quick Setup
Section titled “Quick Setup”Add before </head>:
<script> !function(t,e){/*...PostHog snippet...*/} posthog.init('YOUR_KEY', {api_host: 'https://app.posthog.com'})</script>Track Custom Events
Section titled “Track Custom Events”// Track eventposthog.capture('event_name');
// Track with dataposthog.capture('event_name', { key: 'value' });
// Opt outposthog.opt_out_capturing();
// Opt inposthog.opt_in_capturing();Keyboard Shortcuts
Section titled “Keyboard Shortcuts”Terminal
Section titled “Terminal”| Shortcut | Action |
|---|---|
Ctrl + C | Stop current command |
Ctrl + L | Clear screen |
↑ / ↓ | Previous/next command |
Tab | Auto-complete |
Browser
Section titled “Browser”| Shortcut | Action |
|---|---|
F5 or Cmd/Ctrl + R | Refresh |
Cmd/Ctrl + Shift + R | Hard refresh |
F12 or Cmd + Option + I | Developer tools |
Cmd/Ctrl + U | View source |
File Structure Basics
Section titled “File Structure Basics”Typical Web Project
Section titled “Typical Web Project”my-project/├── index.html # Main page├── styles.css # Styling├── script.js # JavaScript├── images/ # Image files│ ├── logo.png│ └── photo.jpg└── .gitignore # Files Git should ignore.gitignore Template
Section titled “.gitignore Template”# Dependenciesnode_modules/
# Environment.env
# System files.DS_StoreThumbs.db
# Build outputdist/build/Quick Troubleshooting
Section titled “Quick Troubleshooting”| Problem | Solution |
|---|---|
| ”command not found” | Restart terminal, check installation |
| Git push rejected | Run git pull first |
| CSS not loading | Check <link> path, hard refresh |
| JS not working | Check browser console for errors |
| GitHub Pages 404 | Wait 5 min, check index.html exists |
| API error 401 | Check API key is correct |
Helpful Links
Section titled “Helpful Links”- GitHub Docs
- Claude Code Documentation
- Anthropic API Reference
- PostHog Docs
- MDN Web Docs (HTML/CSS/JS reference)