2.9 KiB
2.9 KiB
Quick Reference Guide
Command Line
Git Commands
Basic Operations
Status and Changes
git status- Show working tree statusgit diff- Show changes between commitsgit log --oneline- Compact commit history
Staging and Committing
git add .- Stage all changesgit commit -m "message"- Commit with messagegit push origin main- Push to remote
Branching
git branch- List branchesgit checkout -b feature- Create and switch to branchgit merge feature- Merge branch into current
NPM Commands
Package Management
npm install- Install dependenciesnpm install -D package- Install dev dependencynpm uninstall package- Remove package
Scripts
npm run dev- Start development servernpm run build- Build for productionnpm test- Run tests
Keyboard Shortcuts
VS Code
Navigation
Ctrl+P- Quick file openCtrl+Shift+P- Command paletteCtrl+G- Go to line
Editing
Ctrl+D- Select next occurrenceCtrl+/- Toggle commentAlt+Shift+Down- Duplicate line
Browser DevTools
Elements Tab
H- Hide elementDelete- Delete elementF2- Edit as HTML
Console
Ctrl+L- Clear console$0- Reference selected elementconsole.table(data)- Display data as table
Regular Expressions
Common Patterns
Text Matching
\d+- One or more digits\w+- One or more word characters\s+- One or more whitespace
Anchors
^- Start of line$- End of line\b- Word boundary
Examples
Email Validation
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Phone Number
^\d{3}-\d{3}-\d{4}$
CSS Selectors
Basic Selectors
.class- Class selector#id- ID selectorelement- Element selector
Combinators
parent > child- Direct childancestor descendant- Any descendantelement + next- Adjacent sibling
Pseudo-classes
:hover- Mouse hover state:first-child- First child element:nth-child(n)- Nth child element
HTTP Status Codes
2xx Success
200- OK201- Created204- No Content
4xx Client Error
400- Bad Request401- Unauthorized404- Not Found
5xx Server Error
500- Internal Server Error502- Bad Gateway503- Service Unavailable
Org Mode Syntax
Headings
*- Level 1 heading**- Level 2 heading***- Level 3 heading
Lists
Unordered
- Dash, plus, or asterisk
Ordered
- Numbers with dot or parenthesis
Checkboxes
[ ]- Empty checkbox[X]- Checked checkbox
Markup
*bold*- Bold text/italic/- Italic text=code=- Inline code~verbatim~- Verbatim text
Links
[[URL][Description]]- External link[[file:path]]- File link[[*Heading]]- Internal link to heading