FIND YOUR NEXT FEW LINES

Results for “k”

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

1871 snippets foundClear filters
TypeScriptRegular expressions & URL encoding

Resolve a relative URL against a base

TypeScript: A trailing slash makes the final base path component a directory.

TypeScript✓ Tested
CSSInteraction & themes

Respect reduced motion

Disable a CSS animation when the user prefers reduced motion.

CSS✓ Tested
jQueryGetting Started

Respond when a select value changes

jQuery: Learn how to respond when a select value changes in a complete browser example.

jQuery✓ Tested
jQueryGetting Started

Respond while a user types

jQuery: Learn how to respond while a user types in a complete browser example.

jQuery✓ Tested
jQueryForm serialization & state

Restore a form’s original default values

jQuery: Call the native reset method through the underlying form element.

jQuery✓ Tested
PowerShellCommands & execution context

Restore an environment value after temporary use

PowerShell: Use finally so temporary process configuration does not leak to subsequent work; remove the entry when it was originally absent.

PowerShell✓ Tested
ReactEffects & lifecycle

Restore the previous document title

Restore the previous document title with a small React component and explicit browser behavior.

React✓ Tested
GoErrors & validation

Return a descriptive validation error

Return a descriptive validation error using a complete Go program with explicit sample inputs.

Go✓ Tested
HTMLNative disclosure & dialogs

Return a value from a dialog form

HTML: A form with method dialog closes its containing dialog without a network submission.

HTML✓ Tested
RustGetting Started

Return a value from a loop

Return a value from a loop in a complete Rust program using the standard library.

Rust✓ Tested
JavaRecords & reliable control flow

Return a value from a switch expression

Java: Use an exhaustive switch expression with a fallback for other input values.

Java✓ Tested
Bash ScriptsFunction scope & composition

Return a value through a named output variable

Bash Scripts: A Bash nameref can update a caller-supplied variable without command substitution.

Bash Scripts✓ Tested