FIND YOUR NEXT FEW LINES

Results for “save”

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

1671 snippets foundClear filters
RustFunctions & data types

Capture a surrounding value in a closure

Capture a surrounding value in a closure in a complete Rust program using the standard library.

Rust✓ Tested
C++Ownership & optional values

Capture configuration by value in a callable

C++: A value capture retains the value from lambda creation even if the original variable changes later.

C++✓ Tested
Bash ScriptsFunction scope & composition

Capture output while handling a failed command

Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.

Bash Scripts✓ Tested
Bash ScriptsInput streams & redirection

Capture standard output and standard error separately

Bash Scripts: Use distinct redirections when diagnostic text should not be mixed with data.

Bash Scripts✓ Tested
GoFunctions & types

Capture state in a closure

Capture state in a closure using a complete Go program with explicit sample inputs.

Go✓ Tested
CSSPositioning & stacking

Center a fixed-size absolute child with auto margins

CSS: An all-zero inset plus auto margins distributes the available space around the child.

CSS✓ Tested
CSSGrid placement

Center a small item in a grid cell

CSS: Place-items sets both block-axis and inline-axis item alignment.

CSS✓ Tested
CSSLayout

Center content with flexbox

Center a child along both axes inside a CSS flex container.

CSS✓ Tested
RustErrors & optional values

Chain operations that may return None

Chain operations that may return None in a complete Rust program using the standard library.

Rust✓ Tested
CSSInteraction selectors

Change a control’s appearance on hover

CSS: Hover applies while a pointing device is positioned over the element.

CSS✓ Tested
RustFiles & paths

Change a path’s extension

Change a path’s extension 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