#config Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
PHP Recursive Deep Merge
Merge two associative arrays at any nesting depth — like array_merge_recursive, but later values OVERWRITE earlier ones at the leaf level instead of combining them into arrays. Perfect for config-file overrides.
Go os.Getenv with Defaults
`os.Getenv` returns "" when unset — easy to miss. Wrap it with a typed helper that supplies defaults and parses numerics. Saves boilerplate at every config-read site.
Bash Idempotent Append to File
Add a line to a file (e.g., a config or PATH export) only if it isn't already present. Common in install/setup scripts that need to be safe to re-run.
Python Stdlib .env Loader (no dependency)
Parse a `.env` file into a dict and optionally export to os.environ. Skips comments and blank lines, strips surrounding quotes — no python-dotenv dependency needed.
Bash Source Multiple Files from Directory
A common ~/.bashrc / ~/.zshrc pattern: split your config into ~/.bashrc.d/*.sh and source them all. Easier than one giant file.
TypeScript Environment Variable Validator
Validate process.env at boot-time and exit fast if anything's missing. The returned object is typed so the rest of the code reads `env.DATABASE_URL` instead of `process.env.DATABASE_URL!`.