Snippets

Snippets serve to collect and contextualize easily reusable pieces of code.

Permeable Borders

snippet

Strict border controls are an anachronism, so why not have our CSS reflect that?

Memoization with Lazy Getters

snippet

Debugging CSS Custom Properties

snippet

CSS-Only Ripple Effect

snippet

CSS Nesting Syntax Conversion

snippet

Virtual JavaScript Modules

snippet

Given my penchant for minimal test cases and local applications, I sometimes run into situations where I can’t load external JavaScript files. Typically that’s because ESM is unsupported for file:// URIs or because I don’t wanna rely on additional assets for a Web Worker.

Default Map in JavaScript

snippet

I’ve always liked Python’s defaultdict and occasionally find myself reimplementing it in other languages, notably JavaScript – typically for some kind of dynamic indexing.

Scroll Shadows

snippet

CSS Color Scheme

snippet

EditorConfig

snippet

Two-Factor Authentication on the Command Line

snippet

Subgrid for Nested Alignment

snippet

Skeumorphic Text Highlighting

snippet

HTML Boilerplate

snippet

I probably create dozens of HTML documents each month, usually for experiments or minimal test cases. Consequently, I’ve long maintained a carefully crafted HTML template, included below, which I typically reduce to only retain pieces that are strictly necessary (e.g. removing the external style sheet or .stack utility).