Results for “Small algorithms & bit operations”
Small, practical examples. Search by task or narrow things down below.
Enable an init process for a service
Docker / Compose: init adds a small PID 1 process to forward signals and reap children.
Docker / Compose✓ Tested
Enforce a minimum width
CSS: Min-width can prevent a declared smaller width from taking effect.
CSS✓ Tested
Expose a disclosure’s expanded state
Expose a disclosure’s expanded state with a small React component and explicit browser behavior.
React✓ Tested
Extract reusable toggle behavior
Extract reusable toggle behavior with a small React component and explicit browser behavior.
React✓ Tested
Extract the low and high byte of a value
Arduino / C: lowByte and highByte expose the two bytes of a 16-bit value.
Arduino / C✓ Tested
Filter a list by a search term
Filter a list by a search term with a small React component and explicit browser behavior.
React✓ Tested
Find the largest value
Check for an empty C++ vector before dereferencing max_element.
C++✓ Tested
Focus an input through a ref
Focus an input through a ref with a small React component and explicit browser behavior.
React✓ Tested
Format decimal output
Use fixed and setprecision to print two C++ decimal places.
C++✓ Tested
Forward input props to a reusable field
Forward input props to a reusable field with a small React component and explicit browser behavior.
React✓ Tested
Give an LED pin a constant name
Arduino / C: Use const to name the built-in LED pin and reuse it in output instructions.
Arduino / C✓ Tested
Group related form controls semantically
Group related form controls semantically with a small React component and explicit browser behavior.
React✓ Tested