FIND YOUR NEXT FEW LINES

Results for “pre”

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

429 snippets foundClear filters
Arduino / CGetting Started

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
TypeScriptTypes & functions

Give an optional property a default

Handle missing object fields with nullish coalescing.

optional✓ Tested
jQueryEvents

Handle a form locally

Prevent default form navigation while displaying input with jQuery.

jQuery✓ Tested
PowerShellStructured formats & encodings

Handle a malformed JSON document

PowerShell: ConvertFrom-Json reports a terminating conversion error under the selected error preference.

PowerShell✓ Tested
CSSBox dimensions & overflow

Hide an element while keeping its space

CSS: Visibility hidden preserves layout geometry even though the element is not painted.

CSS✓ Tested
C++Tasks & synchronization

Increment a shared counter safely

C++: Atomic increments prevent lost updates when two threads change the same counter.

C++✓ Tested
C++Containers & compound values

Insert a map value only when a key is absent

C++: try_emplace preserves the old value when insertion does not take place.

C++✓ Tested
jQueryInsertion & wrapping

Insert a sibling after an element

jQuery: after preserves the selected element and adds its next sibling.

jQuery✓ Tested
JavaScriptPromises & iteration protocols

Inspect both successful and failed promise results

JavaScript: allSettled preserves input order and reports failures without rejecting the combined promise.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Inspect both successful and failed promise results

TypeScript: allSettled preserves input order and reports failures without rejecting the combined promise.

TypeScript✓ Tested
PostgresRows & writes

Inspect deleted rows

Return values from the rows a DELETE removes.

DELETE✓ Tested
Bash ScriptsFunction scope & composition

Keep a function variable local

Bash Scripts: Local prevents an ordinary function assignment from replacing a caller variable.

Bash Scripts✓ Tested