Results for “k”
Small, practical examples. Search by task or narrow things down below.
Use case-insensitive dictionary keys
C#: Choose an ordinal comparer when case-insensitive keys represent identifiers.
C#✓ Tested
Use semantic page landmarks
HTML: Learn how to use semantic page landmarks in a complete browser example.
HTML✓ Tested
Validate a small stored payload with a checksum
Arduino / C: Store a checksum with the payload and reject a changed byte.
Arduino / C✓ Tested
Validate access through a custom context hook
Validate access through a custom context hook with a small React component and explicit browser behavior.
React✓ Tested
Validate an unknown value with a type guard
Check a field before treating unknown data as a typed object.
unknown✓ Tested
Verify a file against a checksum manifest
Linux Commands: Use sha256sum -c with a manifest obtained from a trusted source.
Linux Commands✓ Tested
Visit associative-array keys in a stable order
Bash Scripts: Associative arrays have no defined iteration order, so sort their keys explicitly.
Bash Scripts✓ Tested
Wait for a background job before reading its output
Bash Scripts: Save the job PID and wait explicitly before consuming files it produces.
Bash Scripts✓ Tested
Wait for an actual container health check
Docker / Compose: Health reports readiness independently from process startup.
Docker / Compose✓ Tested
Wait for concurrent workers
Wait for concurrent workers using a complete Go program with explicit sample inputs.
Go✓ Tested
Write a generic first-or-fallback helper
C#: Constrain a generic helper through its input shape and return an explicit caller-supplied fallback.
C#✓ Tested
Write a literal multiline block
Bash Scripts: Quoting the heredoc delimiter disables parameter and command expansion inside it.
Bash Scripts✓ Tested