FIND YOUR NEXT FEW LINES

Results for “one-off”

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

621 snippets foundClear filters
AngularGetting Started

Store reactive state in a signal

Store reactive state in a signal with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
Bash ScriptsGetting Started

Store text in a variable

Bash Scripts: Store text in a variable with a small standalone Bash program.

Bash Scripts✓ Tested
AngularLists & control flow

Style the first and last list items

Style the first and last list items with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactPerformance & rendering

Subscribe to a small external store safely

Subscribe to a small external store safely with a small React component and explicit browser behavior.

React✓ Tested
ReactEffects & lifecycle

Subscribe to and clean up a window event

Subscribe to and clean up a window event with a small React component and explicit browser behavior.

React✓ Tested
SQLExpressions & aggregates

Sum values per category

Calculate a grouped total.

SUM✓ Tested
ReactGetting Started

Supply a default prop value

Supply a default prop value with a small React component and explicit browser behavior.

React✓ Tested
AngularSignals & state

Synchronize a document property with an effect

Synchronize a document property with an effect with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactGetting Started

Synchronize the document title with state

Synchronize the document title with state with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsGetting Started

Test a function’s success status

Bash Scripts: Test a function’s success status with a small standalone Bash program.

Bash Scripts✓ Tested
CSmall algorithms & bit operations

Test whether an unsigned value is a power of two

C: A nonzero power of two has exactly one set bit.

C✓ Tested
GitInspecting the working tree

Test whether tracked working files changed

Git: A quiet diff returns status one for differences, so handle it in a conditional.

Git✓ Tested