More in Web & CSS
A semantic, accessible form field
Web & CSS
The label is tied to the input by id, and the hint is announced with it via aria-describedby.
Responsive grid without media queries
Web & CSS
auto-fill with minmax reflows on its own, so the column count follows the container rather than a breakpoint list.
Truncate text to a number of lines
Web & CSS
Ellipsis after two lines. The -webkit- prefixes are still required despite being supported everywhere.
Responsive images that do not blow the bandwidth budget
Web & CSS
srcset lets the browser pick; sizes tells it how wide the image will actually be rendered.
Respect a reduced-motion preference
Web & CSS
One rule that disables animation for people who asked their system for less of it.
Visually hidden, still read aloud
Web & CSS
Hides a label from sight while leaving it in the accessibility tree. display:none would remove it from both.
Random picks
Exhaustiveness check on a switch
TypeScript
Assigning to never makes the compiler fail the build when a new union member is added and left unhandled.
Generate an SSH key and add it to the agent
Security
Ed25519 rather than RSA: shorter, faster, and no key-size decision to get wrong.
A README that people actually read
Data Formats
The order matters more than the length: what it is, how to run it, how to develop on it.
Walk a directory tree lazily
Python
pathlib keeps the paths as objects rather than strings, so joining and suffix checks stay readable.
Show which process is holding a port
Shell
Answers 'address already in use' without guessing.
Worker pool with a wait group in Go
Systems
Fixed number of goroutines draining a channel, with the group ensuring main waits for all of them.
Upsert a row in SQLite
Databases
Inserts, or updates the existing row when the unique column already holds that value.
Narrow a union with a type guard
TypeScript
A predicate returning `x is T` teaches the compiler what a runtime check proved.