FIND YOUR NEXT FEW LINES

Results for “then”

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

703 snippets foundClear filters
Docker / ComposeGetting Started

Choose an image’s default directory

Docker / Compose: Choose an image’s default directory with a complete introductory Dockerfile.

Docker / Compose✓ Tested
Docker / ComposeDockerfile patterns

Choose Bash with pipefail for build commands

Docker / Compose: SHELL changes the interpreter for subsequent shell-form instructions.

Docker / Compose✓ Tested
TypeScriptGetting Started

Choose between two branches

TypeScript: Use if and else to handle an available or empty stock count.

TypeScript✓ Tested
C++Getting Started

Choose between two branches

C++: Use if and else to handle an available or empty stock count.

C++✓ Tested
CGetting Started

Choose between two branches

C: Use if and else to handle an available or empty stock count.

C✓ Tested
RustGetting Started

Choose floating-point arithmetic

Choose floating-point arithmetic in a complete Rust program using the standard library.

Rust✓ Tested
AngularGetting Started

Choose template content with @switch

Choose template content with @switch with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptNumbers & numeric validation

Clamp a number between inclusive bounds

TypeScript: Combine Math.min and Math.max when lower is no greater than upper.

TypeScript✓ Tested
RustNumbers & durations

Clamp a number to a valid interval

Clamp a number to a valid interval in a complete Rust program using the standard library.

Rust✓ Tested
C++Numbers & algorithms

Clamp a value to a range

Use C++17 clamp to bound a numeric value.

C++✓ Tested
CNumeric parsing & arithmetic

Clamp an integer to inclusive bounds

C: Explicit comparisons avoid relying on nonstandard min or max macros.

C✓ Tested
TypeScriptPromises & iteration protocols

Clean up a generator after an early break

TypeScript: Breaking a for-of loop closes a generator and runs its finally block.

TypeScript✓ Tested