Results for “keep original”
Small, practical examples. Search by task or narrow things down below.
Serialize a hashtable as JSON
Produce compact JSON for a small data object.
JSON✓ Tested
Share data through a named volume
Keep a file across two short-lived containers.
volume✓ Tested
Share ownership with a counted smart pointer
C++: Copies of shared_ptr keep the owned value alive until the last owner is released.
C++✓ Tested
Sort dictionaries by a value
Sort a list of dictionaries by a numeric field, leaving the original list unchanged.
sort✓ Tested
Split delimited text with positions
Retain original order with STRING_SPLIT ordinals.
STRING_SPLIT✓ Tested
Stash only the staged changes
Git: The staged option saves index changes while keeping unrelated unstaged edits.
Git✓ Tested
Toggle an output using an explicit software state
Arduino / C: Keep the intended output state in a Boolean variable.
Arduino / C✓ Tested
Trim and discard blank lines
JavaScript: Split a text block, trim each line, and keep nonempty values.
JavaScript✓ Tested
Trim and discard blank lines
TypeScript: Split a text block, trim each line, and keep nonempty values.
TypeScript✓ Tested
Type an object update with Partial
Allow a caller to provide just the fields to change.
Partial✓ Tested
Understand setup() and loop()
Arduino / C: See initialization run once and the main loop run repeatedly.
Arduino / C✓ Tested
Undo a commit with a new commit
Reverse a change while preserving shared history.
revert✓ Tested