FIND YOUR NEXT FEW LINES

Results for “origin”

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

43 snippets foundClear filters
Bash ScriptsParameter expansion

Remove a known prefix with a shell pattern

Bash Scripts: The hash expansion removes the shortest matching prefix without changing the original variable.

Bash Scripts✓ Tested
jQueryEvent control

Remove one handler without removing others

jQuery: Pass the original function reference to off.

jQuery✓ Tested
PythonStrings & dates

Replace text in a string

Replace every occurrence of a substring and keep the result in a new string. The original string is unchanged.

string✓ Tested
PowerShellCommands & execution context

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
JavaScriptPromises & iteration protocols

Run cleanup after a promise settles

JavaScript: finally runs after success or failure and normally preserves the original outcome.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Run cleanup after a promise settles

TypeScript: finally runs after success or failure and normally preserves the original outcome.

TypeScript✓ Tested
PythonCollections

Sort dictionaries by a value

Sort a list of dictionaries by a numeric field, leaving the original list unchanged.

sort✓ Tested
SQL ServerDates & text

Split delimited text with positions

Retain original order with STRING_SPLIT ordinals.

STRING_SPLIT✓ Tested
TypeScriptUtilities & async

Type an object update with Partial

Allow a caller to provide just the fields to change.

Partial✓ Tested
GitBranches & recovery

Undo a commit with a new commit

Reverse a change while preserving shared history.

revert✓ Tested
TypeScriptSafe data handling

Update an object with a readonly input

Create a changed copy while retaining the original.

readonly✓ Tested
Bash ScriptsVariables & text

Use a default value for an unset variable

Supply a fallback without changing the original variable.

parameter expansion✓ Tested