FIND YOUR NEXT FEW LINES

Results for “one”

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

590 snippets foundClear filters
ReactCustom hooks

Keep separate state for separate hook calls

Keep separate state for separate hook calls with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsGetting Started

Limit a beginner function variable to local scope

Bash Scripts: Limit a beginner function variable to local scope with a small standalone Bash program.

Bash Scripts✓ Tested
Docker / ComposeExecution & file transfer

Load environment variables from a file

Docker / Compose: An env file supplies one KEY=value assignment per line.

Docker / Compose✓ Tested
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