More in Networking
Which DNS records does a domain have?
Networking
dig with +short strips everything but the answer.
Follow redirects and show only the headers
Networking
Traces a redirect chain to its destination without downloading the body.
Inspect a TLS certificate from the command line
Networking
Prints the subject, issuer and validity dates without opening a browser.
Time every phase of an HTTP request
Networking
Splits DNS, connect, TLS and first byte apart, which tells you which one is actually slow.
Call a JSON API from PowerShell
Networking
Invoke-RestMethod parses the response for you, so no ConvertFrom-Json step is needed.
Random picks
Count lines of code by extension
Shell
A quick census of a repository without installing a tool for it.
Amend a commit without changing its message
Git
Adds forgotten files to the previous commit and leaves the message exactly as it was.
Compose file with a healthcheck and dependency order
Containers
Makes the app wait until Postgres actually answers, not merely until its container has started.
Type a fetch response safely
TypeScript
unknown forces a parse step rather than letting an any spread silently through the codebase.
Watch a command until it succeeds
Shell
Retries every two seconds and stops the moment the command exits zero. Useful while waiting for a service to come up.
Time a block of code
Python
A context manager that prints how long its body took, without scattering time.perf_counter calls through the function.
Reset a Postgres sequence after a bulk import
Databases
Copying rows with explicit ids leaves the identity sequence behind, so the next insert collides with an existing row.
A GitHub Actions workflow for a Node project
Build & CI
Caches the dependency install, runs on a matrix of versions, and fails the build on a lint error.