Results for “one-off”
Small, practical examples. Search by task or narrow things down below.
Loop over an array safely
Preserve spaces in array elements while iterating.
array✓ Tested
Maintain a rolling sum in a circular window
Arduino / C: Subtract the overwritten sample before adding the next one.
Arduino / C✓ Tested
Map items to multiple output values
JavaScript: flatMap combines mapping and a one-level flattening operation.
JavaScript✓ Tested
Map items to multiple output values
TypeScript: flatMap combines mapping and a one-level flattening operation.
TypeScript✓ Tested
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
Mark a self-contained article
HTML: Article identifies a standalone composition that can be read independently.
HTML✓ Tested
Match any pattern from a file
Linux Commands: Use grep -F -f with one literal pattern per line.
Linux Commands✓ Tested
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
Measure an element after layout
Measure an element after layout with a small React component and explicit browser behavior.
React✓ Tested
Memoize a derived collection
Memoize a derived collection with a small React component and explicit browser behavior.
React✓ Tested
Memoize a sorted copy of state
Memoize a sorted copy of state with a small React component and explicit browser behavior.
React✓ Tested
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