FIND YOUR NEXT FEW LINES

Results for “Restoring & revising local work”

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

812 snippets foundClear filters
GoGetting Started

Return two values from a function

Return two values from a function using a complete Go program with explicit sample inputs.

Go✓ Tested
jQueryAnimation completion

Reveal a collapsed panel with a slide

jQuery: slideDown animates the panel’s vertical dimensions.

jQuery✓ Tested
GoSlices & collections

Reverse slice order

Reverse slice order using a complete Go program with explicit sample inputs.

Go✓ Tested
RustNumbers & durations

Round and format a decimal value

Round and format a decimal value in a complete Rust program using the standard library.

Rust✓ Tested
GoDates & times

Round down to a whole minute

Round down to a whole minute using a complete Go program with explicit sample inputs.

Go✓ Tested
Docker / ComposeContainer commands

Run a command in a running container

Execute an additional process inside an existing container.

exec✓ Tested
Docker / ComposeCompose service options

Run a Compose service as a non-root user

Docker / Compose: user overrides the image’s default identity.

Docker / Compose✓ Tested
Docker / ComposeContainer commands

Run a one-off container

Run a command and remove its stopped container automatically.

run✓ Tested
Docker / ComposeExecution & file transfer

Run a one-off process with a numeric user ID

Docker / Compose: The user option overrides the image’s default identity.

Docker / Compose✓ Tested
Docker / ComposeGetting Started

Run a process as an unprivileged user

Docker / Compose: Run a process as an unprivileged user using a locally available Ubuntu image.

Docker / Compose✓ Tested
C++Tasks & synchronization

Run a task on a thread and join it

C++: Join before reading a result written by the worker thread.

C++✓ Tested
JavaRecords & reliable control flow

Run a task on an executor and close it

Java: Java 21 ExecutorService supports try-with-resources to shut down after submitted work.

Java✓ Tested