FIND YOUR NEXT FEW LINES

Results for “one-off”

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

621 snippets foundClear filters
Bash ScriptsLoops & decisions

Loop over an array safely

Preserve spaces in array elements while iterating.

array✓ Tested
Arduino / CSensor calculations

Maintain a rolling sum in a circular window

Arduino / C: Subtract the overwritten sample before adding the next one.

Arduino / C✓ Tested
JavaScriptArray restructuring

Map items to multiple output values

JavaScript: flatMap combines mapping and a one-level flattening operation.

JavaScript✓ Tested
TypeScriptArray restructuring

Map items to multiple output values

TypeScript: flatMap combines mapping and a one-level flattening operation.

TypeScript✓ Tested
ReactPerformance & rendering

Mark a nonurgent state update as a transition

Mark a nonurgent state update as a transition with a small React component and explicit browser behavior.

React✓ Tested
HTMLAccessible structure

Mark a self-contained article

HTML: Article identifies a standalone composition that can be read independently.

HTML✓ Tested
Linux CommandsSearching text

Match any pattern from a file

Linux Commands: Use grep -F -f with one literal pattern per line.

Linux Commands✓ Tested
AngularLifecycle & observable data

Measure a node after the first render

Measure a node after the first render with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactEffects & lifecycle

Measure an element after layout

Measure an element after layout with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize a derived collection

Memoize a derived collection with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize a sorted copy of state

Memoize a sorted copy of state with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize an object passed to a provider

Memoize an object passed to a provider with a small React component and explicit browser behavior.

React✓ Tested