Saltearse al contenido
Esta página fue traducida automáticamente del inglés. La calidad puede variar.Reportar un problema

Cheat Sheet

Esta página aún no está disponible en tu idioma.

Keep this page bookmarked! Here’s a quick reference for everything you learned.

CommandWhat It DoesExample
cd folderGo into a foldercd my-project
cd ..Go up one foldercd ..
pwd (Mac) / cd (Win)Show current locationpwd
ls (Mac) / dir (Win)List filesls
mkdir nameCreate a foldermkdir my-project
  • Windows: Win + R, type cmd, press Enter
  • Mac: Cmd + Space, type Terminal, press Enter
  1. File → New Repository (or Ctrl+N / Cmd+N)
  2. Fill in name, description, and local path
  3. Check “Initialize with a README”
  4. Click “Create Repository”
  1. Make changes in your code editor and save
  2. Open GitHub Desktop - changes appear in “Changes” tab
  3. Review changes - click files to see what changed
  4. Write summary - describe what you changed
  5. Commit to main - click the button
  6. Push origin - click the button at top
  1. Click “Publish repository” button
  2. Uncheck “Keep this code private” (for GitHub Pages)
  3. Click “Publish repository”
ActionHow To Do It
View on GitHubRepository → View on GitHub
Open in editorRight-click repo → Open in Visual Studio Code
Discard changesRight-click file → Discard changes
See historyClick “History” tab
Pull latestRepository → Pull
Clone a repoFile → Clone Repository
Terminal window
# Start Claude Code
claude
# Exit Claude Code
exit
# or press Ctrl+C
CommandWhat It Does
/helpShow available commands
/clearClear conversation
Type normallyChat with Claude
# Create a project
Create a [type] website with [features]
# Fix something
The [feature] isn't working. Can you check why?
# Explain something
Can you explain what [code/concept] does?
# Change something
Can you change [feature] to [new behavior]?
Terminal window
# Check Node version
node --version
# Check npm version
npm --version
# Install a package globally
npm install -g package-name
# Install project dependencies
npm install
# Run a script from package.json
npm run scriptname
# Start a local server
npx serve
# or
npm install -g serve && serve
Terminal window
# Python 3
python -m http.server 8000
# Python 2
python -m SimpleHTTPServer 8000
# Then open: http://localhost:8000
Terminal window
npx serve
# or
npm install -g serve && serve
  • Windows: F12 or Ctrl + Shift + I
  • Mac: Cmd + Option + I
  • Windows: Ctrl + Shift + R
  • Mac: Cmd + Shift + R
  1. Go to repository Settings
  2. Click Pages in sidebar
  3. Set Source to Deploy from a branch
  4. Select main branch, / (root) folder
  5. Click Save
https://USERNAME.github.io/REPO-NAME/
Terminal window
npm install @anthropic-ai/sdk
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);

Add before </head>:

<script>
!function(t,e){/*...PostHog snippet...*/}
posthog.init('YOUR_KEY', {api_host: 'https://app.posthog.com'})
</script>
// Track event
posthog.capture('event_name');
// Track with data
posthog.capture('event_name', { key: 'value' });
// Opt out
posthog.opt_out_capturing();
// Opt in
posthog.opt_in_capturing();
ShortcutAction
Ctrl + CStop current command
Ctrl + LClear screen
/ Previous/next command
TabAuto-complete
ShortcutAction
F5 or Cmd/Ctrl + RRefresh
Cmd/Ctrl + Shift + RHard refresh
F12 or Cmd + Option + IDeveloper tools
Cmd/Ctrl + UView source
my-project/
├── index.html # Main page
├── styles.css # Styling
├── script.js # JavaScript
├── images/ # Image files
│ ├── logo.png
│ └── photo.jpg
└── .gitignore # Files Git should ignore
# Dependencies
node_modules/
# Environment
.env
# System files
.DS_Store
Thumbs.db
# Build output
dist/
build/
ProblemSolution
”command not found”Restart terminal, check installation
Git push rejectedRun git pull first
CSS not loadingCheck <link> path, hard refresh
JS not workingCheck browser console for errors
GitHub Pages 404Wait 5 min, check index.html exists
API error 401Check API key is correct