Results for “keep original”
Small, practical examples. Search by task or narrow things down below.
Remove duplicate records by a selected key
C#: DistinctBy keeps the first record for each key in encounter order.
C#✓ Tested
Remove duplicate values with a Set
Keep the first occurrence order while deduplicating.
Set✓ Tested
Remove one handler without removing others
jQuery: Pass the original function reference to off.
jQuery✓ Tested
Replace a text file with an atomic rename
Prepare new content beside the target before renaming it into place.
atomic write✓ Tested
Restore an environment value after temporary use
PowerShell: Use finally so temporary process configuration does not leak to subsequent work; remove the entry when it was originally absent.
PowerShell✓ Tested
Round a timestamp down to its month
Group dates by a calendar boundary.
date_trunc✓ Tested
Run a one-off container
Run a command and remove its stopped container automatically.
run✓ Tested
Run cleanup after a promise settles
JavaScript: finally runs after success or failure and normally preserves the original outcome.
JavaScript✓ Tested
Run cleanup after a promise settles
TypeScript: finally runs after success or failure and normally preserves the original outcome.
TypeScript✓ Tested
Scroll wide code locally
Keep long code inside a horizontally scrollable CSS container.
CSS✓ Tested
Select a range of array elements
Bash Scripts: Quote a sliced at-sign expansion to keep each selected element separate.
Bash Scripts✓ Tested
Select specific columns
Read only the fields a result needs.
SELECT✓ Tested