FIND YOUR NEXT FEW LINES

Results for “pre”

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

429 snippets foundClear filters
PythonStructured data & serialization

Represent a record with a dataclass

Python: Generate initialization and convert a typed record to a dictionary.

Python✓ Tested
GoMaps & sets

Represent a set with empty structs

Represent a set with empty structs using a complete Go program with explicit sample inputs.

Go✓ Tested
CStructures & function interfaces

Represent a small set of named states

C: An enum gives symbolic names to integer state values.

C✓ Tested
C++Ownership & optional values

Represent an absent result with optional

C++: value_or supplies a default without requiring a sentinel inside the value domain.

C++✓ Tested
Arduino / CGetting Started

Represent an enabled state

Arduino / C: Represent an enabled state on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
HTMLNative disclosure & dialogs

Represent progress whose total is unknown

HTML: Omit value to make a progress element indeterminate.

HTML✓ Tested
HTMLText semantics

Represent removed and inserted text

HTML: Del and ins record a textual change while retaining both versions in the document.

HTML✓ Tested
CSSInteraction & themes

Respect dark color preference

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

CSS✓ Tested
ReactEffects & lifecycle

Restore the previous document title

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

React✓ 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
jQueryTraversal & selection

Return to the previous collection in a chain

jQuery: end restores the selection before the last traversal operation.

jQuery✓ Tested
GitBranches & ancestry

Return to the previously checked-out branch

Git: The dash shorthand selects the previous branch in the checkout history.

Git✓ Tested