FIND YOUR NEXT FEW LINES

The snippet library.

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

3000 snippets foundClear filters
PowerShellGetting Started

Insert a variable into a string

PowerShell: Insert a variable into a string using PowerShell 7.

PowerShell✓ Tested
jQueryInsertion & wrapping

Insert an item at the beginning

jQuery: prepend inserts before the existing children.

jQuery✓ Tested
RustMaps & sets

Insert and retrieve a map value

Insert and retrieve a map value in a complete Rust program using the standard library.

Rust✓ Tested
Docker / ComposeLimits & process security

Insert Docker’s small init process

Docker / Compose: The init option adds a PID 1 process that reaps children and forwards signals.

Docker / Compose✓ Tested
CArray transformations

Insert into an array with spare capacity

C: Move the trailing elements before inserting and keep the logical length separate from capacity.

C✓ Tested
SQLBulk changes & set operations

Insert only keys absent from a destination

SQL: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

SQL✓ Tested
SQL ServerBulk changes & set operations

Insert only keys absent from a destination

SQL Server: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

SQL Server✓ Tested
PostgresBulk changes & set operations

Insert only keys absent from a destination

Postgres: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

Postgres✓ Tested
SQLiteBulk changes & set operations

Insert only keys absent from a destination

SQLite: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

SQLite✓ Tested
PostgresRows & writes

Insert or update on a key conflict

Use a unique key to update an existing row.

ON CONFLICT✓ Tested
PowerShellStrings & literal text

Insert values into a multiline template

PowerShell: A double-quoted here-string expands variable references.

PowerShell✓ Tested
Arduino / CGetting Started

Inspect a byte as hexadecimal

Arduino / C: Inspect a byte as hexadecimal on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested