FIND YOUR NEXT FEW LINES

Results for “Bulk changes & set operations”

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

686 snippets foundClear filters
GitStashing selected work

Inspect which files a stash changes

Git: stash show can report just filenames before applying anything.

Git✓ 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
TypeScriptObject behavior & collections

Prevent runtime changes to top-level properties

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

TypeScript✓ Tested
Docker / ComposeCompose service options

Set a Compose service’s working directory

Docker / Compose: working_dir changes where the container command starts.

Docker / Compose✓ Tested
Docker / ComposeExecution & file transfer

Set a container’s own hostname

Docker / Compose: hostname changes the name reported inside the container.

Docker / Compose✓ Tested
GitStashing selected work

Stash only the staged changes

Git: The staged option saves index changes while keeping unrelated unstaged edits.

Git✓ Tested
C++Containers & compound values

Store and inspect a fixed set of bits

C++: bitset offers named operations and a readable binary representation.

C++✓ Tested
Bash ScriptsParameter expansion

Assign a default to an empty or unset variable

Bash Scripts: The colon-equals expansion both supplies and assigns a fallback value.

Bash Scripts✓ Tested
Arduino / CData & storage

Average a fixed set of readings

Accumulate sample values without overflowing a 16-bit total.

array✓ Tested
C++Sequence algorithms

Calculate changes between successive readings

C++: adjacent_difference keeps the first value and then writes each difference from its predecessor.

C++✓ Tested
ReactState & reducers

Centralize state changes in a reducer

Centralize state changes in a reducer with a small React component and explicit browser behavior.

React✓ Tested
RustErrors & optional values

Chain operations that may return None

Chain operations that may return None in a complete Rust program using the standard library.

Rust✓ Tested