FIND YOUR NEXT FEW LINES

Results for “keep”

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

136 snippets foundClear filters
Docker / ComposeContainer commands

Pass an environment variable

Supply configuration without changing an image.

environment✓ Tested
PowerShellFunctions & control

Pass named parameters from a hashtable

Keep a command’s options together in a reusable object.

splatting✓ Tested
Docker / ComposeExecution & file transfer

Pipe input into a container process

Docker / Compose: The interactive flag keeps standard input open without allocating a terminal.

Docker / Compose✓ Tested
Docker / ComposeCompose applications

Put an optional service behind a profile

Keep a utility service separate from a normal Compose startup.

Compose✓ Tested
TypeScriptUtilities & async

Read a property with keyof

Keep the key and returned value tied to an object type.

keyof✓ Tested
Bash ScriptsInput streams & redirection

Read from a dedicated file descriptor

Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.

Bash Scripts✓ Tested
Bash ScriptsVariables & text

Remove a filename extension

Keep the path while removing its final extension.

filename✓ Tested
C#LINQ transformations

Remove duplicate records by a selected key

C#: DistinctBy keeps the first record for each key in encounter order.

C#✓ Tested
TypeScriptCollections & records

Remove duplicate values with a Set

Keep the first occurrence order while deduplicating.

Set✓ Tested
Bash ScriptsFiles & reliability

Replace a text file with an atomic rename

Prepare new content beside the target before renaming it into place.

atomic write✓ Tested
PythonStrings & dates

Replace text in a string

Replace every occurrence of a substring and keep the result in a new string. The original string is unchanged.

string✓ Tested
PostgresDates & series

Round a timestamp down to its month

Group dates by a calendar boundary.

date_trunc✓ Tested