FIND YOUR NEXT FEW LINES

Results for “cr”

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

1833 snippets foundClear filters
Bash ScriptsDiagnostics & defensive scripting

Check a script’s syntax without executing its body

Bash Scripts: bash -n parses commands but does not run ordinary script statements.

Bash Scripts✓ Tested
Bash ScriptsGetting Started

Choose between two script branches

Bash Scripts: Choose between two script branches with a small standalone Bash program.

Bash Scripts✓ Tested
ReactEffects & lifecycle

Clean up a subscription when a child unmounts

Clean up a subscription when a child unmounts with a small React component and explicit browser behavior.

React✓ Tested
Arduino / CTiming & control

Compare elapsed time across timer rollover

Use unsigned subtraction when a millisecond counter wraps.

rollover✓ Tested
Docker / ComposeExecution & file transfer

Copy a file into a created container

Docker / Compose: docker cp can copy into a container before its process starts.

Docker / Compose✓ Tested
GitStashing selected work

Create a branch at the original base of a stash

Git: stash branch checks out the stash’s base and reapplies the saved work there.

Git✓ Tested
GitBranches & ancestry

Create a branch from a known release tag

Git: A named starting revision makes the branch’s initial commit explicit.

Git✓ Tested
GitGetting Started

Create a branch without switching to it

Git: Create a branch without switching to it inside the disposable repository created by the input setup.

Git✓ Tested
HTMLGetting Started

Create a complete HTML document

HTML: Learn how to create a complete HTML document in a complete browser example.

HTML✓ Tested
Linux CommandsArchives & checksums

Create a compressed tar archive

Bundle a directory into a gzip-compressed tar archive, preserving the directory structure.

tar✓ Tested
AngularServices & dependency injection

Create a dependency with a provider factory

Create a dependency with a provider factory with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
PowerShellFiles & paths

Create a directory if needed

Ensure a directory exists before writing output.

New-Item✓ Tested