Read typed settings from environment variables
Load configuration from the environment with defaults, type conversion and clear errors for missing values.
Loading snippets…
137 snippets
Load configuration from the environment with defaults, type conversion and clear errors for missing values.
Compute a strong ETag for a response body and answer If-None-Match with 304 Not Modified to save bandwidth.
Chain single-argument functions left-to-right with pipe, or right-to-left with compose.
Create a temp directory and guarantee it is removed when the script exits, fails or is interrupted.
Small numeric helpers for sliders, animations and progress bars.
Fail early with a helpful message when a script depends on tools that are missing.
Center an element horizontally and vertically using two lines of CSS.
Uppercase the first letter of a string or of every word, leaving the rest of each word untouched.
A base button with hover, active, disabled and focus styles that meets minimum target size.
Prevent mixing up UserId and OrderId strings by giving each a unique compile-time brand.
A reusable PostgreSQL trigger function that sets updated_at to now() on every UPDATE.
Write to a temporary file and rename it into place so readers never see a half-written file.