Results for “all”
Small, practical examples. Search by task or narrow things down below.
Format decimal output
Use fixed and setprecision to print two C++ decimal places.
C++✓ Tested
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
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
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
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
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
Give a function an optional argument
Let callers omit a value while keeping nounset enabled.
optional argument✓ Tested
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
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
Give a read-only service writable scratch space
Docker / Compose: A tmpfs mount provides temporary storage independent of the root filesystem.
Docker / Compose✓ Tested
Give a reusable record type a short name
C: A typedef names a structure type without changing its representation.
C✓ Tested
Give an existing image another tag
Docker / Compose: Tagging adds a reference without copying the image layers.
Docker / Compose✓ Tested