FIND YOUR NEXT FEW LINES

Results for “one-off”

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

621 snippets foundClear filters
Arduino / CGetting Started

Print a label beside a number

Arduino / C: Combine Serial.print and Serial.println to put text and a value on one line.

Arduino / C✓ Tested
C#File operations & paths

Process a file as a lazy line sequence

C#: ReadLines avoids allocating one string containing the entire file.

C#✓ Tested
JavaScriptPromises & iteration protocols

Produce a lazy sequence with a generator

JavaScript: A generator yields one value per iteration without building an intermediate array.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Produce a lazy sequence with a generator

TypeScript: A generator yields one value per iteration without building an intermediate array.

TypeScript✓ Tested
AngularServices & dependency injection

Provide a configuration value with a token

Provide a configuration value with a token with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularAccessibility & reusable patterns

Provide alternative text for an informative image

Provide alternative text for an informative image with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularGetting Started

Provide an @empty list state

Provide an @empty list state with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactContext & shared state

Provide read-only application configuration

Provide read-only application configuration with a small React component and explicit browser behavior.

React✓ Tested
AngularLifecycle & observable data

Publish updated state through a BehaviorSubject

Publish updated state through a BehaviorSubject with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
GitRemotes & collaboration

Pull without creating a merge commit

Update a branch only when its upstream can be fast-forwarded.

pull✓ Tested
SQLWindow analytics

Rank tied scores without gaps

SQL: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.

SQL✓ Tested
SQL ServerWindow analytics

Rank tied scores without gaps

SQL Server: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.

SQL Server✓ Tested