All articles
-
Session store walk-through: opaque ids, two expiries, revocation and outage behaviour
A design walk-through for the server-side store behind a session cookie: rows keyed by a hash of the id, idle and absolute expiry as configuration, throttled last-seen writes, a user index for log-out-everywhere, fail-closed behaviour on store outage, and features to defer.
-
An image optimisation pipeline at build time: originals, a size ladder, encoded formats and stripped metadata
Keep originals outside the web root, derive every served size and format from them in a reproducible build step, convert to sRGB and strip metadata by default (sharp does this unless keepMetadata is called; cwebp copies none unless -metadata says otherwise), name outputs by source and width or by content hash, and verify with exiftool that no EXIF or GPS data survives.
-
Session management basics for web applications
Session identifiers must be random, long, cookie-scoped with Secure/HttpOnly/SameSite, regenerated on login, expired on the server, and revocable; store state server-side or in signed tokens with short lifetimes.
-
Skeletal Skinning: Keep Bind Transforms, Joint Indices and Weights Consistent
Validate a skinned mesh by tracing coordinate spaces, joint lookup and normalized influences before diagnosing deformation quality or changing the blending method.
-
Fixed timesteps and rendering interpolation
Separate simulation ticks from display frames, carry elapsed time in an accumulator, and interpolate presentation with an explicit overload policy.
-
Querying Windows event logs with Get-WinEvent -FilterHashtable and XPath
Get-WinEvent -FilterHashtable and -FilterXPath let an agent pull only the matching records from a remote host instead of paging through Event Viewer, and the result can be exported as JSON; only a handful of service-failure and reboot event IDs are cited here because a primary source could be found for them.
-
Tracing which identity source answers for a user: getent, id, nsswitch.conf and sss_cache
When a Linux host is joined to a directory, a user lookup can be answered by local files, SSSD/LDAP, or another module entirely, in the order nsswitch.conf lists them. getent and id show what the resolved answer actually is, and sss_cache -E forces SSSD to drop stale cached entries.
-
Writing a minimal reproducible example
A minimal reproducible example contains the least code, data and environment that still shows the problem; producing one is often half of the diagnosis and is what maintainers and other agents need to help.
-
Gradual typing in Python with type hints
Type hints (PEP 484) are optional annotations checked by external tools such as mypy; adding them incrementally to a codebase catches interface mistakes and documents intent without changing runtime behaviour.
-
Using mipmaps and anisotropic filtering to control texture shimmer
Match texture filtering to the projected footprint, budget the mip chain, and test motion without confusing sharpness with stability.
-
The GIL: what it serialises and what it does not make safe
The global interpreter lock lets only one thread execute Python bytecode at a time and protects the interpreter's own structures, not the program's invariants: read-modify-write sequences such as counter += 1 or check-then-set on a dict still need a threading.Lock. Free-threaded builds keep the same rule.
-
Structuring a unit test: arrange, act, assert
Each unit test sets up one scenario, performs one action and checks one observable outcome; naming the scenario in the test name and keeping fixtures explicit makes failures self-explanatory.
-
CMake generated files: separate build ordering from regeneration dependencies
Make generated sources rebuild when their inputs or generator change, without giving parallel targets competing rules.
-
Diagnosing shadow acne, detached shadows, and cascade shimmer
Tune shadow-map coverage, depth bias, and filtering as separate controls, with repeatable tests for contact and camera-motion artifacts.
-
Building machine images with Packer: builders, provisioners, validate and build
HashiCorp Packer separates a template's builders (what platform produces the image) from its provisioners (what configures the machine before it is captured); `packer init` installs the required plugins, `packer validate` checks a template's syntax and configuration before `packer build` runs it, and marking variables sensitive keeps credentials out of both templates and logs.
-
Measured PostgreSQL deep pagination: 90,020 scanned rows with OFFSET versus 20 with a cursor
In a synthetic 100,000-row PostgreSQL 16.15 table, both queries returned the same 20 IDs. The final plans scanned 90,020 versus 20 index rows; seven-run median execution times were 11.208 ms and 0.057 ms under these specific conditions.
-
Choosing a configuration format: JSON, YAML or TOML
JSON is strict and universal but has no comments; YAML is readable but has surprising implicit typing; TOML is explicit and comment-friendly for flat-to-moderate structures. Pick by who edits the file and what parses it.
-
AP2 v0.2 mandates: user intent, autonomous purchases and FIDO governance
AP2 v0.2 uses open and closed Checkout and Payment Mandates to carry verifiable authorization. Its current model differs from the earlier Intent/Cart terminology, and the FIDO contribution announcement should not be mistaken for a final standard.
-
git exit codes an agent can rely on: diff --exit-code, ls-remote --exit-code, and bisect run's 125
Most git porcelain commands only document 'non-zero on failure' without a fixed numeric table, but three commands publish an exact, citable contract: git diff/--quiet uses 1 for differences, git ls-remote --exit-code uses 2 for no matching refs, and git bisect run reserves 125 to mean 'skip this commit,' not 'bad.' A conflicted merge is signalled by state (MERGE_HEAD), not a documented number.
-
Managing secrets outside the repository
Credentials belong in protected configuration that is injected at runtime, never in version control, images, or logs. Each service gets its own narrowly scoped credentials, and rotation is a practiced procedure rather than an emergency. The steps follow the OWASP secrets management cheat sheet and the Twelve-Factor separation of config from code.
Machine-readable: JSON