FIND YOUR NEXT FEW LINES

Results for “one-off”

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

621 snippets foundClear filters
ReactCustom hooks

Reuse controlled-input bindings

Reuse controlled-input bindings with a small React component and explicit browser behavior.

React✓ Tested
ReactCustom hooks

Reuse document-title synchronization

Reuse document-title synchronization with a small React component and explicit browser behavior.

React✓ Tested
ReactCustom hooks

Reuse event subscription cleanup

Reuse event subscription cleanup with a small React component and explicit browser behavior.

React✓ Tested
PowerShellArray operations

Reverse a copy while preserving the source

PowerShell: Clone the array before using Array.Reverse because Reverse mutates its argument.

PowerShell✓ Tested
PostgresDates & series

Round a timestamp down to its month

Group dates by a calendar boundary.

date_trunc✓ Tested
jQueryEvents

Run an event handler once

Use jQuery one for a handler that removes itself after the first event.

jQuery✓ Tested
JavaScriptPromises & iteration protocols

Run dependent async steps in order

JavaScript: Await one result before using it as the input of the next calculation.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Run dependent async steps in order

TypeScript: Await one result before using it as the input of the next calculation.

TypeScript✓ Tested
PythonGetting Started

Run your first program

Python: Start with a complete program that prints one line. Follow the run instructions below.

Python✓ Tested
C#Getting Started

Run your first program

C#: Start with a complete program that prints one line. Follow the run instructions below.

C#✓ Tested
JavaGetting Started

Run your first program

Java: Start with a complete program that prints one line. Follow the run instructions below.

Java✓ Tested
JavaScriptGetting Started

Run your first program

JavaScript: Start with a complete program that prints one line. Follow the run instructions below.

JavaScript✓ Tested