FIND YOUR NEXT FEW LINES

Results for “all”

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

1115 snippets foundClear filters
C++Numbers & algorithms

Format decimal output

Use fixed and setprecision to print two C++ decimal places.

C++✓ Tested
ReactComponents & props

Forward input props to a reusable field

Forward input props to a reusable field with a small React component and explicit browser behavior.

React✓ Tested
SQLRelationships & missing data

Generate every combination of two sets

SQL: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.

SQL✓ Tested
SQL ServerRelationships & missing data

Generate every combination of two sets

SQL Server: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.

SQL Server✓ Tested
PostgresRelationships & missing data

Generate every combination of two sets

Postgres: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.

Postgres✓ Tested
SQLiteRelationships & missing data

Generate every combination of two sets

SQLite: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.

SQLite✓ Tested
Bash ScriptsFunctions & arguments

Give a function an optional argument

Let callers omit a value while keeping nounset enabled.

optional argument✓ Tested
Bash ScriptsFunction scope & composition

Give a function its own positional parameters

Bash Scripts: A function receives its call arguments without replacing the caller’s positional parameters.

Bash Scripts✓ Tested
Docker / ComposeGetting Started

Give a read-only container temporary storage

Docker / Compose: Give a read-only container temporary storage using a locally available Ubuntu image.

Docker / Compose✓ Tested
Docker / ComposeCompose service options

Give a read-only service writable scratch space

Docker / Compose: A tmpfs mount provides temporary storage independent of the root filesystem.

Docker / Compose✓ Tested
CStructures & function interfaces

Give a reusable record type a short name

C: A typedef names a structure type without changing its representation.

C✓ Tested
Docker / ComposeImage management

Give an existing image another tag

Docker / Compose: Tagging adds a reference without copying the image layers.

Docker / Compose✓ Tested