Results for “all”
Small, practical examples. Search by task or narrow things down below.
Supply a default prop value
Supply a default prop value with a small React component and explicit browser behavior.
React✓ Tested
Supply a non-secret configuration file
Docker / Compose: A Compose config mounts a declared file into the service.
Docker / Compose✓ Tested
Supply an environment variable to an exec process
Docker / Compose: An exec environment override applies to the new process only.
Docker / Compose✓ Tested
Swap owned buffers by swapping their pointers
C: Pointer swaps avoid copying the underlying data.
C✓ Tested
Swap two integers
Use a temporary value to swap C integers without arithmetic overflow.
C✓ Tested
Synchronize the document title with state
Synchronize the document title with state with a small React component and explicit browser behavior.
React✓ Tested
Take a limited number of iterator values
Python: Use islice to consume only the requested prefix of a potentially unbounded iterator.
Python✓ Tested
Test a function’s success status
Bash Scripts: Test a function’s success status with a small standalone Bash program.
Bash Scripts✓ Tested
Toggle a bit with an XOR mask
Arduino / C: XOR flips selected bits and leaves all other bits unchanged.
Arduino / C✓ Tested
Toggle Boolean state
Toggle Boolean state with a small React component and explicit browser behavior.
React✓ Tested
Track selection by a stable identifier
Track selection by a stable identifier with a small React component and explicit browser behavior.
React✓ Tested
Track whether a form differs from its initial value
Track whether a form differs from its initial value with a small React component and explicit browser behavior.
React✓ Tested