Recent writings
Gracefully shutdown Python's ThreadingTCPServer with signal handlers for SIGINT, SIGTERM handling and client notification on server shutdown.
Poll multiple data sources in a single thread using Python generators with itertools.cycle to alternate between infinite data streams efficiently.
Skip elements in iterables until a condition is met using itertools.dropwhile for efficient lazy evaluation that works with generators.
Build a pausable socket server with Python's socketserver module using threading for intermittent request handling and background tasks.
Connect Jupyter Notebook to Dockerized Django apps using ipykernel and django-extensions for interactive debugging and data exploration.
Use Django query expressions like Replace, Upper, Lower, Concat, and Substr for efficient database-level text manipulation without fetching data.
Display progress bars for concurrent Python tasks using tqdm with ThreadPoolExecutor and as_completed for real-time execution monitoring.
Use the colon : command as a no-op in Bash scripts for cleaner debug output with -x flag. Alternative to echo for section markers and comments.
Accelerate Django bulk_update operations by 4x using multiprocessing to parallelize database writes across chunked record batches.
Manage multiple Python versions on macOS using asdf, a unified version manager replacing pyenv, nvm, and language-specific tools.
Optimize Django model saves with update_fields parameter to generate leaner SQL queries and improve performance in tight update loops.
Configure Python logging for AWS Lambda's pre-configured handlers while maintaining compatibility with local development environments.
Learn from a production outage caused by loading large CSV files into memory. Stream process files to prevent OOM errors and crashes.
Automate commit message validation with GitHub Actions. Enforce refs and closes patterns to maintain clean Git history and link commits to issues.
Master shell quoting rules: single vs double quotes, backticks vs $(). Learn when to quote variables to prevent spaces and special characters from breaking commands.