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
TypeScriptUtilities & async

Return typed data from an async function

Await a Promise and handle failures explicitly.

async✓ Tested
Docker / ComposeGetting Started

Run a Compose service as a numeric user

Docker / Compose: Run a Compose service as a numeric user in a small Compose file.

Docker / Compose✓ Tested
jQueryEvents

Run an event handler once

Use jQuery one for a handler that removes itself after the first event.

jQuery✓ Tested
jQueryText & attributes

Set a form field value

Populate a labeled input with jQuery val.

jQuery✓ Tested
jQueryText & attributes

Set an element attribute

Update an HTML link using jQuery attr.

jQuery✓ Tested
jQueryText & attributes

Set text safely

Use jQuery text to insert literal content instead of interpreting HTML.

jQuery✓ Tested
jQueryDOM & classes

Toggle a state class

Toggle a CSS class in a jQuery click handler.

jQuery✓ Tested
Bash ScriptsFunction scope & composition

Use a recursive function for a bounded calculation

Bash Scripts: A recursive factorial demonstrates local variables and a clear base case.

Bash Scripts✓ Tested
jQueryTraversal & selection

Visit selected elements

Use jQuery each to label every item with its one-based position.

jQuery✓ Tested
GitMerging & replaying changes

Abort a conflicting cherry-pick

Git: Abort removes the incomplete replay and returns to the previous branch state.

Git✓ Tested
GitMerging & replaying changes

Abort a conflicting rebase

Git: Abort returns the branch to its state before the rebase attempt.

Git✓ Tested
GitMerging & replaying changes

Abort a merge with unresolved conflicts

Git: Abort restores the pre-merge state in this clean practice repository.

Git✓ Tested