Recent writings

Use 'command -v' over 'which' to find a program's executable

Replace which with command -v for POSIX-compliant executable lookup. Learn why command -v is the portable alternative for finding program paths.

Write git commit messages properly

Master Git commit message conventions: imperative mood, 50-character subject, proper capitalization. Build coherent project history with consistent formatting.

Use strict mode while running bash scripts

Enable Bash strict mode with set -euo pipefail to catch errors early. Exit on failures, treat unset variables as errors, and handle pipeline failures properly.

Use curly braces while pasting shell commands

Prevent shell commands from executing immediately when pasting. Use curly braces to safely paste multi-line commands with hidden newline characters.

Python's 'functools.partial' flattens nestings Automatically

Discover how Python's functools.partial automatically detects and flattens nested partial applications for optimal performance and cleaner code.

Pedantic configuration management with Pydantic

Build a scalable Python configuration system with Pydantic and dotenv. Manage dev, staging, and production configs with type validation.

Interfaces, mixins and building powerful custom data structures in Python

Build custom data structures with Python's collection.abc mixins, abstract base classes, and interfaces for dict-like and set-like objects.

Deciphering Python's metaclasses

Explore Python metaclasses for metaprogramming: learn how classes are created, customize class behavior, and understand type as the default metaclass.

Implementing proxy pattern in Python

Learn the proxy design pattern in Python to add access control, caching, and validation layers without modifying core functionality.

Effortless API response caching with Python & Redis

Cache API responses with Redis in Python to reduce redundant requests, improve response times, and handle expiring key-value pairs efficiently.

Untangling Python decorators

Complete guide to Python decorators from first principles. Learn closures, higher-order functions, decorator patterns, and advanced techniques.

Effortless concurrency with Python's concurrent.futures

Master Python's concurrent.futures module for easy threading and multiprocessing. Learn ThreadPoolExecutor and ProcessPoolExecutor with examples.

No really, Python's pathlib is great

Replace os.path with Python's pathlib for elegant, object-oriented path manipulation with intuitive operators and unified file operations.

Running Python linters with pre-commit hooks

Automate Python code quality with pre-commit hooks running Black, isort, flake8, and mypy before each git commit for consistent formatting.

Generic functions with Python's singledispatch

Replace complex if-elif chains with functools.singledispatch for type-based function dispatch and cleaner polymorphic behavior in Python.