FIND YOUR NEXT FEW LINES

Results for “k”

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

1871 snippets foundClear filters
CSSGrid placement

Describe a page arrangement with named grid areas

CSS: Named areas make the relationship between a grid template and its sections explicit.

CSS✓ Tested
ReactAccessibility & events

Describe an informative image

Describe an informative image with a small React component and explicit browser behavior.

React✓ Tested
TypeScriptTypes & functions

Describe an object with an interface

Require named fields on a reusable object shape.

interface✓ Tested
C#JSON & binary formats

Deserialize a JSON object into a dictionary

C#: Specify the value type expected from a known JSON shape.

C#✓ Tested
RustGetting Started

Destructure a tuple

Destructure a tuple in a complete Rust program using the standard library.

Rust✓ Tested
ReactComponents & props

Destructure nested data in a component

Destructure nested data in a component with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsFiles & reliability

Detect an error inside a pipeline

Use pipefail to observe failure before the last pipeline command.

pipefail✓ Tested
RustParsing & byte data

Detect invalid UTF-8 data

Detect invalid UTF-8 data in a complete Rust program using the standard library.

Rust✓ Tested
Arduino / CText & bounded buffers

Detect truncated formatted output

Arduino / C: snprintf returns the length it would have written, excluding the null terminator.

Arduino / C✓ Tested
PythonDates & time zones

Determine whether a year is a leap year

Python: Use calendar.isleap rather than a simplified divisibility-by-four check.

Python✓ Tested
jQueryText & attributes

Disable a button

Set the live disabled property with jQuery prop.

jQuery✓ Tested
AngularReactive forms

Disable a control through its model

Disable a control through its model with a standalone Angular component and explicit browser behavior.

Angular✓ Tested