Standard Search
About 82 results
https://rednafi.com/python/save-with-update-fields-in-django/ · 9 Nov 2022
Optimize Django model saves with update_fields parameter to generate leaner SQL queries and improve performance in tight update loops.
https://rednafi.com/misc/return-values-from-a-shell-function/ · 25 Sep 2022
Understand how return values work in Bash functions. Learn exit codes, status evaluation patterns, and proper boolean returns with true/false commands.
https://rednafi.com/python/compose-multiple-levels-of-pytest-fixtures/ · 21 Jul 2022
Combine session and function-scoped pytest fixtures to avoid expensive test setup while maintaining test isolation and preventing state coupling.
https://rednafi.com/misc/when-to-use-git-pull-rebase/ · 14 Jul 2022
Fix divergent branch errors with git pull --rebase. Learn when to rebase local commits on top of remote changes for cleaner Git history.
https://rednafi.com/misc/distil-git-logs-attached-to-a-file/ · 21 Jun 2022
View git commit history for a single file with git log --follow. Learn to track multiple files with xargs and concatenate their commit logs.
https://rednafi.com/misc/health-check-a-server-with-nohup/ · 18 Apr 2022
Run background health checks in CI with nohup and ampersand. Test server readiness with retry loops and automatic cleanup on success or failure.
https://rednafi.com/python/caching-connection-objects/ · 16 Mar 2022
Learn efficient patterns for caching database connection objects in Python without import-time side effects or lru_cache complexity.
https://rednafi.com/python/create-sub-dict/ · 30 Jan 2022
Optimize Python dictionary slicing from O(DK) to O(K) complexity using direct key lookups instead of iterating through all items.
https://rednafi.com/python/use-assertis-to-check-literal-booleans/ · 24 Jan 2022
Test literal booleans correctly in Python unittest using assertIs instead of assertTrue/assertFalse to avoid truthy/falsy confusion.
https://rednafi.com/python/check-is-a-power-of-two/ · 21 Jan 2022
Use Python's bit_count() method to elegantly check if an integer is a power of two by counting on-bits in binary representation.