FIND YOUR NEXT FEW LINES

Results for “ref”

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

130 snippets foundClear filters
Bash ScriptsArray operations

Copy an array independently

Bash Scripts: A new array assignment copies element values rather than creating a shared reference.

Bash Scripts✓ Tested
GitTags & repository configuration

Create a lightweight tag at the current commit

Git: A lightweight tag is a direct reference without an annotation object.

Git✓ Tested
GitBranches & ancestry

Delete an already merged practice branch

Git: The lowercase -d option refuses to delete an unmerged branch in ordinary use.

Git✓ Tested
HTMLData & disclosure

Display code as text

Escape angle brackets in preformatted HTML code samples.

HTML✓ Tested
Bash ScriptsParameter expansion

Extract a basename without an external process

Bash Scripts: Double hash removes the longest matching prefix ending in a slash.

Bash Scripts✓ Tested
JavaScriptText handling & Unicode

Extract the text after the last delimiter

JavaScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Extract the text after the last delimiter

TypeScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.

TypeScript✓ Tested
GitRemotes & collaboration

Fetch a remote branch

Refresh remote-tracking references before reviewing changes.

fetch✓ Tested
C++Sequence algorithms

Find both extremes in one algorithm call

C++: Check for a nonempty input before dereferencing the returned iterators.

C++✓ Tested
PowerShellHashtables & object records

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
C++Sequence algorithms

Find the first value satisfying a condition

C++: Compare the returned iterator with end before dereferencing it.

C++✓ Tested
C++Numbers & algorithms

Find the largest value

Check for an empty C++ vector before dereferencing max_element.

C++✓ Tested