About 82 results
https://rednafi.com/misc/dynamic-shell-variables/ · 11 Jan 2025
Learn variable indirection in Bash with ${!var} syntax. Build context-aware configs, function dispatch, and dynamic variable name resolution.
https://rednafi.com/python/inject-pytest-fixture/ · 2 Dec 2024
Clean up pytest test signatures using @pytest.mark.usefixtures to inject implicit fixtures without autouse or unused parameter warnings.
https://rednafi.com/python/typing-override/ · 6 Nov 2024
Catch method override errors at type-check time with Python's @override decorator from PEP 698, preventing typos and signature mismatches.
https://rednafi.com/python/module-getattr/ · 3 Nov 2024
Speed up Python module imports with __getattr__ from PEP 562 for lazy loading, deprecation warnings, and dynamic attribute access.
https://rednafi.com/misc/docker-mount/ · 22 Oct 2024
Master Docker mount types: volumes, bind mounts, tmpfs, and build cache. Clear syntax comparison between -v and --mount options with docker-compose.
https://rednafi.com/misc/direnv/ · 2 Oct 2024
Automate environment variables per directory with direnv. Load .envrc files on entry, unload on exit. Integrate with Python venv and uv workflow.
https://rednafi.com/misc/bash-namerefs/ · 20 Sep 2024
Master Bash namerefs with declare -n to create dynamic variable references. Build generic functions for arrays and associative arrays without eval.
https://rednafi.com/python/testing-http-requests/ · 2 Sep 2024
Test HTTP requests in Python with pytest-httpx for full mocking, respx for pattern matching, or VCR.py for recording real responses.
https://rednafi.com/python/pytest-param/ · 28 Aug 2024
Write readable parametrized tests with pytest.param for better test names, conditional skips, custom IDs, and structured test data.
https://rednafi.com/misc/http-requests-via-dev-tcp/ · 8 Aug 2024
Make raw HTTP requests with Bash's /dev/tcp file descriptor. Build health check scripts without curl or wget using TCP socket connections.