Results for “Restoring & revising local work”
Small, practical examples. Search by task or narrow things down below.
Pass values through a custom event
jQuery: trigger passes its extra argument array after the event object.
jQuery✓ Tested
Pipe input into a container process
Docker / Compose: The interactive flag keeps standard input open without allocating a terminal.
Docker / Compose✓ Tested
Post a JSON request body
jQuery: JSON.stringify and application/json send a JSON document.
jQuery✓ Tested
Post URL-encoded form data
jQuery: post sends a data object as form-encoded fields by default.
jQuery✓ Tested
Preallocate a slice’s capacity
Preallocate a slice’s capacity using a complete Go program with explicit sample inputs.
Go✓ Tested
Prepare an owned directory before dropping root
Docker / Compose: Create and chown the writable application path before USER.
Docker / Compose✓ Tested
Prepend items while preserving existing array values
Bash Scripts: Construct a new array with the new values before the quoted original expansion.
Bash Scripts✓ Tested
Preserve a failure status while an EXIT trap runs
Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.
Bash Scripts✓ Tested
Preserve a feature branch boundary with a merge commit
Git: No-ff records a merge commit even when a fast-forward would be possible.
Git✓ Tested
Preserve a large JSON integer
Preserve a large JSON integer using a complete Go program with explicit sample inputs.
Go✓ Tested
Prevent a variable value from expanding as a filename pattern
Bash Scripts: Quote a variable to pass its literal contents even when matching filenames exist.
Bash Scripts✓ Tested
Prevent gaining privileges through exec
Docker / Compose: The no-new-privileges flag is visible in process status.
Docker / Compose✓ Tested