Results for “Restoring & revising local work”
Small, practical examples. Search by task or narrow things down below.
Return typed data from an async function
Await a Promise and handle failures explicitly.
async✓ Tested
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
Run an event handler once
Use jQuery one for a handler that removes itself after the first event.
jQuery✓ Tested
Set a form field value
Populate a labeled input with jQuery val.
jQuery✓ Tested
Set an element attribute
Update an HTML link using jQuery attr.
jQuery✓ Tested
Set text safely
Use jQuery text to insert literal content instead of interpreting HTML.
jQuery✓ Tested
Toggle a state class
Toggle a CSS class in a jQuery click handler.
jQuery✓ Tested
Use a recursive function for a bounded calculation
Bash Scripts: A recursive factorial demonstrates local variables and a clear base case.
Bash Scripts✓ Tested
Visit selected elements
Use jQuery each to label every item with its one-based position.
jQuery✓ Tested
Abort a conflicting cherry-pick
Git: Abort removes the incomplete replay and returns to the previous branch state.
Git✓ Tested
Abort a conflicting rebase
Git: Abort returns the branch to its state before the rebase attempt.
Git✓ Tested
Abort a merge with unresolved conflicts
Git: Abort restores the pre-merge state in this clean practice repository.
Git✓ Tested