FIND YOUR NEXT FEW LINES

Results for “one-off”

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

621 snippets foundClear filters
TypeScriptArray restructuring

Flatten a single nesting level

TypeScript: flat defaults to a depth of one and creates a new array.

TypeScript✓ Tested
JavaStream transformations

Flatten nested collections

Java: Use flatMap to concatenate nested Java lists into one stream.

Java✓ Tested
C#LINQ transformations

Flatten nested collections with SelectMany

C#: Concatenate the items from several sequences into one sequence.

C#✓ Tested
ReactRefs & DOM interaction

Focus an input through a ref

Focus an input through a ref with a small React component and explicit browser behavior.

React✓ Tested
AngularEvents & DOM interaction

Focus an input through its template reference

Focus an input through its template reference with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
PowerShellDates & numeric validation

Format a bounded duration as hours minutes and seconds

PowerShell: TimeSpan can format duration components with escaped separators.

PowerShell✓ Tested
AngularPipes & formatting

Format a fractional value as a percentage

Format a fractional value as a percentage with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularPipes & formatting

Format a number with fixed decimal places

Format a number with fixed decimal places with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularPipes & formatting

Format an amount in a selected currency

Format an amount in a selected currency with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularPipes & formatting

Format text in lowercase

Format text in lowercase with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularGetting Started

Format text through a built-in pipe

Format text through a built-in pipe with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CSmall algorithms & bit operations

Generate a bounded Fibonacci sequence

C: Keep only the two previous values instead of using exponential recursive calls.

C✓ Tested