FIND YOUR NEXT FEW LINES

Results for “Dates & process utilities”

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

266 snippets foundClear filters
Linux CommandsGetting Started

Rename a practice file

Linux Commands: Rename a practice file using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Linux CommandsTransforming text

Reorder fields with a capture group

Linux Commands: Use extended regular expressions and backreferences to rearrange a known format.

Linux Commands✓ Tested
Linux CommandsGetting Started

Replace text in a pipeline

Linux Commands: Replace text in a pipeline using GNU/Linux commands in an empty practice directory.

Linux Commands✓ 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
Linux CommandsText processing

Replace text with sed

Replace all occurrences of the substring old on each line and print the transformed text without changing the input file.

sed✓ Tested
GitMerging & replaying changes

Replay an unpublished branch on a newer base

Git: Rebase updates the base of local feature commits when their changes do not conflict.

Git✓ Tested
PowerShellCommands & execution context

Restore an environment value after temporary use

PowerShell: Use finally so temporary process configuration does not leak to subsequent work; remove the entry when it was originally absent.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Restrict a function parameter to known choices

PowerShell: ValidateSet rejects unsupported values before the function body executes.

PowerShell✓ Tested
TypeScriptUtilities & async

Return typed data from an async function

Await a Promise and handle failures explicitly.

async✓ Tested
PostgresDates & series

Round a timestamp down to its month

Group dates by a calendar boundary.

date_trunc✓ Tested
Docker / ComposeContainer commands

Run a command in a running container

Execute an additional process inside an existing container.

exec✓ Tested
Linux CommandsFinding & selecting files

Run a command safely for each matching file

Linux Commands: Use find -exec with argument placeholders so spaces in filenames remain intact.

Linux Commands✓ Tested