FIND YOUR NEXT FEW LINES

Results for “Asynchronous work & URI handling”

Small, practical examples. Search by task or narrow things down below.

631 snippets foundClear filters
SQLiteSchema design & transactions

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
GoConcurrency & cancellation

Wait for concurrent workers

Wait for concurrent workers using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsFiles & reliability

Detect an error inside a pipeline

Use pipefail to observe failure before the last pipeline command.

pipefail✓ Tested
GitRestoring & revising local work

Add a forgotten file to the latest unpublished commit

Git: Stage the missing file before amending without changing the message.

Git✓ Tested
GitStashing selected work

Apply a stash while keeping the saved entry

Git: Apply restores changes without removing the stash reference.

Git✓ Tested
GitStashing selected work

Apply and remove a successfully restored stash

Git: Pop removes the entry only after a successful application.

Git✓ Tested
PythonFunctions & error handling

Avoid a shared mutable default argument

Python: Create a fresh list inside the function when the optional argument is omitted.

Python✓ Tested
PythonFunctions & error handling

Cache repeated pure function calls

Python: Use lru_cache to avoid recomputing results for identical hashable arguments.

Python✓ Tested
JavaScriptArray restructuring

Calculate differences between adjacent readings

JavaScript: Slice off the first value and compare each remaining value with its predecessor.

JavaScript✓ Tested
TypeScriptArray restructuring

Calculate differences between adjacent readings

TypeScript: Slice off the first value and compare each remaining value with its predecessor.

TypeScript✓ Tested
PythonFunctions & error handling

Capture a successful child-process result

Python: Run an argument list without a shell and check the return code.

Python✓ Tested
SQL ServerTransactions & tables

Catch a T-SQL error

Handle an expected conversion error in TRY/CATCH.

TRY CATCH✓ Tested