Results for “ref”
Small, practical examples. Search by task or narrow things down below.
Refuse to overwrite an existing file with redirection
Bash Scripts: Noclobber makes a plain greater-than redirection fail when the target already exists.
Bash Scripts✓ Tested
Register cleanup through DestroyRef
Register cleanup through DestroyRef with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Remove a known prefix safely
Python: Use removeprefix instead of lstrip when removing a literal prefix rather than a set of characters.
Python✓ Tested
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
Remove a prefix only when it matches
Remove a prefix only when it matches in a complete Rust program using the standard library.
Rust✓ Tested
Remove an optional prefix
Remove an optional prefix using a complete Go program with explicit sample inputs.
Go✓ Tested
Remove one tag while retaining another reference
Docker / Compose: Removing a tag does not delete an image still referenced by another tag.
Docker / Compose✓ Tested
Remove stale remote-tracking references
Git: Fetch with prune removes tracking references for branches no longer present on the remote.
Git✓ Tested
Respect dark color preference
Apply different CSS colors when the browser requests a dark theme.
CSS✓ Tested
Return an array through a nameref
Bash Scripts: Assign through a nameref to preserve array element boundaries.
Bash Scripts✓ Tested
Scroll a referenced element into view
Scroll a referenced element into view with a small React component and explicit browser behavior.
React✓ Tested
Sort only the smallest requested prefix
C++: partial_sort orders the selected prefix without guaranteeing the order of the remainder.
C++✓ Tested