FIND YOUR NEXT FEW LINES

Results for “only”

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

621 snippets foundClear filters
GitRestoring & revising local work

Add a forgotten file to the latest unpublished commit

Git: Stage the missing file before amending without changing the message.

Git✓ Tested
C#Data & dates

Add calendar days

Use DateOnly for a date without a time zone in C#.

C#✓ Tested
RustErrors & optional values

Add context to a parsing failure

Add context to a parsing failure in a complete Rust program using the standard library.

Rust✓ Tested
JavaNumbers & dates

Add days to a date

Parse an ISO date and add calendar days using Java LocalDate.

Java✓ Tested
GoDates & times

Advance a calendar date

Advance a calendar date using a complete Go program with explicit sample inputs.

Go✓ Tested
HTMLImages & embedded documents

Allow embedded scripts without granting same-origin access

HTML: Grant only allow-scripts so the sandboxed document retains an opaque origin.

HTML✓ Tested
C#Files & paths

Append a line

Append UTF-8 text without replacing existing C# file contents.

C#✓ Tested
JavaFiles & paths

Append a line

Append text to a Java file, creating it if necessary.

Java✓ Tested
PythonFiles & paths

Append a line to a file

Add a new line to the end of a text file without replacing its existing contents. Append mode also creates the file if it does not exist.

file✓ Tested
RustVectors & slices

Append several values to a vector

Append several values to a vector in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Append to a file without truncating it

Append to a file without truncating it in a complete Rust program using the standard library.

Rust✓ Tested
GoGetting Started

Append to a slice

Append to a slice using a complete Go program with explicit sample inputs.

Go✓ Tested