Courses / Software & Tools / Reference
Code, build, test, artefact, deploy, run The stations one change passes on its way to users The path to production Compiled / interpreted Turned into machine code ahead of time / read by a runtime as it runs Languages Lock file Pins the exact version of every dependency, direct and indirect Dependencies MAJOR.MINOR.PATCH Breaking change / new feature / fix (Semantic Versioning) Dependencies ^1.4.2 / ~1.4.2Any 1.x from 1.4.2 / any 1.4.x from 1.4.2 (npm ranges) Dependencies Lock file The exact version, and usually the hash, of every package a build uses. Commit it; install with the strict command (npm ci, uv sync --locked, cargo build --locked). Lock files Build once, promote The same artefact goes to test, staging and production The artefact Digest The SHA-256 hash of an artefact, such as shop-api@sha256:ef91.... It cannot point at different content, unlike a tag. Tags and digests Dev, test, staging, production Each environment answers one question Environments Config in the environment Settings change per environment; the artefact does not Environments Runtime mismatch "Works on my machine": a different version of the language or a library Runtime Multi-platform image One tag that holds a build for each CPU type (linux/amd64, linux/arm64); the registry serves the one that matches the host. CPU architecture
int float str bool NoneThe basic types; `type(x)` tells you which Values and types // and % Floor division and remainder: 7 // 2 is 3, -7 // 2 is -4, -7 % 2 is 1. / always returns a float. Operators a = bTies a second name to the same object; it does not copy Names is vs ==Same object / equal value Names if / elif / elseThe first true condition wins; indentation is the syntax Conditions Falsy values `0` `''` `[]` `{}` `None` `False` Conditions for x in items:Each item in turn; `range(n)` for 0 to n − 1 Loops while cond: / break / continueRepeat until it changes / leave the loop / skip to the next turn Loops for ... else The else block of a loop runs only when the loop finished without break. range(start, stop, step) never includes stop. Loop control def f(a, b=1): / returnA named step with a default argument / its result Functions f-string `f"{host}:{port}"` Functions Mutable default def f(x, seen=[]) shares one list between all calls. Write seen=None and create the list in the body. Arguments
items[0] items[-1] items[1:3]First, last, a slice (end not included) Lists append len sorted inAdd, count, sort a copy, test membership Lists tuple and set A tuple is a list that cannot change, so it can be a dict key. A set holds unique items and answers "in" with one lookup. Containers d["k"] / d.get("k", default)Look up by key / without an error when missing Dictionaries for k, v in d.items():Every key and value Dictionaries List of dicts A table: one dict per row Dictionaries [x for x in xs if cond]Filter and transform in one line Comprehensions with open(path) as f:The file is closed even if something fails Files json.load, csv.DictReader The standard readers for JSON and CSV files. JSON keeps numbers, booleans and null; every CSV cell is a string. JSON and CSV files try: except ValueError as e: finally:Catch one kind of error; always clean up Errors python -m venv .venv pip install -r requirements.txtA private set of packages per project Errors try / except / else / finally except runs on a matching error, else when there was none, finally always. Clauses are tried top to bottom; a subclass must come before its parent. try blocks
TOML / CSV Config with no type surprises / rows of text, quote fields with commas Formats JSON values Object, array, string, number, true/false, null; no comments JSON jq '.items[].name'Pick fields out of JSON on the command line JSON 2^53 - 1 9,007,199,254,740,991: the largest integer a JavaScript number, and so much JSON tooling, holds exactly. JSON limits YAML Same data, indentation as structure; spaces only, never tabs YAML Block scalar A multi-line YAML string. | keeps line breaks, > folds them into spaces, and a minus (|- or >-) drops the final newline. Multi-line strings The Norway problem In YAML 1.1 `no` is false; quote strings like `"NO"` YAML mistakes version: 1.10Read as the number 1.1; quote it YAML mistakes JSON Schema Lets a machine check the shape of a document before use Validation Precedence Default, then file, then environment variable, then command-line flag Validation additionalProperties A JSON Schema keyword. Set to false, any key the schema does not name is an error, which catches typing slips. JSON Schema
Version control A record of every saved state of a project, with author, date and message; Git is the common one Why version control Commit A full snapshot, its parent, author and message, named by its hash Commits Working tree, staging area, repository Edit, `git add`, `git commit` The three areas git status / git diff / git diff --stagedWhat changed, unstaged, staged The three areas git status -s Short status: the first column is the staging area, the second the working directory, ?? is untracked. git status .gitignore Patterns for files Git should not add. It has no effect on files already tracked (use git rm --cached) or on history. .gitignore git log --oneline --graph --allThe whole history as a graph History Detached HEAD HEAD points at a commit, not a branch: make a branch before you commit History git log -S, git blame git log -S text lists commits that added or removed that text; git blame shows the last commit to change each line of a file. Searching history
Branch A movable label pointing at one commit Branches .git/objects .git/refs HEADThe content store, the labels, where you are Branches git switch -c featureCreate a branch and move to it The graph Fast-forward The branch label slides forward; no merge commit Fast-forward Merge commit Two parents: records that two lines of work joined Merge commits <<<<<<< ======= >>>>>>>Conflict markers: yours, then theirs; edit, `git add`, continue Conflicts git merge main / git rebase mainJoin histories / replay your commits on top Merge or rebase Golden rule Never rebase commits others already have Merge or rebase --force-with-lease A forced push that succeeds only if the remote branch is still where your last fetch saw it. Pushing a rebase git restore fileThrow away uncommitted changes to a file Undoing git reset --soft HEAD~1Undo the last commit, keep the changes (private work only) Undoing git revert <commit>A new commit that undoes one: safe on shared branches Undoing git reflogEvery place HEAD has been; recover "lost" commits Undoing reset --soft, --mixed, --hard All three move the branch label. --mixed (the default) also resets the staging area; --hard also overwrites the working files. reset modes
git clone / git push / git pullCopy everything / send commits / fetch and merge Remotes git fetch then origin/mainSee what the remote has before merging it Remotes Push rejected The remote has commits you lack: pull first, then push Pushing Pull request A proposed merge with review, checks and discussion Pull requests Merge / squash / rebase Keep every commit / one commit / replay commits without a merge commit Pull requests Branch protection, rulesets Required reviews and checks; no direct pushes Branch protection CODEOWNERS Who must review changes to which paths Branch protection Repository roles Read, Triage, Write, Maintain and Admin, each including the one before. Only reviews from Write or above count as required approvals. Repository roles CODEOWNERS A file mapping path patterns to owners who are asked to review. The last matching line wins; a branch rule can make their approval required. CODEOWNERS Fixes #12Closes the issue when the pull request merges Issues Fork Your own copy to propose changes without write access Issues
Request Method, URL, headers, optional body; the response has a status, headers, body One API call curl -s -H 'Accept: application/json' URL | jqCall an API by hand One API call curl --fail-with-body Makes curl exit with code 22 on a 4xx or 5xx status while still printing the body. Without it curl exits 0. curl GET POST PUT PATCH DELETE Read, create, replace, change, remove REST Safe / idempotent GET changes nothing / GET, PUT and DELETE can be repeated safely; POST cannot REST 2xx 3xx 4xx 5xx Done / go elsewhere / your mistake / the server's Status codes 200 201 204 301 400 401 403 404 409 429 500 503 The codes you will see most Status codes Exponential backoff Doubling the wait between retries (1, 2, 4, 8 s...), with a random jitter so that clients do not retry in step. Retries Authorization: Bearer <token>A token proves who is calling Authentication 401 vs 403 Not identified / identified but not allowed Authentication JWT JSON Web Token: header, payload and signature in Base64, joined by dots. Signed, not encrypted; valid until its exp claim. JWT Pagination Follow the next link or cursor until there is none Pagination 429 + Retry-AfterToo many requests: wait as long as it says Pagination
Console, CLI, SDK Three doors to the same API Three doors aws s3 ls / az vm list / gcloud compute instances listTool, group, action: the same grammar CLI grammar --output json --queryMachine-readable output, then pick fields CLI grammar Exit code 0 succeeded; scripts check it (`set -e`) CLI grammar --query, --output Options that pick fields from a CLI response (JMESPath in aws and az) and set its format: json, text, tsv, table. Output for scripts Credential order Flags, environment variables, config files, then the role of the machine Credentials aws sts get-caller-identityWho am I calling as? Credentials Roles over keys Short-lived credentials, nothing stored in the script Credentials Managed identity, service account The Azure and Google Cloud equivalents of an AWS IAM role on a machine: an identity attached to the resource, with no stored key. Three clouds Idempotent Safe to run twice: check before you create Idempotency Waiter A CLI or SDK helper that polls until a resource reaches a state. aws ec2 wait instance-running checks every 15 s, 40 times. Waiters Paginators Ask the SDK for every page, not just the first A whole task
Declarative Describe the result; Terraform works out the steps Declarative Provider The plugin that talks to one platform's API Declarative count, for_each Two ways to make several copies of a resource. count addresses them by number (s[0]); for_each by key (s["web"]). count and for_each terraform init fmt validate plan apply destroyThe workflow Plan and apply + - ~ -/+Create, destroy, update in place, replace Reading a plan lifecycle { prevent_destroy = true }Refuse to destroy this resource Reading a plan lifecycle A block inside a resource: create_before_destroy, prevent_destroy, ignore_changes, replace_triggered_by. lifecycle Drift A change made by hand; the next apply undoes it Drift State Terraform's record of what exists; contains secrets; store it remotely with locking Drift Module, variable, output Reusable blueprint, its inputs, its results Modules Variable precedence Lowest to highest: default, TF_VAR_name, terraform.tfvars, terraform.tfvars.json, *.auto.tfvars, then -var and -var-file. Variable precedence
.github/workflows/*.ymlWhere workflows live Workflows on: jobs: steps: runs-on:Event, jobs, steps, machine Workflows workflow_dispatch, schedule Manual and timed triggers. Both use the workflow file on the default branch; cron is in UTC, every 5 minutes at most. Triggers CI / CD Test every change / ship the artefact that passed CI and CD GITHUB_OUTPUT A file a step appends name=value lines to. The job maps them to outputs, and a later job reads needs.<job>.outputs.<name>. Outputs and conditions ${{ secrets.NAME }}Use a secret without writing it in the file Secrets OIDC Short-lived cloud credentials for the pipeline, no stored keys Secrets Canary 1% of users first, watch errors, then everyone Deployment Blue-green / rolling Switch all traffic to a new copy / replace servers a few at a time Deployment actions/upload-artifactCarry files between jobs; each job starts clean Artefacts strategy: matrix:Run one job across several versions or systems Artefacts timeout-minutes The ceiling on a job or step. The default for a job on a GitHub-hosted runner is 360 minutes. Limits and defaults
Test pyramid Many unit tests, fewer integration tests, few end-to-end tests Kinds of test Test double A stand-in for a real dependency in a test: a stub returns fixed answers, a mock also records calls, a fake is a small working version. Test doubles Arrange, act, assert The shape of a unit test Unit tests pytest -qRun Python tests Unit tests pytest.mark.parametrize Runs one test function once for each listed set of inputs, reporting every case by name. Parametrised tests Linter, formatter, type checker, tests Quality gates machines run before review Quality gates Coverage Shows a line ran, not that anything checked it Quality gates Code review order Design, functionality, complexity, tests, naming and comments, then style. First response within one business day. Code review
Traceback The chain of calls that led to an error; read the last line (what) and the frame above it (where) Reading an error Exception class The name before the colon on the last line of a traceback, such as KeyError or TypeError: the kind of mistake. Common exceptions breakpoint() Stops a Python program at that line and opens pdb. p prints a value, n runs the next line, s steps into a call, c continues, q quits. The debugger git bisectFinds the commit that introduced a fault by testing the middle of the range, again and again Narrowing down git bisect run Runs a command at each bisect step and marks the commit good (exit 0), bad (1 to 127) or skipped (125). git bisect run Regression test A test written from a fault: it fails before the fix and passes after, and stays Fixing AI assistant Drafts; you stay the author and reviewer AI assistants Never paste Secrets, customer data or private keys into an AI tool Using AI safely Review generated code Like a stranger's pull request: tests, licences, packages that may not exist Using AI safely A good request Context, the goal, constraints and an example of the output Using AI safely
Nothing matches. Try a shorter word.