Redowan's Reflections — Page 6
Recent writing
Longer articles, short notes, and things I'll probably need to look up again.
Browse the archiveMaster Bash namerefs with declare -n to create dynamic variable references. Build generic functions for arrays and associative arrays without eval.
How this blog is built: Hugo static site generator, GitHub Actions deployment, Cloudflare caching, and R2 storage. Simple, stable, and cost-free.
Complete guide to Bash redirection. Master stdout, stderr, pipes, tee, file descriptors, and shorthand syntax with practical examples for every case.
Test HTTP requests in Python with pytest-httpx for full mocking, respx for pattern matching, or VCR.py for recording real responses.
Write readable parametrized tests with pytest.param for better test names, conditional skips, custom IDs, and structured test data.
Make raw HTTP requests with Bash's /dev/tcp file descriptor. Build health check scripts without curl or wget using TCP socket connections.
Automatically tag Python logs with request context using middleware and contextvars for distributed tracing in ASGI web applications.
Avoid configuring Python's root logger in libraries; use named loggers with NullHandler to let application code control logging behavior.
Replace mkdir, cp, and chmod with a single install command. Copy files, create directories, and set permissions in one step with GNU coreutils.
Avoid here-doc pitfalls when running remote commands via SSH. Learn variable expansion gotchas and simpler alternatives for deployment scripts.
Make pull requests easier to review. Learn commit organization, diff filtering, annotations, and context that helps reviewers understand changes faster.
Master git rebase for cleaner commit history. Learn interactive rebasing, squashing commits, and rebasing feature branches onto main with practical examples.
Define service contracts with Protocol Buffers for non-gRPC systems. Generate serializers, maintain self-documented APIs, and ensure cross-language compatibility.
Understand TypeIs vs TypeGuard in Python: TypeIs provides more intuitive type narrowing by narrowing both positive and negative branches.
Implement client-side HTTP caching with ETag headers. Learn If-None-Match, 304 Not Modified responses, and weak validation in Go servers.