FIND YOUR NEXT FEW LINES

Results for “k”

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

1871 snippets foundClear filters
GitBranches & ancestry

Inspect a revision with detached HEAD

Git: Detached mode is useful for inspection; create a branch before keeping new work.

Git✓ Tested
GoErrors & validation

Inspect a typed conversion error

Inspect a typed conversion error using a complete Go program with explicit sample inputs.

Go✓ Tested
GoFunctions & types

Inspect a value with a type switch

Inspect a value with a type switch using a complete Go program with explicit sample inputs.

Go✓ Tested
GoGetting Started

Inspect a value’s type

Inspect a value’s type using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Inspect every command status in a pipeline

Bash Scripts: Copy PIPESTATUS immediately before another command overwrites it.

Bash Scripts✓ Tested
RustVectors & slices

Inspect overlapping windows

Inspect overlapping windows in a complete Rust program using the standard library.

Rust✓ Tested
AngularPipes & formatting

Inspect structured data with JsonPipe

Inspect structured data with JsonPipe with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
Arduino / CSensor calculations

Interpolate between two calibration points

Arduino / C: Compute a fractional position before scaling to the output interval.

Arduino / C✓ Tested
PythonMappings & sets

Invert a dictionary with unique values

Python: Swap keys and values when the values are hashable and unique.

Python✓ Tested
Bash ScriptsFunction scope & composition

Isolate variable changes in a subshell

Bash Scripts: Parentheses create a subshell whose variable assignments do not change the parent.

Bash Scripts✓ Tested
Bash ScriptsArray operations

Join array items with a one-character separator

Bash Scripts: A local IFS controls the separator used by the quoted star expansion.

Bash Scripts✓ Tested
GoFiles & paths

Join portable path components

Join portable path components using a complete Go program with explicit sample inputs.

Go✓ Tested