About 82 results
https://rednafi.com/misc/install/ · 28 Jul 2024
Replace mkdir, cp, and chmod with a single install command. Copy files, create directories, and set permissions in one step with GNU coreutils.
https://rednafi.com/python/typeguard-vs-typeis/ · 27 Apr 2024
Understand TypeIs vs TypeGuard in Python: TypeIs provides more intuitive type narrowing by narrowing both positive and negative branches.
https://rednafi.com/go/strategy-pattern/ · 17 Feb 2024
Replace inheritance with the Strategy pattern in Go using interfaces. Achieve composable, testable code without class hierarchies.
https://rednafi.com/go/retry-function/ · 4 Feb 2024
Build retry logic in Go without reflection using generics. Implement exponential backoff and configurable retry strategies with type safety.
https://rednafi.com/go/type-assertion-vs-type-switches/ · 31 Jan 2024
Master Go type assertions with i.(T) syntax and type switches. Extract concrete types from interfaces safely with ok idiom examples.
https://rednafi.com/python/patch-pydantic-settings-in-pytest/ · 27 Jan 2024
Mock pydantic_settings in pytest tests by patching the settings class to prevent flaky tests from environment variable dependencies.
https://rednafi.com/go/omit-dev-dependencies-in-binaries/ · 21 Jan 2024
Track dev dependencies like golangci-lint in go.mod with a tools.go file and build tags to exclude them from production binaries.
https://rednafi.com/python/annotate-args-and-kwargs/ · 8 Jan 2024
Properly annotate Python *args and **kwargs with heterogeneous types using Unpack, TypedDict, and modern type hints from PEP-692.
https://rednafi.com/python/statically-enforcing-frozen-dataclasses/ · 4 Jan 2024
Enforce immutable dataclasses at type-check time with @final decorator to catch mutations before runtime without frozen=True performance cost.
https://rednafi.com/python/debug-dockerized-apps-in-vscode/ · 22 Dec 2023
Set up VSCode debugger for containerized Python applications using debugpy. Step-by-step guide with Docker Compose and launch configurations.