FIND YOUR NEXT FEW LINES

Results for “C++”

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

3000 snippets foundClear filters
ReactState & reducers

Reset reducer state explicitly

Reset reducer state explicitly with a small React component and explicit browser behavior.

React✓ Tested
ReactCustom hooks

Reset state to a caller-provided initial value

Reset state to a caller-provided initial value with a small React component and explicit browser behavior.

React✓ Tested
HTMLMetadata & document links

Resolve relative links against an explicit base

HTML: A base href changes how relative document URLs are resolved.

HTML✓ Tested
CSSInteraction & themes

Respect dark color preference

Apply different CSS colors when the browser requests a dark theme.

CSS✓ Tested
CSSInteraction & themes

Respect reduced motion

Disable a CSS animation when the user prefers reduced motion.

CSS✓ Tested
jQueryGetting Started

Respond to a button click

jQuery: Learn how to respond to a button click in a complete browser example.

jQuery✓ 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
Docker / ComposeContainer lifecycle

Restart an existing container

Docker / Compose: restart starts the same container again while retaining its writable layer.

Docker / Compose✓ Tested
GitRestoring & revising local work

Restore a file’s content from an older commit

Git: Specify a source revision when the desired contents are not in the current index.

Git✓ Tested
HTMLForm behavior

Restore controls to their initial form defaults

HTML: A reset button restores default values rather than clearing every control.

HTML✓ Tested
GitStashing selected work

Restore the index state recorded in a stash

Git: Apply with index restores which changes were staged as well as their file contents.

Git✓ Tested
ReactEffects & lifecycle

Restore the previous document title

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

React✓ Tested