FIND YOUR NEXT FEW LINES

Results for “work”

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

537 snippets foundClear filters
GoGetting Started

Choose a branch with if and else

Choose a branch with if and else using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsArguments & decisions

Choose among several numeric ranges

Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.

Bash Scripts✓ Tested
Bash ScriptsGetting Started

Choose an action with case

Bash Scripts: Choose an action with case with a small standalone Bash program.

Bash Scripts✓ Tested
RustGetting Started

Choose an action with match

Choose an action with match in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsGetting Started

Choose between two script branches

Bash Scripts: Choose between two script branches with a small standalone Bash program.

Bash Scripts✓ Tested
RustGetting Started

Choose floating-point arithmetic

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

Rust✓ Tested
GoGetting Started

Choose floating-point division

Choose floating-point division using a complete Go program with explicit sample inputs.

Go✓ 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
Bash ScriptsText parsing & arithmetic

Clamp a numeric setting to a valid range

Bash Scripts: Use arithmetic comparisons before applying a user-supplied bounded setting.

Bash Scripts✓ Tested
GoTesting & reusable helpers

Clamp a value to an allowed interval

Clamp a value to an allowed interval using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsArguments & decisions

Classify a filename with shell patterns

Bash Scripts: Case patterns support alternatives without launching an external regex tool.

Bash Scripts✓ Tested
Bash ScriptsFiles & reliability

Clean up a temporary directory automatically

Use an EXIT trap so temporary files are removed when the script ends.

mktemp✓ Tested