FIND YOUR NEXT FEW LINES

Results for “ff-only”

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

1229 snippets foundClear filters
CStrings & byte buffers

Append text only when the destination has enough capacity

C: Check the combined lengths including the terminator before using strcat.

C✓ Tested
GitInspecting the working tree

List newly added staged files only

Git: Filter the cached diff by added status while leaving modified files out.

Git✓ Tested
GitInspecting the working tree

List only staged filenames

Git: The cached diff compares the index with HEAD rather than comparing working files with the index.

Git✓ Tested
GitBranches & recovery

Merge a branch only by fast-forward

Refuse to create an unexpected merge commit.

merge✓ Tested
GitRemotes & collaboration

Pull without creating a merge commit

Update a branch only when its upstream can be fast-forwarded.

pull✓ Tested
RustFunctions & data types

Accept different types with a generic function

Accept different types with a generic function in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsProcesses & environment

Change directory only for one operation

Bash Scripts: A subshell makes a temporary directory change without affecting later commands.

Bash Scripts✓ Tested
Arduino / CBinary values & packets

Clear a flag without affecting neighboring bits

Arduino / C: bitClear resets only the selected bit.

Arduino / C✓ Tested
GoTesting & reusable helpers

Compare two byte buffers

Compare two byte buffers using a complete Go program with explicit sample inputs.

Go✓ Tested
C#Dates & precise numbers

Convert a timestamp to a different fixed offset

C#: ToOffset changes the displayed local time while retaining the same instant.

C#✓ Tested
C#Dates & precise numbers

Convert Unix seconds to an offset-aware timestamp

C#: DateTimeOffset preserves the UTC offset explicitly.

C#✓ Tested
CDynamic memory & ownership

Create an independent copy of a byte buffer

C: Allocate the exact byte length and copy only after checking the result.

C✓ Tested