FIND YOUR NEXT FEW LINES

Results for “Async work & status”

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

571 snippets foundClear filters
Bash ScriptsText parsing & arithmetic

Parse digits with leading zeroes as decimal

Bash Scripts: The 10# prefix avoids Bash treating a leading zero as an octal notation.

Bash Scripts✓ Tested
RustIterators & transformations

Parse only valid integers

Parse only valid integers in a complete Rust program using the standard library.

Rust✓ Tested
RustIterators & transformations

Partition values into two collections

Partition values into two collections in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsInput streams & redirection

Pass a variable to standard input

Bash Scripts: A here-string supplies the expanded value followed by a newline.

Bash Scripts✓ Tested
GoSlices & collections

Preallocate a slice’s capacity

Preallocate a slice’s capacity using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsArray operations

Prepend items while preserving existing array values

Bash Scripts: Construct a new array with the new values before the quoted original expansion.

Bash Scripts✓ Tested
GoJSON & encoding

Preserve a large JSON integer

Preserve a large JSON integer using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Prevent a variable value from expanding as a filename pattern

Bash Scripts: Quote a variable to pass its literal contents even when matching filenames exist.

Bash Scripts✓ Tested
Docker / ComposeLimits & process security

Prevent gaining privileges through exec

Docker / Compose: The no-new-privileges flag is visible in process status.

Docker / Compose✓ Tested
RustGetting Started

Print a collection for inspection

Print a collection for inspection in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsText parsing & arithmetic

Print text containing percent characters literally

Bash Scripts: Never use untrusted text as the printf format string.

Bash Scripts✓ Tested
RustVectors & slices

Process a slice in bounded chunks

Process a slice in bounded chunks in a complete Rust program using the standard library.

Rust✓ Tested