The snippet library.
Small, practical examples. Search by task or narrow things down below.
Stage a new file
Git: Stage a new file inside the disposable repository created by the input setup.
Git✓ Tested
Stage a tracked file rename
Git: Stage a tracked file rename inside the disposable repository created by the input setup.
Git✓ Tested
Stage one file
Add one changed file to the next commit.
add✓ Tested
Start a command with a minimal environment
Linux Commands: Use env -i with an explicit PATH for a controlled child environment.
Linux Commands✓ Tested
Start a disclosure open while keeping it collapsible
HTML: The open attribute sets the initial details state without JavaScript.
HTML✓ Tested
Start a named queue explicitly
jQuery: Named queues wait until dequeue starts them.
jQuery✓ Tested
Start an existing container and attach to its output
Docker / Compose: create records the command; start with attach runs that existing container.
Docker / Compose✓ Tested
Stash edits to one chosen file
Git: A pathspec limits the stash to selected paths while other changes remain in the working tree.
Git✓ Tested
Stash only the staged changes
Git: The staged option saves index changes while keeping unrelated unstaged edits.
Git✓ Tested
Stash unstaged work while leaving staged edits available
Git: Keep-index preserves the staged state for testing or committing while stashing the rest.
Git✓ Tested
Stop a child event from reaching its parent
jQuery: stopPropagation leaves other handlers on the same element intact.
jQuery✓ Tested
Stop a child process created by the script
Bash Scripts: Send a signal only to the captured PID of the script’s own child and wait for it to exit.
Bash Scripts✓ Tested