Results for “Asynchronous work & URI handling”
Small, practical examples. Search by task or narrow things down below.
Undo only the work after a savepoint
SQLite: After committing the fixtures, roll back a trial change while keeping earlier work in the second transaction.
SQLite✓ Tested
Wait for concurrent workers
Wait for concurrent workers using a complete Go program with explicit sample inputs.
Go✓ Tested
Detect an error inside a pipeline
Use pipefail to observe failure before the last pipeline command.
pipefail✓ Tested
Add a forgotten file to the latest unpublished commit
Git: Stage the missing file before amending without changing the message.
Git✓ Tested
Apply a stash while keeping the saved entry
Git: Apply restores changes without removing the stash reference.
Git✓ Tested
Apply and remove a successfully restored stash
Git: Pop removes the entry only after a successful application.
Git✓ Tested
Avoid a shared mutable default argument
Python: Create a fresh list inside the function when the optional argument is omitted.
Python✓ Tested
Cache repeated pure function calls
Python: Use lru_cache to avoid recomputing results for identical hashable arguments.
Python✓ Tested
Calculate differences between adjacent readings
JavaScript: Slice off the first value and compare each remaining value with its predecessor.
JavaScript✓ Tested
Calculate differences between adjacent readings
TypeScript: Slice off the first value and compare each remaining value with its predecessor.
TypeScript✓ Tested
Capture a successful child-process result
Python: Run an argument list without a shell and check the return code.
Python✓ Tested
Catch a T-SQL error
Handle an expected conversion error in TRY/CATCH.
TRY CATCH✓ Tested