FIND YOUR NEXT FEW LINES

Results for “while”

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

162 snippets foundClear filters
PowerShellFile operations & integrity

Append a line while keeping earlier content

PowerShell: Add-Content appends using an explicitly selected encoding.

PowerShell✓ Tested
GitStashing selected work

Apply a stash while keeping the saved entry

Git: Apply restores changes without removing the stash reference.

Git✓ Tested
C#Asynchronous work & URI handling

Await multiple tasks while preserving result order

C#: Task.WhenAll returns results in the same order as the supplied tasks.

C#✓ Tested
Bash ScriptsFunction scope & composition

Capture output while handling a failed command

Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.

Bash Scripts✓ Tested
SQLBulk changes & set operations

Combine results while retaining duplicates

SQL: UNION ALL does not spend work removing equal rows.

SQL✓ Tested
SQL ServerBulk changes & set operations

Combine results while retaining duplicates

SQL Server: UNION ALL does not spend work removing equal rows.

SQL Server✓ Tested
PostgresBulk changes & set operations

Combine results while retaining duplicates

Postgres: UNION ALL does not spend work removing equal rows.

Postgres✓ Tested
SQLiteBulk changes & set operations

Combine results while retaining duplicates

SQLite: UNION ALL does not spend work removing equal rows.

SQLite✓ Tested
Linux CommandsFiles & permissions

Copy a directory while preserving attributes

Linux Commands: Use cp -a for a recursive local copy that preserves links and ordinary file attributes.

Linux Commands✓ Tested
Bash ScriptsGetting Started

Count down with a while loop

Bash Scripts: Count down with a while loop with a small standalone Bash program.

Bash Scripts✓ Tested
ReactAsync work & status

Disable an action while it is pending

Disable an action while it is pending with a small React component and explicit browser behavior.

React✓ Tested
C++Ordering & set operations

Group matching values while preserving their order

C++: stable_partition keeps the relative order within both predicate groups.

C++✓ Tested