More in Containers
Find what is taking up space in an image
Containers
Prints the size each layer adds, which usually points straight at the offending RUN line.
Remove every stopped container and dangling image
Containers
Reclaims disk after a week of building. The volume flag is separate because it is the one that loses data.
Compose file with a healthcheck and dependency order
Containers
Makes the app wait until Postgres actually answers, not merely until its container has started.
Multi-stage Dockerfile for a Node service
Containers
Builds with the full toolchain, ships only production dependencies, and runs as a non-root user.
Random picks
Find slow queries in Postgres
Databases
Ranks statements by total time spent. Needs the pg_stat_statements extension enabled.
Security headers for an Express app
Security
The handful worth setting even when you are not using a framework that sets them for you.
Respect a reduced-motion preference
Web & CSS
One rule that disables animation for people who asked their system for less of it.
Walk a directory tree lazily
Python
pathlib keeps the paths as objects rather than strings, so joining and suffix checks stay readable.
Show what a merge will do before doing it
Git
Lists the commits and the files a merge would bring in, so a surprise is less likely.
Const assertion for a lookup table
TypeScript
`as const` keeps the literal types, so the derived union is the actual keys rather than string.
Inspect a TLS certificate from the command line
Networking
Prints the subject, issuer and validity dates without opening a browser.
Compare secrets in constant time
Security
A plain === leaks how much of the token matched through its timing. This does not.