Results for “COPY”
Small, practical examples. Search by task or narrow things down below.
Memoize a sorted copy of state
Memoize a sorted copy of state with a small React component and explicit browser behavior.
React✓ Tested
Reverse a copy while preserving the original
JavaScript: Copy before reverse because reverse mutates the array it receives.
JavaScript✓ Tested
Reverse a copy while preserving the original
TypeScript: Copy before reverse because reverse mutates the array it receives.
TypeScript✓ Tested
Reverse a copy while preserving the source
PowerShell: Clone the array before using Array.Reverse because Reverse mutates its argument.
PowerShell✓ Tested
Sort a copy without mutating the original list
Sort a copy without mutating the original list with a small React component and explicit browser behavior.
React✓ Tested
Sort a derived copy of a collection
Sort a derived copy of a collection with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Retrieve a file from a stopped container
Docker / Compose: The writable layer remains available for docker cp after exit.
Docker / Compose✓ Tested
Set copied files’ numeric ownership
Docker / Compose: COPY --chown sets ownership while adding the file.
Docker / Compose✓ Tested
Take an immutable list snapshot
Java: List.copyOf protects the snapshot from later changes to the source list.
Java✓ Tested
Build a mutable generic list
PowerShell: A generic list supports repeated additions without copying an entire array each time.
PowerShell✓ Tested
Compress a file and keep the original
Create a gzip-compressed copy of a file while leaving the uncompressed original in place.
gzip✓ Tested
Find set members missing from another set
Java: Use removeAll on a copy to calculate a set difference.
Java✓ Tested