FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
Bash ScriptsGetting Started

Choose between two script branches

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

Bash Scripts✓ Tested
JavaScriptNumbers & numeric validation

Clamp a number between inclusive bounds

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

JavaScript✓ 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
JavaScriptPromises & iteration protocols

Clean up a generator after an early break

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

JavaScript✓ Tested
Bash ScriptsProcesses & environment

Collect two independent background results

Bash Scripts: Write each job’s output separately and wait for both before combining results.

Bash Scripts✓ Tested
GitMerging & replaying changes

Combine a branch’s changes into one new commit

Git: Squash prepares the combined changes in the index without recording a merge parent.

Git✓ Tested
JavaScriptGetting Started

Combine text with a name

JavaScript: Construct a greeting from a fixed prefix and a stored name.

JavaScript✓ Tested
Bash ScriptsArguments & decisions

Compare a value literally inside a conditional

Bash Scripts: Quoting the right side of an equality test makes wildcard characters literal.

Bash Scripts✓ Tested
JavaScriptGetting Started

Compare a value with a limit

JavaScript: Turn a comparison into a readable yes or no result.

JavaScript✓ Tested
JavaScriptNumbers & numeric validation

Compare bounded floating-point results with a tolerance

JavaScript: Use an absolute error threshold for values known to be near one.

JavaScript✓ Tested
JavaScriptText handling & Unicode

Compare canonically equivalent Unicode text

JavaScript: Normalize to NFC before comparing equivalent composed and decomposed text.

JavaScript✓ Tested
Bash ScriptsInput streams & redirection

Compare two generated sorted streams

Bash Scripts: Process substitution lets a command consume another command’s output as a file-like input.

Bash Scripts✓ Tested