Polyglot Codebook_

A quick reference for the languages of the web, data, and the command line — plus the tools and protocols that connect them. What each one is, how it runs, and the syntax you actually use. Built to grow: ask Claude to add a language and this page updates in place.

Live AI insidePaste any command or snippet and Claude numbers every piece, explains it in plain English, and flags the risk.Code Explainer →

The languages at a glance

Not everything here is a "programming language" in the strict sense — and the differences matter. Markup languages describe structure and formatting; style sheet languages describe appearance; programming languages give the computer instructions; query languages ask questions of stored data; data formats carry information between systems.

LanguageKindFirst appearedRuns whereBest atFiles
HTMLMarkup1991Any web browserThe structure and content of web pages.html
CSSStyle sheet1996Any web browserThe look and layout of web pages.css
JavaScriptProgramming1995Browsers + Node.jsInteractivity on pages; full web apps.js
PythonProgramming1991Anywhere with the Python interpreterAutomation, data analysis, servers, scripting.py
SQLQuery1974Inside database engines & warehousesStoring, filtering, and summarizing data.sql
Shell (Bash)Command + scripting1989Terminal on Linux / macOS (WSL on Windows)Controlling the computer; chaining tools.sh
MarkdownLightweight markup2004Anywhere text is rendered (GitHub, docs, chat)Formatted writing in plain text.md
JSONData format2001Everywhere data moves (APIs, configs)Exchanging structured data.json
YAMLData format2001Config files (Docker, CI/CD, settings)Human-friendly configuration.yml
THE BROWSER THE SERVER THE DATABASE YOUR COMPUTER'S OS HTML — structure CSS — appearance JavaScript — behavior Python app logic, automation (also JS via Node.js) SQL Postgres, MySQL, SQLite, Snowflake, BigQuery… Shell runs & chains programs HTTP requests; JSON data both ways SQL queries, rows back launches YAML configures the tools; Markdown documents them
Where each language lives. A typical web request touches all four zones: the browser renders HTML/CSS/JS, the server runs Python, the database answers in SQL, and the shell manages the machines underneath.

Which language does the job?

You want to…Reach forWhy
Put content on a web pageHTMLEvery page is an HTML document; everything else attaches to it
Change how a page looksCSSColors, fonts, spacing, and layout are all CSS's job
Make a page react to clicks & inputJavaScriptThe only language browsers run natively
Automate a boring task, crunch a filePython (or Shell for quick one-liners)Readable, batteries included, huge library ecosystem
Ask questions of stored dataSQLSay what you want; the database figures out how
Install tools, move files, chain programsShellDirect line to the operating system
Write notes, docs, READMEsMarkdownFormatting without a word processor
Send or store structured dataJSONThe lingua franca of APIs
Configure an app or pipelineYAMLJSON's job, but easier for humans to read and edit

Tools & protocols in this codebook

Four tabs aren't languages at all — they're the connective tissue every developer and ops person works in daily. One more is a tool for taking apart code you meet:

TabWhat it isWhy it's here
GitVersion control system (2005)How code is saved, shared, and un-broken — the first tool you touch on any project
HTTP & APIsThe web's request/response protocolThe glue between browser, server, and every API; status codes are the web's vital signs
NetworkingIPs, ports, DNS, TLSThe plumbing underneath everything — and the first place things break in ops
RegexPattern-matching mini-languageLives inside JS, Python, SQL, and grep; one syntax, used everywhere
Code ExplainerInteractive toolPaste any command or snippet; every piece gets a number, a plain-English job, and the safety habits that apply

Reading an error message — the most valuable skill on this page

Errors aren't scoldings; they're the computer telling you exactly where it gave up. Every language formats them differently, but the recipe is the same: find the error type, the message, and the file + line number — then read your own code at that line.

Traceback (most recent call last):
  File "report.py", line 12, in <module>
    total = price * qty        ← the line that failed
NameError: name 'qty' is not defined
└ type ────┘└──────── message ────────┘

Python: read BOTTOM-UP. Last line = what
went wrong; lines above = where. A long
"traceback" is just the trail of function
calls that led there — yours are usually
near the bottom.
Uncaught TypeError: Cannot read
  properties of null (reading 'value')
    at save (app.js:24:31)
            └ file ┘ └ line:column

JavaScript (browser console, F12):
read TOP-DOWN. "null" errors almost
always mean querySelector found
nothing — check the selector first.

SQL & shell errors are one-liners:
  syntax error at or near "FORM"
  command not found: pyhton
— both are usually typos. Read the
exact word the error quotes.
The debugging recipe: read the error type + message aloud → go to the file and line it names → if it still makes no sense, paste the entire error into a search or into Claude. Never paraphrase an error; the exact wording is the clue.

How to read this codebook

Each language tab follows the same pattern, so the layout itself becomes familiar:

At a glanceType, purpose, origin, where it runs, and its codependent languages — the identity card
Ground rulesThe syntax rules that apply to everything in the language: comments, case, how blocks work
Anatomy diagramOne labeled picture of the language's core construct
Reference tablesCommon tags / keywords / commands grouped by category, each with a plain-English job and an example
Watch outThe mistakes every beginner makes once — so you only make them once

HTML

HyperText Markup Language

The skeleton of every web page. HTML doesn't compute anything — it marks up content with tags so the browser knows what each piece is: a heading, a paragraph, a link, an image.

TypeMarkup language Origin1991, Tim Berners-Lee (CERN) StandardWHATWG "living standard" Runs onAny web browser Files.html .htm
PurposeDefine the structure and content of web pages and apps — the one format every browser understands
Use casesWebsites, web apps, email templates, browser-based UIs, this very document
How it runsNo compiler, no installs: the browser reads the file top-to-bottom and renders it. Save as .html, double-click, done.
Codependent withCSS (styles it) and JavaScript (makes it interactive) — the three are designed as a trio. Markdown converts to HTML.
Current version"HTML5" era — versionless living standard since 2019

Ground rules

TagsContent wrapped in angle-bracket tags: <p>text</p>. Most tags come in open/close pairs.
Void elementsSome tags stand alone with no closing tag: <img>, <br>, <hr>, <input>, <meta>, <link>
AttributesExtra settings inside the opening tag: name="value", always double-quoted by convention
CaseNot case-sensitive, but lowercase is the universal convention
Comments<!-- ignored by the browser -->
Required skeletonStart with <!DOCTYPE html>, then <html> containing <head> (info about the page) and <body> (visible content)
NestingTags close in reverse order opened: <b><i>text</i></b> ✓ — never interleaved
<a href = "page.html" >Visit</a> opening tag attribute name attribute value content closing tag Together, the whole thing is one element.
Anatomy of an element — the pattern behind every tag in the tables below.
<!DOCTYPE html>
<html lang="en">
  <head>                ← about the page
    <meta charset="UTF-8">
    <title>My Page</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>                ← visible content
    <h1>Hello</h1>
    <p>First page.</p>
    <script src="app.js"></script>
  </body>
</html>
The minimum skeleton — every page is this shape.

Tags — document structure & metadata

TagWhat it doesExample
<html>Root element wrapping the whole document<html lang="en">…</html>
<head>Invisible info: title, character set, linked files<head>…</head>
<title>Name shown in the browser tab & search results<title>Home</title>
<meta>Page metadata (encoding, mobile scaling, description)<meta charset="UTF-8">
<link>Attach an external file — usually the stylesheet<link rel="stylesheet" href="style.css">
<script>Attach or embed JavaScript<script src="app.js"></script>
<body>Everything the visitor actually sees<body>…</body>

Tags — text & headings

TagWhat it doesExample
<h1>–<h6>Headings, biggest to smallest; one <h1> per page<h2>Chapter 2</h2>
<p>Paragraph of text<p>Hello world.</p>
<a>Link ("anchor") — href is the destination<a href="https://…">Visit</a>
<strong> <em>Important (bold) / stressed (italic) text<strong>Stop!</strong>
<span>Inline hook for styling part of a line — no meaning of its own<span class="hi">word</span>
<br> <hr>Line break / horizontal dividerline one<br>line two
<blockquote>Quoted block from another source<blockquote>…</blockquote>
<code> <pre>Inline code / preformatted block that keeps spacing<pre><code>x = 1</code></pre>

Tags — lists & tables

TagWhat it doesExample
<ul> <ol>Bulleted (unordered) / numbered (ordered) list<ol><li>First</li></ol>
<li>One item inside either list type<li>Milk</li>
<table>Data table wrapper<table>…</table>
<thead> <tbody>Header rows vs. data rows<thead><tr>…</tr></thead>
<tr>One table row<tr><td>A</td></tr>
<th> <td>Header cell / data cell<th>Price</th><td>$4</td>

Tags — forms & input

TagWhat it doesExample
<form>Groups inputs; action says where data goes on submit<form action="/signup">…</form>
<input>One field — type picks the flavor: text, email, password, checkbox, radio, date, file<input type="email" name="em">
<label>Caption tied to a field (click it, field focuses)<label for="em">Email</label>
<textarea>Multi-line text box<textarea rows="4"></textarea>
<select> <option>Dropdown menu and its choices<select><option>FL</option></select>
<button>Clickable button; inside a form it submits<button>Send</button>

Tags — media & semantic layout

TagWhat it doesExample
<img>Image; alt text is required for accessibility<img src="dog.jpg" alt="My dog">
<video> <audio>Embedded media with optional controls<video src="clip.mp4" controls></video>
<div>Generic block container — the all-purpose box<div class="card">…</div>
<header> <footer>Top / bottom bands of a page or section<header><h1>Site</h1></header>
<nav>Navigation links<nav><a href="/">Home</a></nav>
<main>The page's primary content (one per page)<main>…</main>
<section> <article>Thematic grouping / self-contained piece (post, card)<article>…</article>
<aside>Tangential content — sidebars, pull-quotes<aside>Tip: …</aside>
Watch out: unclosed tags break layout in confusing ways · class can repeat across elements, id must be unique · semantic tags (<nav>, <main>) beat a page of anonymous <div>s for accessibility and SEO · always fill in alt on images.

CSS

Cascading Style Sheets

The wardrobe and floor plan of the web. CSS takes the structure HTML provides and decides how it looks — colors, fonts, spacing, and where everything sits on the screen.

TypeStyle sheet language Origin1996, Håkon Wium Lie & Bert Bos (W3C) StandardW3C modules ("CSS3" era) Runs onAny web browser Files.css
PurposeSeparate presentation from content — one stylesheet can reskin a thousand pages
Use casesWeb page styling, responsive mobile layouts, print styles, animations, design systems
How it runsThe browser reads style rules and applies them to matching HTML elements as it renders. Three ways in: an external .css file via <link> (best), a <style> block, or an inline style="" attribute (last resort).
Codependent withHTML — CSS has nothing to style without it. JavaScript often toggles CSS classes to animate state changes.
The "cascade"When rules conflict, the winner is decided by specificity (inline > #id > .class > element) and, on ties, whichever rule comes last

Ground rules

Rule shapeselector { property: value; } — find elements, then declare styles for them
DeclarationsEnd each property: value pair with a semicolon; colon between property and value
Comments/* only this form — no // in CSS */
CaseProperties are lowercase; class/id names are case-sensitive because HTML attributes are matched exactly
Unitspx fixed · % of parent · em/rem relative to font size · vw/vh % of screen
ColorsNames (navy), hex (#0a6cbd), rgb(10,108,189), hsl(206,90%,39%)
p { color : navy ; font-size: 16px; } selector — who gets styled property value another declaration Read it aloud: "every <p> gets navy text at 16 pixels."
Anatomy of a rule — every stylesheet is a stack of these.
margin — space outside border — the visible edge padding — space inside content
The box model — every element is these four nested layers. box-sizing: border-box makes width include padding + border.

Selectors — finding the elements to style

SelectorWhat it matchesExample
pEvery element of that tag typep { line-height: 1.5; }
.cardEverything with class="card" — reusable.card { border: 1px solid gray; }
#logoThe one element with id="logo"#logo { height: 40px; }
nav aDescendant: <a> anywhere inside <nav>nav a { color: white; }
ul > liDirect children onlyul > li { margin: 4px; }
h1, h2Either one — comma means "and also"h1, h2 { font-weight: 700; }
a:hoverState ("pseudo-class"): mouse over; also :focus, :first-child, :nth-child(2)a:hover { text-decoration: underline; }
p::first-linePart of an element ("pseudo-element"); also ::before, ::afterp::first-line { font-weight: 600; }
*Everything (use sparingly)* { box-sizing: border-box; }

Properties — text & color

PropertyWhat it doesExample
colorText colorcolor: #1a1c1e;
backgroundBackground color, image, or gradientbackground: #f3f4f6;
font-familyTypeface, with fallbacks left to rightfont-family: Georgia, serif;
font-sizeText sizefont-size: 1.1rem;
font-weightThickness: 400 normal, 700 boldfont-weight: 600;
line-heightVertical space between linesline-height: 1.5;
text-alignleft · center · right · justifytext-align: center;
text-decorationUnderlines and strikethroughstext-decoration: none;

Properties — the box

PropertyWhat it doesExample
width heightBox dimensions; max-width caps growthmax-width: 700px;
paddingSpace inside the borderpadding: 8px 16px; (vertical, horizontal)
marginSpace outside the border; margin: 0 auto centers a blockmargin: 0 auto;
borderWidth, style, color in one lineborder: 1px solid #d6d9dc;
border-radiusRounds the cornersborder-radius: 6px;
box-shadowDrop shadow: x, y, blur, colorbox-shadow: 0 2px 6px rgb(0 0 0 / .15);
overflowWhat happens when content doesn't fit: hidden, scroll, autooverflow-x: auto;

Properties — layout & responsive

PropertyWhat it doesExample
displayHow the box behaves: block (full-width), inline (in-text), flex, grid, none (removed)display: flex;
display: flexOne-direction layout; children line up in a row or columndisplay: flex; gap: 12px;
justify-contentFlex: spacing along the main axisjustify-content: space-between;
align-itemsFlex: alignment on the cross axisalign-items: center;
display: gridTwo-dimensional layout in rows and columnsgrid-template-columns: 1fr 2fr;
gapSpace between flex/grid children — cleaner than marginsgap: 16px;
positionrelative, absolute (to nearest positioned ancestor), fixed (to screen), stickyposition: sticky; top: 0;
@mediaApply rules only at certain screen sizes — the heart of responsive design@media (max-width: 600px) { nav { display: none; } }
Watch out: a more specific selector silently beats yours — check specificity before assuming a rule is "broken" · margin between stacked elements collapses to the larger value, it doesn't add · start every project with box-sizing: border-box · display: none removes; visibility: hidden hides but keeps the space.

JavaScript

standardized as ECMAScript (ES)

The web's engine room. HTML says what's on the page, CSS how it looks — JavaScript makes it do things: respond to clicks, fetch data, update the page without reloading. Despite the name, it is unrelated to Java.

TypeProgramming — multi-paradigm, dynamically typed Origin1995, Brendan Eich (Netscape) StandardECMAScript, yearly editions Runs onEvery browser · servers via Node.js Files.js .mjs
PurposeInteractivity in the browser; with Node.js, full servers, tooling, and desktop apps too
Use casesForm validation, dynamic UIs, single-page apps (React, Vue), APIs, browser games, automation
How it runsInterpreted/JIT-compiled by an engine (Chrome's V8, Firefox's SpiderMonkey). In a page: <script src="app.js"></script>. Standalone: node app.js.
Related languagesTypeScript = JavaScript + type checking (compiles to JS) · JSON grew out of JS object syntax · runs alongside HTML/CSS in every page
TypingDynamic — a variable can hold any type, and types convert themselves at runtime (the source of many surprises)

Ground rules

CaseCase-sensitive everywhere; camelCase naming by convention
StatementsSemicolons end statements — technically optional, recommended
BlocksCurly braces { } group code; indentation is style only
Comments// one line and /* block */
Variablesconst by default (can't be reassigned), let when it must change, legacy var avoided
Strings'single', "double", or backticks for templates: `Hi ${name}`
User acts click, type, scroll Listener fires addEventListener Your function runs logic, math, fetch… Page updates via the DOM "click" event calls it rewrites The DOM (Document Object Model) is the browser's live, editable copy of the HTML — JavaScript's handle on the page.
The core loop of browser JavaScript: listen → run → update.

Variables & data types

Keyword / typeWhat it isExample
constDeclare a name that can't be reassignedconst taxRate = 0.07;
letDeclare a name that can be reassignedlet total = 0;
stringText in quotes; backticks embed values`Hello ${name}!`
numberOne type for integers and decimalsconst price = 19.99;
booleantrue or falseconst isOpen = true;
arrayOrdered list, zero-indexedconst tanks = ["55g", "29g"]; tanks[0]
objectNamed key–value pairsconst dog = { name: "Bella", age: 4 }; dog.name
null / undefinedDeliberately empty / never assignedlet x; // undefined

Operators

OperatorWhat it doesExample
+ - * / %Math; % is remainder; + also joins strings7 % 2 // 1
=Assign; +=, -= modify in place; ++ adds 1total += 5;
=== !==Strict equals / not-equals — checks type too. Always use these, not ==."5" === 5 // false
< > <= >=Comparisons, result is a booleanage >= 18
&& || !and / or / notisOpen && !isFull
??Fallback when value is null/undefinedinput ?? "default"

Control flow

ConstructWhat it doesExample
if / else if / elseBranch on a conditionif (x > 10) { … } else { … }
forCounted loop: start; keep-going test; stepfor (let i = 0; i < 5; i++) { … }
for…ofLoop over each item in an arrayfor (const t of tanks) { … }
whileLoop while a condition stays truewhile (n < 100) { n *= 2; }
break / continueExit the loop / skip to the next passif (done) break;
switchBranch on many exact valuesswitch (day) { case "Mon": …; break; }
try / catchRun code that might fail; handle the errortry { risky(); } catch (e) { … }

Functions

FormWhat it doesExample
declarationNamed, reusable block; return sends a value backfunction area(w, h) { return w * h; }
arrowCompact modern form, often used inlineconst area = (w, h) => w * h;
callingName plus arguments in parenthesesarea(3, 4) // 12
default paramsFallback when an argument is omittedfunction greet(name = "friend") { … }
callbackA function handed to another function to run later — everywhere in JSlist.forEach(item => console.log(item));

The DOM & events

Method / propertyWhat it doesExample
querySelector()Find the first element matching a CSS selector (querySelectorAll for all)document.querySelector("#save")
addEventListener()Run a function when an event happens: click, input, submit, keydownbtn.addEventListener("click", save);
textContentRead or replace an element's textel.textContent = "Saved!";
classListAdd / remove / toggle CSS classes — how JS drives stylingel.classList.toggle("open");
valueRead what's typed in a form fieldinput.value
createElement()Build a new element, then attach with append()list.append(document.createElement("li"));

Modern essentials

ToolWhat it doesExample
console.log()Print to the browser console (F12) — debugging tool #1console.log("total:", total);
fetch() + awaitRequest data over the network; await pauses until it arrives (inside an async function)const r = await fetch(url); const data = await r.json();
JSON.parse() / stringify()JSON text → object / object → JSON textJSON.parse('{"a":1}').a // 1
map / filter / reduceTransform / keep-some / boil-down an array without a loopprices.filter(p => p < 20)
setTimeout()Run a function after a delay (milliseconds)setTimeout(hide, 3000);
import / exportModules: split code across files. export shares, import pulls in. In pages, needs <script type="module">.import { area } from "./math.js";
npmNode's package manager: npm install reads package.json (the project's package list) into node_modules/ — how every real JS project is set upnpm install; npm run dev
Watch out: == converts types before comparing ("5" == 5 is true) — use === · const stops reassignment, not mutation: you can still push to a const array · arrays and objects are copied by reference, so two names can point at the same data · a <script> at the top of the page runs before the HTML below it exists — put it at the end of <body> or use the defer attribute.

Python

named after Monty Python, not the snake

The most readable general-purpose language — often described as "executable pseudocode." The go-to for automation, data analysis, and learning to program, because the syntax gets out of your way.

TypeProgramming — general-purpose, dynamically typed Origin1991, Guido van Rossum StewardPython Software Foundation Runs onWindows / macOS / Linux via the interpreter Files.py .ipynb (notebooks)
PurposeA single readable language that stretches from ten-line scripts to production systems
Use casesAutomation & scripting, data analysis (pandas), AI/ML, web backends (Django, Flask), spreadsheet wrangling, glue between other tools
How it runsInterpreted: python3 script.py in a terminal. Comes with macOS/Linux; free from python.org for Windows. Interactive mode (type python3 alone) lets you experiment line by line; Jupyter notebooks mix code with notes.
Related languagesTalks to SQL databases, gets launched from the Shell, reads/writes JSON, YAML & CSV constantly; its C extensions power the fast math libraries
LibrariesThe superpower: pip install reaches 500k+ packages — pandas (data), requests (web), openpyxl (Excel)…
VersionPython 3.x only — Python 2 is long dead; ignore tutorials that print "like this"

Ground rules

Indentation IS structureBlocks are defined by indenting (4 spaces standard) — no braces. Wrong indent = different program or an error.
Colons open blocksLines that introduce a block end with :if x > 5:, def f():, for i in items:
StatementsOne per line; no semicolons needed
CaseCase-sensitive; snake_case for variables/functions, CapWords for classes
Comments# one line · triple-quoted """docstrings""" document functions
VariablesNo declaration keyword — x = 5 creates x; type is inferred and can change
def water_check(ammonia): if ammonia > 0.25: return "Do a water change" return "Water is safe" print(water_check(0.5)) ← colon opens the block 8 spaces: only runs when the if is true 4 spaces: part of the function 0 spaces: top level — runs immediately
Indentation replaces braces: how far a line is indented decides which block owns it.

Variables & data types

TypeWhat it isExample
int / floatWhole numbers / decimalscount = 3; ph = 7.4
strText; f-strings embed valuesf"pH is {ph}"
boolTrue or False — capitalized!is_safe = True
listOrdered, changeable collectiontanks = ["55g", "29g"]; tanks[0]
dictKey–value pairs — Python's workhorsedog = {"name": "Bella"}; dog["name"]
tupleOrdered and unchangeablepoint = (3, 4)
setUnordered, no duplicatesseen = {"a", "b"}
NoneDeliberate "no value"result = None

Operators

OperatorWhat it doesExample
+ - * / % **Math; / always gives a float, // floors, ** is power7 // 2 # 3 · 2 ** 10 # 1024
== !=Equal / not equal (one = assigns)ph == 7.0
and or notLogic — written as wordsis_open and not is_full
inMembership test — works on lists, strings, dicts"55g" in tanks # True
slicingCut sequences: [start:stop], stop excluded; negatives count from the endname[0:3] · items[-1]

Control flow

ConstructWhat it doesExample
if / elif / elseBranching — note elif, not "else if"if ph < 6.5: … elif ph < 7.5: … else: …
for … inLoop over each item of any collectionfor tank in tanks: print(tank)
range()Generate numbers to loop over; stop excludedfor i in range(5): # 0..4
whileLoop while a condition holdswhile n < 100: n *= 2
break / continueExit loop / skip to next passif found: break
try / exceptAttempt code that may fail; handle the errortry: int(text) except ValueError: …

Functions, imports & built-ins

ToolWhat it doesExample
defDefine a function; return hands back the resultdef area(w, h): return w * h
default argsParameters with fallbacks; call by name for claritydef greet(name="friend"): … · greet(name="Jim")
importLoad a module from the standard library or pipimport csv · from math import sqrt
print() / input()Show output / ask the user for textname = input("Name? "); print("Hi", name)
len() / type()Count items / inspect a value's typelen(tanks) # 2
int() str() float()Convert between types — input() always gives text!age = int(input("Age? "))
open()Read or write files; with closes them automaticallywith open("log.txt") as f: text = f.read()
.append() / sorted()Add to a list / get a sorted copy of anythingtanks.append("10g"); sorted(prices)
list comprehensionBuild a filtered/transformed list in one readable line — very Pythonicdoubles = [x * 2 for x in nums if x > 0]
classDefine your own type bundling data + behavior (object-oriented Python)class Tank: def __init__(self, gal): self.gal = gal

Environments & packages — actually running Python

Real projects isolate their packages in a virtual environment so project A's library versions can't break project B. The ritual, once per project:

CommandWhat it does
python3 -m venv .venvCreate the environment (a .venv folder inside your project)
source .venv/bin/activateTurn it on — your prompt grows a (.venv) prefix and pip/python now point inside it (Windows: .venv\Scripts\activate)
pip install pandasInstall a package into the active environment only
pip freeze > requirements.txtSnapshot your exact package list to a file others (or future-you) can restore with pip install -r requirements.txt
deactivateSwitch the environment off
Watch out: mixing tabs and spaces breaks indentation — set your editor to spaces · = assigns, == compares · list indexes start at 0 and range(5) stops at 4 · True/False/None are capitalized · copying a list with b = a copies the reference; use b = a.copy() for a real copy.

SQL

Structured Query Language — "sequel" or "S-Q-L", both correct

The language of data. SQL is declarative: you describe the result you want — which rows, filtered how, summarized how — and the database engine works out the fastest way to get it.

TypeQuery language — declarative, domain-specific Origin1974, Chamberlin & Boyce (IBM) StandardANSI/ISO SQL Runs onInside a database engine or warehouse Files.sql
PurposeCreate, read, update, and delete data in relational databases — data organized into tables of rows and columns, linked by keys
Use casesBusiness reporting, app backends, accounting & ERP systems, analytics, any "how many / how much / which ones" question about stored data
How it runsSQL never runs alone — you send statements to an engine: SQLite (single file, great for learning), PostgreSQL / MySQL (servers), SQL Server / Oracle (enterprise), or cloud warehouses like Snowflake and BigQuery
Related languagesPython and JavaScript apps send SQL to databases; results often travel onward as JSON
Two halvesDML (data: SELECT, INSERT, UPDATE, DELETE) and DDL (structure: CREATE, ALTER, DROP)

Ground rules

CaseKeywords aren't case-sensitive — SELECT = select — but UPPERCASE keywords is the universal convention
StatementsEnd with a semicolon ;
StringsSingle quotes: 'Orlando' (double quotes usually mean column names)
Comments-- one line and /* block */
Clause orderFixed: SELECT … FROM … WHERE … GROUP BY … HAVING … ORDER BY … LIMIT
NULLMeans "unknown" — test with IS NULL, never = NULL
YOU WRITE IT… …THE ENGINE RUNS IT SELECT FROM WHERE GROUP BY HAVING ORDER BY LIMIT FROM WHERE GROUP BY HAVING SELECT ORDER BY LIMIT get the tables filter rows form groups filter groups pick columns sort trim Why it matters: WHERE runs before SELECT, so it can't see your column aliases — but ORDER BY can.
Written order vs. execution order — the single most clarifying fact in SQL.

Reading data — the SELECT family

KeywordWhat it doesExample
SELECTChoose columns; * = all; AS renamesSELECT name, price AS cost
FROMWhich table the rows come fromFROM orders
WHEREKeep only rows matching a conditionWHERE state = 'FL'
ORDER BYSort results; DESC = high-to-lowORDER BY total DESC
LIMITCap the number of rows returnedLIMIT 10
DISTINCTDrop duplicate valuesSELECT DISTINCT city

Filtering — WHERE's toolbox

OperatorWhat it doesExample
= <> < >Compare values; <> (or !=) is "not equal"WHERE total > 100
AND OR NOTCombine conditions; parentheses control groupingWHERE state = 'FL' AND total > 100
LIKEPattern match: % = any run of characters, _ = oneWHERE name LIKE 'Jam%'
INMatch any value in a listWHERE state IN ('FL','GA','SC')
BETWEENInclusive rangeWHERE ph BETWEEN 6.5 AND 7.5
IS NULLFind missing values (IS NOT NULL for present)WHERE shipped_at IS NULL

Aggregating — from rows to answers

KeywordWhat it doesExample
COUNT()How many rows (COUNT(*)) or non-null valuesSELECT COUNT(*) FROM orders
SUM() AVG()Total / average of a numeric columnSELECT AVG(total)
MIN() MAX()Smallest / largest valueSELECT MAX(order_date)
GROUP BYOne result row per group — "per customer", "per month"SELECT state, SUM(total) FROM orders GROUP BY state
HAVINGFilter after grouping (WHERE can't see aggregates)GROUP BY state HAVING SUM(total) > 5000

Joins — combining tables

INNER JOIN matches only LEFT JOIN all left + matches RIGHT JOIN all right + matches FULL JOIN everything, matched or not
Join types — which rows survive when two tables meet. Unmatched slots come back as NULL.
JoinWhat it keepsExample
INNER JOINOnly rows with a match in both tablesSELECT c.name, o.total FROM customers c INNER JOIN orders o ON o.customer_id = c.id
LEFT JOINEvery left row, matched or not — "all customers, even those with no orders"… FROM customers c LEFT JOIN orders o ON o.customer_id = c.id
ONThe matching condition — almost always key = keyON o.customer_id = c.id

Writing data & defining structure

StatementWhat it doesExample
INSERTAdd new rowsINSERT INTO tanks (name, gallons) VALUES ('Loft', 55);
UPDATEChange existing rows — always with WHEREUPDATE tanks SET gallons = 60 WHERE name = 'Loft';
DELETERemove rows — always with WHEREDELETE FROM tanks WHERE name = 'Loft';
CREATE TABLEDefine a table: columns, types, constraintsCREATE TABLE tanks (id INTEGER PRIMARY KEY, name TEXT NOT NULL, gallons REAL);
ALTER / DROPChange a table's structure / delete it entirelyALTER TABLE tanks ADD COLUMN room TEXT;
common typesVary by engine, but roughly:INTEGER · REAL/DECIMAL · TEXT/VARCHAR · DATE · TIMESTAMP · BOOLEAN

Beyond the basics — the pro moves

ConceptWhat it doesExample
SubqueryA query inside a query — its result feeds the outer oneSELECT name FROM customers WHERE id IN (SELECT customer_id FROM orders WHERE total > 500);
WITH (CTE)Name a sub-result, then use it like a table — readable subqueries. Chain several for step-by-step logic.WITH big AS (SELECT * FROM orders WHERE total > 500) SELECT COUNT(*) FROM big;
CASE WHENIf/else inside a query — build labeled columnsSELECT total, CASE WHEN total > 500 THEN 'big' ELSE 'small' END AS size
Window functionsAggregate without collapsing rows — running totals, rankings per groupSELECT name, total, RANK() OVER (ORDER BY total DESC) AS rk
PRIMARY KEY / FOREIGN KEYPK: each row's unique ID. FK: a column that points at another table's PK — how tables relate.customer_id INTEGER REFERENCES customers(id)
CREATE INDEXA lookup structure that makes filtering/joining on a column fast — the #1 fix for a slow query. Costs a little on every write, so index what you search, not everything.CREATE INDEX idx_orders_customer ON orders(customer_id);
TransactionsGroup statements so they succeed or fail together — the accounting classic: a transfer must debit AND credit, never just oneBEGIN; UPDATE acct SET bal = bal - 100 WHERE id = 1; UPDATE acct SET bal = bal + 100 WHERE id = 2; COMMIT; — or ROLLBACK; to undo all of it
EXPLAINAsk the engine how it plans to run your query — the diagnosis tool for slownessEXPLAIN SELECT …;
SQL injection — the security lesson: never build a query by gluing user input into the SQL string. If an app runs "… WHERE name = '" + userInput + "'" and someone types '; DROP TABLE orders; --, that becomes part of the query. The fix is parameterized queries: write placeholders and let the driver pass values safely — Python: cur.execute("SELECT * FROM users WHERE name = ?", (name,)). Every language's database library supports this; there is never a good reason to concatenate.

Dialects — one language, many accents (incl. Snowflake)

Snowflake isn't a language — it's a cloud data warehouse, and the language you speak to it is SQL. Its dialect is close to the ANSI standard with analytics extras (QUALIFY for filtering window functions, FLATTEN for JSON, "time travel" to query past data). Learn standard SQL and you're ~95% of the way to Snowflake, Postgres, and the rest.
EngineKindNotable dialect quirks
SQLiteEmbedded single-file DBLoose typing; perfect for learning and small apps (it's inside your phone)
PostgreSQLOpen-source serverClosest to the standard; rich types (JSON, arrays); ILIKE for case-insensitive match
MySQL / MariaDBOpen-source serverBacktick `identifiers`; ubiquitous in web hosting
SQL Server (T-SQL)Microsoft enterpriseTOP 10 instead of LIMIT; [bracket] identifiers; common in accounting/ERP shops
SnowflakeCloud warehouseANSI + QUALIFY, semi-structured data via VARIANT/FLATTEN, zero-copy cloning, time travel
BigQueryCloud warehouseGoogleSQL dialect; billed by data scanned — SELECT * costs real money
Watch out: an UPDATE or DELETE without a WHERE hits every row — no undo · NULL = NULL is not true; use IS NULL · WHERE filters rows, HAVING filters groups · joining without a proper ON multiplies rows explosively.

Shell

Bash — the Bourne Again SHell

Your direct line to the operating system. The shell is both an interactive command line — type a command, get a result — and a scripting language for gluing programs together into automated pipelines.

TypeCommand language + scripting Origin1989, Brian Fox (GNU) — successor to Bourne's 1979 sh Runs onLinux & macOS terminals · Windows via WSL or Git Bash Files.sh
PurposeNavigate the filesystem, run and combine programs, automate repetitive machine tasks
Use casesFile wrangling, installs, server admin, deploy scripts, cron jobs, searching huge logs in seconds
How it runsOpen a terminal app and it's already running, waiting at the prompt ($). Scripts: save commands to deploy.sh, run bash deploy.sh.
Relativeszsh — macOS's default, Bash-compatible for everything here · PowerShell — Windows' native shell, different syntax · Python — the better tool once a script passes ~50 lines
Command shapeprogram -flags arguments → e.g. ls -la /home — flags tweak behavior, arguments say what to act on

Ground rules

Case & spacesCase-sensitive, and spaces separate arguments — file name.txt is two arguments unless quoted "file name.txt"
Comments# everything after the hash
VariablesNAME=value with no spaces around =; read back with $NAME
ShebangScripts start with #!/bin/bash so the OS knows what runs them
Paths/ root · ~ your home folder · . here · .. one level up
Exit codesEvery command reports success (0) or failure (non-zero) — && chains on success
cat log.txt grep "error" wc -l reads the whole file keeps matching lines counts lines | | "pipe": stdout of one becomes stdin of the next text only — every tool speaks it → screen: 14 → file: > n.txt One line — cat log.txt | grep "error" | wc -l — counts every error in a log. This composability is the whole point of the shell.
The pipeline: small programs chained by |, each doing one job well.

Commands — navigating

CommandWhat it doesExample
pwdPrint which folder you're inpwd → /home/james
lsList contents; -l details, -a hidden filesls -la
cdChange folder; cd alone goes homecd ~/projects
mkdirMake a folder; -p creates the whole pathmkdir -p reports/2026

Commands — files

CommandWhat it doesExample
cpCopy; -r for folderscp report.txt backup/
mvMove — and also how you renamemv draft.txt final.txt
rmDelete — permanently, no trash; -r for foldersrm old.txt
touchCreate an empty filetouch notes.md
catPrint a whole file; less pages through big ones (q quits)cat config.yml
head / tailFirst / last lines; tail -f follows a live logtail -20 app.log
CommandWhat it doesExample
grepFind lines matching a pattern; -i ignore case, -r whole foldergrep -ri "invoice" docs/
findLocate files by name, type, age…find . -name "*.csv"
wcCount lines (-l), words, characterswc -l data.csv
ps / killList running processes / stop one by its IDkill 4182
chmodChange permissions; +x makes a script runnablechmod +x deploy.sh
sudoRun one command as administrator — think before you type itsudo apt install git
man / whichManual for any command / where a program livesman grep
echoPrint text or a variableecho "Done: $FILE"

Pipes, redirection & chaining

SymbolWhat it doesExample
|Pipe: send one command's output into the nextls | wc -l
>Write output to a file (overwrites!)ls > files.txt
>>Append to a file insteadecho "row" >> log.txt
<Feed a file in as inputsort < names.txt
&&Run the next command only if the last succeededmkdir out && cd out
*Wildcard: matches any characters in filenamesrm *.tmp

Scripting basics

ConstructWhat it doesExample
variablesSet and use; $(…) captures a command's outputTODAY=$(date +%F); echo $TODAY
ifBranch; [ ] is the test — spaces required insideif [ -f "$FILE" ]; then echo "exists"; fi
forLoop over files or valuesfor f in *.csv; do wc -l "$f"; done
$1 $2 …Arguments passed to your scriptbash backup.sh reports # $1 = reports

The ops toolkit — remote, scheduled & packaged

CommandWhat it doesExample
sshOpen a secure shell on another machine — how all servers are administered. Key-based login (ssh-keygen) beats passwords.ssh james@server.example.com
scpCopy files over SSH (also rsync for smart syncing)scp report.pdf james@server:/backups/
curlMake an HTTP request from the terminal — test APIs, download files, check if a site is up. -I = headers only.curl -I https://example.com
cronRun a command on a schedule. crontab -e edits your jobs; each line is five time fields + a command: minute, hour, day-of-month, month, day-of-week (* = every).0 6 * * 1 bash ~/backup.sh (Mondays 6:00am)
tarBundle + compress folders: -czf creates a .tar.gz, -xzf extracts onetar -czf logs.tar.gz logs/
apt / brewPackage managers — install software from the command line (apt on Debian/Ubuntu Linux, Homebrew on macOS)brew install python
df -h / du -shDisk space free / how big is this folder — the "server is full" first respondersdu -sh ~/Downloads
topLive view of CPU/memory by process (q quits); htop is the nicer versiontop

Environment variables, PATH & permissions decoded

Environment variablesNamed values every program can read — config that lives outside your code. export API_KEY=abc123 sets one for this session; env lists them all; put exports in ~/.bashrc / ~/.zshrc to make them permanent. Apps read secrets this way instead of hard-coding them.
PATHThe list of folders the shell searches when you type a command. command not found almost always means the program isn't installed or its folder isn't on PATH. See it with echo $PATH; find where a command lives with which python3.
PermissionsEvery file has read/write/execute rights for owner, group, and everyone: rwxr-xr--. Each trio is a number — r=4, w=2, x=1, added up — so rwx=7, r-x=5, r--=4, and chmod 755 deploy.sh means "owner: everything; everyone else: read + run." ls -l shows them; 644 is the normal file default, 755 for scripts and folders.
Watch out: rm is forever — there is no undo and no recycle bin · one stray space (rm -r / tmp) can be catastrophic; read destructive commands twice · always quote variables that might contain spaces: "$FILE" · > silently overwrites; you probably meant >> · macOS defaults to zsh — everything on this page still works.

Code Explainer

paste a command or snippet · get every piece numbered and explainedLive AI · written by Claude

The fastest way to learn syntax is to take apart code you actually meet: an install line from a README, a command Claude hands you, a query a coworker sent. Paste it here and each piece gets a number that matches a row in the legend, plus a plain-English summary, the same job written as an instruction to a person, and the safety habits that apply.

TypeInteractive tool ReadsShell, Git, SQL, Python, JavaScript, regex, config… EngineClaude for live breakdowns · hand-written examples RunsNothing — it only explains

Break down a command or snippet

0 / 6000
Worked examples

Where the answers come from: the four worked examples are hand-written and work on every copy of this page. Live breakdowns are written by Claude and appear on copies where the explainer is switched on; you'll be asked for permission before the first one. Because live breakdowns are generated, confirm the key flags with man <command> or <command> --help before you run anything marked Caution or Danger.

How to read a breakdown

Numbered codeEach piece of the code carries a small number. Hover or tap a number and its legend row lights up, and the other way round.
LegendWhat it is: the piece's job in plain words, with acronyms spelled out. Why it matters: what changes if it's missing, or what it protects you from.
RiskLow risk: reads or displays only. Caution: changes files or state, publishes something, or runs downloaded code from a trusted source. Danger: deletes or overwrites in bulk, runs as administrator, or is hard to undo.
In plain EnglishWhat the whole thing does, in one or two sentences.
Instruction to a personThe same job, phrased the way you'd ask an assistant to do it by hand. If you couldn't say that sentence out loud, you're not ready to run the command.
Safer way to run itA version with a preview step, narrower scope, or a check first. It's left out when the code already follows the safe pattern.

Safety habits for any code you didn't write

HabitWhat to doWhy
Read before you runSave a script instead of piping it: curl -fsSL URL -o install.sh, read it with less install.sh, then bash install.shA pipe into bash runs code you never saw, with your account's permissions
Spot the destructive verbsSlow down at rm, >, mv onto an existing name, git reset --hard, push --force, DROP, and DELETE or UPDATE without WHERENone of them has an undo
Treat sudo as a red flagOnly use sudo when the official docs say the step needs itIt runs the whole command as administrator, typos included
Preview firstUse the dry-run flag where one exists (rsync -n, git clean -n); run a SELECT with the same WHERE before a DELETEYou see exactly what will be hit before anything changes
Quote paths and variables"$FILE", "My Folder/notes.txt"An unquoted space splits one path into two arguments, and the command acts on the wrong thing
Keep secrets out of commandsPut keys in environment variables or a .env file listed in .gitignore. Never paste them into chats, forums or tools like this one.Typed secrets land in your shell history (~/.zsh_history on a Mac) and in anything you paste them into
Paste into a text editor firstBefore running a command copied from a website, paste it somewhere plain and read itA page can hide extra text in what you copy ("pastejacking"), including a line break that runs it the moment you paste
Have an undo planCommit or back up before a big change; know how you'd reverse it"How do I get back?" is easier to answer before, not after
Watch out: never paste passwords, API keys or tokens into an explainer or a chat. This page catches the common formats and offers to redact them, but it can't catch everything · a Low risk rating isn't permission to run code you don't understand · a breakdown describes what the code is supposed to do; the URL, file or database it points at can still surprise you · the explainer never runs anything, so trying a breakdown is always safe.

Git

distributed version control — not a language, but tool #1

A time machine for your files. Git records snapshots (commits) of a project so you can see every change, undo anything, try ideas on side branches, and collaborate without overwriting each other. GitHub is a website that hosts Git repositories — related, not the same thing.

TypeVersion control system Origin2005, Linus Torvalds (built to manage Linux) Runs onAny OS, from the shell (git CLI) or GUIs HostsGitHub · GitLab · Bitbucket
PurposeFull history of a project, safe experimentation, and the standard mechanism for teams to merge work
Use casesAll software, but also docs, configs, infrastructure files — anything text-based worth tracking
How it runsA repository ("repo") is just a folder with a hidden .git subfolder holding the entire history. Commands run in the shell from inside that folder.
Core vocabularycommit — one saved snapshot with a message · branch — an independent line of work · merge — combine branches · remote — the copy on a server · clone — download a repo · pull request (PR) — GitHub's "please review & merge my branch"
Working directory your files, as edited Staging area changes marked "in the next snapshot" Local repo (.git) committed history Remote GitHub's copy git add git commit git push git pull The daily rhythm: edit files → add what belongs together → commit with a message → push to share.
Git's four zones — every command below moves changes between them.

Starting out

CommandWhat it doesExample
git initTurn the current folder into a repogit init
git cloneDownload an existing repo, history and allgit clone https://github.com/user/proj.git
git statusWhat's changed, what's staged — run it constantlygit status
git logBrowse the commit history; --oneline for the compact viewgit log --oneline

The everyday loop

CommandWhat it doesExample
git addStage changes for the next commit; . = everything changedgit add report.py
git commitSnapshot what's staged, with a message saying whygit commit -m "Fix tax rounding"
git pushUpload your new commits to the remotegit push
git pullDownload others' commits and merge them into your copy — do this before you start workinggit pull
git diffShow exactly what changed, line by line; --staged for what's about to commitgit diff

Branching & merging

CommandWhat it doesExample
git branchList branches (* marks yours); the default is maingit branch
git switch -cCreate and jump to a new branch (older tutorials say checkout -b — same thing)git switch -c fix-login
git mergeFold another branch's commits into the current onegit switch main; git merge fix-login
merge conflictWhen both branches changed the same lines, Git marks the file with <<<<<<< / >>>>>>>; you edit to keep what's right, then add + commit. Annoying, normal, fixable.
git stashShelve uncommitted changes to come back to (stash pop restores)git stash

Undoing things — safely

CommandWhat it doesExample
git restoreThrow away uncommitted edits to a file (back to last commit)git restore report.py
git restore --stagedUn-stage a file without losing the editsgit restore --staged report.py
git revertUndo a commit by adding a new opposite commit — history stays intact; the safe choice on shared branchesgit revert a1b2c3d
git reset --hardRewind the branch and destroy changes since — powerful, dangerous, mostly for local mistakesgit reset --hard HEAD~1
.gitignoreA file listing paths Git should never track — build output, .venv/, node_modules/, and every secretecho ".venv/" >> .gitignore
Watch out: commit small and often — a commit is free, and un-losing work later depends on it · never commit passwords or API keys; a secret pushed to GitHub is compromised even if you delete it next commit (the history remembers) · pull before push to avoid rejected pushes · "detached HEAD" sounds fatal but just means you're viewing an old commit — git switch main gets you back.

HTTP & APIs

HyperText Transfer Protocol — how everything on the web talks

Every page load, form submit, and app sync is the same conversation: a client sends a request, a server sends back a response. An API — Application Programming Interface — is any defined way for one program to use another; on the web it means a server that answers with data (usually JSON) instead of pages, so programs can talk to it.

TypeProtocol (rules of conversation, not a language) Origin1991, Tim Berners-Lee; HTTP/1.1 1997 · /2 2015 · /3 2022 StandardIETF RFCs HTTPS= HTTP wrapped in TLS encryption
Shape of itRequest: method + URL + headers (+ sometimes a body). Response: status code + headers + body. One exchange, then done.
StatelessThe server forgets you between requests — cookies and tokens exist precisely to remind it who you are
RESTThe common API style: URLs name things (/customers/42), methods say what to do to them, answers come back as JSON
Try it yourselfShell: curl https://api.github.com/users/octocat · JS: fetch(url) · Python: requests.get(url) · or just DevTools (F12) → Network tab while browsing
https :// api.shop.com :443 /products/42 ?size=large&color=red #reviews scheme (protocol) host — subdomain.domain.tld port (usually hidden) path — which resource query string — options, as key=value pairs fragment — a spot on the page Port 443 is implied by https (80 by http), so you rarely see it — until something runs on a nonstandard port like :8080.
Anatomy of a URL — every piece has a job.

Methods — the verbs

MethodWhat it meansTypical use
GETRead — fetch a resource, change nothingLoading a page; GET /products/42
POSTCreate — send new data in the request bodySubmitting a form; POST /orders
PUT / PATCHUpdate — replace a resource entirely / change part of itPATCH /customers/42 with {"city": "Orlando"}
DELETERemove the resourceDELETE /orders/977

Status codes — the server's one-number verdict

First digit = the family. Memorize the family meanings and you can read any code you meet.

CodeNameWhat it really means
2xx — successThe request worked
200OKHere's what you asked for
201 / 204Created / No ContentMade the thing / worked, nothing to send back
3xx — redirectWhat you want is elsewhere
301 / 302Moved permanently / temporarilyGo to this other URL (browsers follow automatically)
304Not ModifiedYour cached copy is still good — nothing re-sent
4xx — your faultThe client's request is the problem
400Bad RequestMalformed — the server couldn't parse what you sent
401 vs 403Unauthorized vs Forbidden401: you're not logged in. 403: you are, but you're not allowed. The classic interview distinction.
404Not FoundNo resource at that path — often just a typo'd URL
429Too Many RequestsRate limited — slow down and retry later
5xx — server's faultYour request was fine; the server broke
500Internal Server ErrorThe server's code crashed handling your request
502 / 503Bad Gateway / UnavailableA middleman couldn't reach the app / it's down or overloaded — the ops on-call classics

Headers — the metadata riding along

HeaderWhat it carriesExample
Content-TypeWhat format the body isContent-Type: application/json
AuthorizationWho you are — usually an API key or tokenAuthorization: Bearer eyJhbG…
Cookie / Set-CookieThe server's memory of you — session IDs, preferencesSet-Cookie: session=a91x…
Cache-ControlHow long this response may be reused without re-askingCache-Control: max-age=3600
User-AgentWhat client is asking (browser, curl, bot)User-Agent: Mozilla/5.0 …

Calling an API — one example, three languages

FromThe call
Shellcurl -H "Authorization: Bearer $TOKEN" https://api.example.com/orders
JavaScriptconst r = await fetch(url, { headers: { Authorization: `Bearer ${token}` } }); const data = await r.json();
Pythonr = requests.get(url, headers={"Authorization": f"Bearer {token}"}); data = r.json()
Watch out: GET requests must never change data — crawlers and prefetchers hit them freely · secrets go in headers, never in the URL (URLs land in logs and browser history) · always check r.status / r.ok before trusting a response · if a browser fetch fails with a CORS error, that's the server declining cross-site JavaScript calls — a server-side setting, not a bug in your code.

Networking

IPs, ports, DNS & TLS — the plumbing under everything

Before any HTTP conversation can start, the network has to find the machine (DNS → IP), reach the right program on it (port), and secure the line (TLS). When "the site is down," the break is usually in one of those three steps.

TypeConcepts & protocols StandardsIETF (TCP/IP since 1983) Runs onEvery networked device you own
IP addressA machine's number on the network — 192.168.1.20 (IPv4) or the longer 2001:db8::… (IPv6). Private ranges like 192.168.x.x live behind your router; the world sees one public IP.
PortA numbered door on that machine, one per listening program — web server on 443, database on 5432. host:port together name one service.
DNSThe internet's phone book: turns claude.ai into an IP address. Records: A (name→IP), CNAME (name→other name), MX (mail). Answers are cached, which is why DNS changes "take a while to propagate."
TCP vs UDPTCP: reliable, ordered delivery with a handshake (web, email, SSH). UDP: fire-and-forget speed (video calls, games, DNS lookups).
TLSThe encryption layer (the padlock). The server proves its identity with a certificate signed by an authority the browser trusts. Certificates expire — an expired cert is one of the most common self-inflicted outages in IT.
localhost127.0.0.1 — this machine talking to itself. localhost:3000 is your own dev server, invisible to everyone else.
1 · DNS lookup shop.com → 93.184.34.9 2 · TCP connect to 93.184.34.9:443 3 · TLS handshake cert checked, line encrypted 4 · HTTP requests & responses flow Troubleshooting order follows the same chain: can't resolve the name? DNS. Resolves but can't connect? firewall/port. Connects but padlock error? certificate.
The four steps behind every https page load — and the diagnosis order when one fails.

Well-known ports worth recognizing

PortServicePortService
22SSH (remote shell, scp)443HTTPS
53DNS3306MySQL
80HTTP (unencrypted)5432PostgreSQL
25 / 587Email (SMTP)3000 / 8080Common dev-server defaults

Diagnostic commands — the ops first-aid kit

CommandWhat it answersExample
ping"Can I reach that machine at all, and how fast?"ping claude.ai
dig / nslookup"What IP does this name resolve to?" — DNS truth-tellerdig claude.ai
traceroute"Where along the path does it die?" — hop-by-hop routetraceroute claude.ai
curl -I"Is the web service answering, and with what status?"curl -I https://claude.ai
lsof -i :3000"What program is holding that port?" — the fix for "address already in use"lsof -i :3000
ip addr / ifconfig"What's my IP address?"ip addr
Watch out: localhost works ≠ the network works — 127.0.0.1 never leaves your machine · "it works for me, not for them" is very often cached DNS · a firewall silently dropping a port looks identical to a down server; test with curl from another machine · certificate expiry dates belong on a calendar.

Regex

regular expressions — one pattern language, used everywhere

A compact language for describing text patterns: "three digits, a dash, four digits" instead of listing every phone number. Learn it once and it works in JavaScript, Python, SQL, grep, and every editor's find-and-replace.

TypePattern-matching mini-language Origin1950s theory (Kleene); practical via Unix tools, 1970s RunsInside other languages & tools — never alone Sandboxregex101.com explains any pattern live
WhereHow you use it
JavaScript/\d{3}-\d{4}/.test(str) · str.match(/…/g) · str.replace(/…/g, "new")
Pythonimport re then re.search(r"\d{3}-\d{4}", text) — the r"…" raw-string prefix keeps backslashes literal
Shellgrep -E "error|warn" app.log-E enables the full syntax
SQLPostgres: WHERE name ~ '^Jam' · Snowflake/MySQL: REGEXP_LIKE(name, '^Jam')LIKE's %/_ is the simpler cousin
EditorsVS Code / every IDE: the .* toggle in find-and-replace
^ \( \d{3} \)   \d{3} - \d{4} $ start of text \( \) = literal parens, escaped \d = any digit · {3} = three of them plain characters match themselves end of text Matches (407) 555-0193 — and rejects anything more, less, or shaped differently.
Anatomy of a pattern — a US phone number, piece by piece.

Characters & classes — what to match

PatternMatchesExample
abcThose literal characters, in ordercat matches "cat" in "concatenate"
.Any single character (except newline)c.t → "cat", "cot", "c9t"
\d \w \sDigit / word character (letter, digit, _) / whitespace — capitals negate: \D = non-digit\d\d:\d\d → "14:30"
[aeiou]Any ONE character from the setgr[ae]y → "gray" or "grey"
[a-z0-9]Ranges inside a set[A-F0-9] → one hex digit
[^abc]Any character NOT in the set[^,]+ → everything up to a comma
\.Escape to match a special character literally: . * + ? ( ) [ ] { } ^ $ | \\$\d+ → "$450"

Quantifiers & anchors — how many, and where

PatternMeansExample
* + ?0 or more / 1 or more / 0 or 1 (optional)colou?r → "color" and "colour"
{3} {2,5} {2,}Exactly 3 / between 2 and 5 / 2 or more\d{5} → a ZIP code
^ $Start / end of the text (or line) — without them, a pattern matches anywhere inside^Total → lines starting with "Total"
\bWord boundary — whole-word matching\bcat\b matches "cat", not "concatenate"
(…)Group: apply a quantifier to several characters, or capture the match for reuse (\1, or $1 in replacements)(ha)+ → "hahaha"
|Orerror|warn|fatal
*?Lazy: shortest match instead of longest — quantifiers are greedy by default".*?" → each quoted string, not one giant span

Recipes you'll actually reuse

GoalPatternMatches
US ZIP^\d{5}(-\d{4})?$32765 · 32765-1234
Date (ISO)\d{4}-\d{2}-\d{2}2026-08-29
Email (practical)^[\w.+-]+@[\w-]+\.[\w.]+$Good enough for validation; a truly complete email regex is famously monstrous
Money amount\$\d{1,3}(,\d{3})*(\.\d{2})?$4.99 · $1,250,000.00
Log lines w/ level^(ERROR|WARN)\b.*$grep-ready error filter
Watch out: greedy is the default — ".*" grabs from the first quote to the last; add ? for shortest · forgetting ^…$ anchors is why "validation" passes garbage like "xx32765xx" · escape your dots: claude.ai unescaped also matches "claudeXai" · regex is for patterns, not structure — don't parse HTML or JSON with it; use a real parser · build patterns a piece at a time on regex101.

Markdown

plain text that formats itself

Formatted writing without a word processor: a few punctuation marks tell any renderer where the headings, bold text, links, and lists are — and the raw file stays perfectly readable.

TypeLightweight markup Origin2004, John Gruber with Aaron Swartz StandardsCommonMark · GitHub Flavored (GFM) Renders onGitHub, Reddit, Discord, Notion, Obsidian, chat apps, docs sites Files.md
PurposeWrite once in plain text; render as clean HTML anywhere — headings, emphasis, links, code
Use casesREADMEs, documentation, note-taking systems, blog posts, wikis, AI chat formatting
How it runsIt doesn't "run" — a renderer converts it to HTML for display. Any text editor writes it.
Related languagesCompiles to HTML (and raw HTML tags work inside it); YAML front-matter tops many .md files

The whole language in one table

ElementYou typeYou get
Heading# H1 · ## H2 · ### H3 (up to 6)Heading text
Bold / italic**bold** · *italic* · ***both***bold · italic · both
Strikethrough~~done~~ (GFM)done
Bulleted list- item (or *); indent 2 spaces to nest• item
Numbered list1. first — numbers auto-correct themselves1. first
Checklist- [ ] todo · - [x] done (GFM)☐ todo · ☑ done
Link[text](https://url.com)text
Image![alt text](photo.jpg) — a link with ! in frontthe image, inline
Inline code`code` (backticks)code
Code block```python``` — language name turns on highlightinga highlighted block
Quote> quoted linequoted line
Divider--- on its own line
Table| A | B | then |---|---| then data rowsa real table (GFM)
Watch out: a blank line is required before a list or it glues to the paragraph above · paragraphs need a blank line between them; a single Enter is ignored (end a line with two spaces to force a break) · renderers differ at the edges — GitHub's GFM adds tables, checklists, and strikethrough to the core.

JSON & YAML

the data formats everything else exchanges

Not programming languages — data serialization formats: standard ways to write structured data as text so any language can read it. JSON is the machine favorite (APIs); YAML is the human favorite (config files). They represent the same shapes: values, lists, and key–value maps.

TypeData formats JSON2001, Douglas Crockford — from JS object syntax YAML2001 — a superset of JSON Files.json · .yml / .yaml
JSONYAML
Sweet spotData in motion: API responses, saved app stateData you edit by hand: Docker Compose, CI/CD pipelines, app settings
Structure byBraces { } and brackets [ ]Indentation (2 spaces) and dashes
CommentsNone allowed — a real limitation# yes
QuotesDouble quotes required on all keys & stringsUsually optional
TypesBoth: strings, numbers, booleans, null, lists, nested maps
Read it inJS: JSON.parse() · Python: json.load()Python: yaml.safe_load() (pip install pyyaml)

The same data, both ways

// person.json  (comments NOT
//  actually allowed in JSON!)
{
  "name": "James",
  "city": "Orlando",
  "certified": true,
  "gpa": null,
  "tanks": [55, 29, 6, 5],
  "dog": {
    "name": "Bella",
    "breed": "mixed"
  }
}
# person.yaml — same structure,
# and comments are legal here
name: James
city: Orlando
certified: true
gpa: ~          # null
tanks:
  - 55
  - 29
  - 6
  - 5
dog:
  name: Bella
  breed: mixed

Same keys, same nesting, same types — braces and brackets on the left become indentation and dashes on the right.

JSON rules

ShapeAn object {"key": value} or array [a, b] at the top; values nest freely
StringsDouble quotes only: "name": "James" — single quotes are invalid
No trailing commas[1, 2, 3,] ✗ — the classic hand-written JSON error
Literalstrue, false, null — lowercase

YAML rules

Mapskey: value — space after the colon is required
ListsOne - item per line, indented under the key
NestingBy indentation — spaces only, tabs are a syntax error
Quote when oddStrings that look like other types need quotes: version: "1.10", country: "NO" (unquoted no can parse as false in old YAML)
So what's Docker? Since its config files are YAML's biggest use case: Docker packages an app plus everything it needs (runtime, libraries, settings) into an image — a frozen recipe — and runs copies of it as containers, identical on any machine. That kills "works on my machine" bugs. A Dockerfile defines the image; docker-compose.yml (YAML!) describes several containers that run together — say, a Python app + a Postgres database. Core loop: docker builddocker rundocker ps to see what's running.
Watch out: JSON: no comments, no trailing commas, double quotes always — when in doubt, paste into a validator · YAML: indentation is the structure, and one misaligned space changes the meaning; never use tabs · both: a syntax error usually breaks the entire file, not just one line.

Topic index

Two ways in: the Rosetta table shows the same idea written in each language side by side; the A–Z index jumps straight to any topic's section.

Rosetta table — one idea, four languages

ConceptJavaScriptPythonSQLShell (Bash)
Comment// note# note-- note# note
Variableconst x = 5;x = 5X=5
Print / outputconsole.log(x)print(x)SELECT x;echo $X
Text with a value in it`pH is ${ph}`f"pH is {ph}"CONCAT('pH is ', ph)"pH is $PH"
Equality testa === ba == ba = b[ "$a" = "$b" ]
If / branchif (x > 5) { … }if x > 5:CASE WHEN x > 5 THEN … ENDif [ $X -gt 5 ]; then …; fi
Loop over itemsfor (const t of tanks)for t in tanks:— (queries act on all rows at once)for f in *.csv; do …; done
Define a functionconst f = (a) => a * 2;def f(a): return a * 2CREATE FUNCTION (varies by engine)f() { echo $1; }
List / collection[1, 2, 3][1, 2, 3]a table's rows(1 2 3)
"Nothing" valuenull / undefinedNoneNULLempty string
Filter a collectionrows.filter(r => r.total > 100)[r for r in rows if r.total > 100]WHERE total > 100grep "error" file

HTML, CSS, Markdown, JSON and YAML sit this table out — they describe structure and data rather than executing steps, which is exactly the markup / programming divide on the Overview tab.

A–Z index