FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
SQL ServerText cleanup & matching

Place missing values after known values portably

SQL Server: A CASE sort key controls NULL placement without relying on engine-specific defaults.

SQL Server✓ Tested
PostgresText cleanup & matching

Place missing values after known values portably

Postgres: A CASE sort key controls NULL placement without relying on engine-specific defaults.

Postgres✓ Tested
SQLiteText cleanup & matching

Place missing values after known values portably

SQLite: A CASE sort key controls NULL placement without relying on engine-specific defaults.

SQLite✓ Tested
Bash ScriptsArray operations

Prepend items while preserving existing array values

Bash Scripts: Construct a new array with the new values before the quoted original expansion.

Bash Scripts✓ Tested
Bash ScriptsProcesses & environment

Preserve a failure status while an EXIT trap runs

Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.

Bash Scripts✓ Tested
PowerShellHashtables & object records

Preserve key insertion order

PowerShell: An ordered dictionary enumerates keys in the order they were inserted.

PowerShell✓ Tested
JavaScriptObject behavior & collections

Prevent runtime changes to top-level properties

JavaScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

JavaScript✓ Tested
JavaScriptGetting Started

Print a number with two decimal places

JavaScript: Format a small decimal value consistently for display.

JavaScript✓ Tested
Bash ScriptsText parsing & arithmetic

Print text containing percent characters literally

Bash Scripts: Never use untrusted text as the printf format string.

Bash Scripts✓ Tested
JavaScriptPromises & iteration protocols

Produce a lazy sequence with a generator

JavaScript: A generator yields one value per iteration without building an intermediate array.

JavaScript✓ Tested
C++Tasks & synchronization

Protect a shared container with a mutex

C++: A scoped lock_guard releases the mutex when its scope ends.

C++✓ Tested
JavaScriptObjects & JSON

Read a nested value safely

Combine optional chaining with nullish coalescing in JavaScript.

JavaScript✓ Tested