FIND YOUR NEXT FEW LINES

Results for “only”

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

621 snippets foundClear filters
SQLiteConstraints & defaults

Require a value with NOT NULL

SQLite: Declare required fields at the database boundary, not only in application validation.

SQLite✓ Tested
C#Getting Started

Require two conditions to be true

C#: Combine a lower and an upper bound to check whether a value is in range.

C#✓ Tested
GitMerging & replaying changes

Resolve a merge by writing the intended final file

Git: After a conflict, edit the result, stage it, and finish the merge commit.

Git✓ Tested
C#Asynchronous work & URI handling

Resolve a relative URI against a base

C#: Use a base URI ending in a slash when the final path component represents a directory.

C#✓ Tested
GoHTTP & URLs

Resolve a relative URL

Resolve a relative URL using a complete Go program with explicit sample inputs.

Go✓ Tested
GitRestoring & revising local work

Restore a file’s content from an older commit

Git: Specify a source revision when the desired contents are not in the current index.

Git✓ Tested
GitStashing selected work

Restore the index state recorded in a stash

Git: Apply with index restores which changes were staged as well as their file contents.

Git✓ Tested
GitInspecting the working tree

Restrict a diff to one chosen path

Git: Use the double dash separator to distinguish a filename from revisions or options.

Git✓ Tested
GoErrors & validation

Return a descriptive validation error

Return a descriptive validation error using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Return a value from a loop

Return a value from a loop in a complete Rust program using the standard library.

Rust✓ Tested
C#Types & reliable control flow

Return multiple named values from a method

C#: Named value tuples give lightweight field names without a separate class.

C#✓ Tested
GitBranches & ancestry

Return to the previously checked-out branch

Git: The dash shorthand selects the previous branch in the checkout history.

Git✓ Tested