Results for “Small algorithms & bit operations”
Small, practical examples. Search by task or narrow things down below.
Inject a data loader into a component
Inject a data loader into a component with a small React component and explicit browser behavior.
React✓ Tested
Keep a callback stable between renders
Keep a callback stable between renders with a small React component and explicit browser behavior.
React✓ Tested
Keep a mutable value without rendering on each write
Keep a mutable value without rendering on each write with a small React component and explicit browser behavior.
React✓ Tested
Keep component state with useState
Keep component state with useState with a small React component and explicit browser behavior.
React✓ Tested
Keep numeric input text until conversion
Keep numeric input text until conversion with a small React component and explicit browser behavior.
React✓ Tested
Keep only the latest requested result
Keep only the latest requested result with a small React component and explicit browser behavior.
React✓ Tested
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
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
Look up values in an associative array
Use named keys for a small in-memory configuration table.
dictionary✓ Tested
Make a Compose service’s filesystem read-only
Docker / Compose: Make a Compose service’s filesystem read-only in a small Compose file.
Docker / Compose✓ Tested
Make a script executable by its owner
Linux Commands: Add the owner execute bit without replacing all permission bits.
Linux Commands✓ 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