Results for “ref”
Small, practical examples. Search by task or narrow things down below.
Copy an array independently
Bash Scripts: A new array assignment copies element values rather than creating a shared reference.
Bash Scripts✓ Tested
Create a lightweight tag at the current commit
Git: A lightweight tag is a direct reference without an annotation object.
Git✓ Tested
Delete an already merged practice branch
Git: The lowercase -d option refuses to delete an unmerged branch in ordinary use.
Git✓ Tested
Display code as text
Escape angle brackets in preformatted HTML code samples.
HTML✓ Tested
Extract a basename without an external process
Bash Scripts: Double hash removes the longest matching prefix ending in a slash.
Bash Scripts✓ Tested
Extract the text after the last delimiter
JavaScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.
JavaScript✓ Tested
Extract the text after the last delimiter
TypeScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.
TypeScript✓ Tested
Fetch a remote branch
Refresh remote-tracking references before reviewing changes.
fetch✓ Tested
Find both extremes in one algorithm call
C++: Check for a nonempty input before dereferencing the returned iterators.
C++✓ Tested
Find differences between two collections
PowerShell: Compare-Object marks reference-only values with a left arrow and difference-only values with a right arrow.
PowerShell✓ Tested
Find the first value satisfying a condition
C++: Compare the returned iterator with end before dereferencing it.
C++✓ Tested
Find the largest value
Check for an empty C++ vector before dereferencing max_element.
C++✓ Tested