FIND YOUR NEXT FEW LINES

Results for “one”

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

590 snippets foundClear filters
JavaDates & time zones

Convert epoch seconds into an instant

Java: Instant represents a UTC timeline point independent of the default timezone.

Java✓ Tested
JavaScriptObject behavior & collections

Copy nested structured data independently

JavaScript: structuredClone creates an independent copy of supported structured values.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Copy nested structured data independently

TypeScript: structuredClone creates an independent copy of supported structured values.

TypeScript✓ Tested
PythonDates & time zones

Count days between calendar dates

Python: Subtract date objects to get an exact calendar-day difference.

Python✓ Tested
JavaDates & time zones

Count days between two dates

Java: Use ChronoUnit.DAYS for an elapsed count rather than a Period day component.

Java✓ Tested
ReactComponents & props

Customize a renderer through a function prop

Customize a renderer through a function prop with a small React component and explicit browser behavior.

React✓ Tested
AngularComponents & communication

Derive a value from an input signal

Derive a value from an input signal with a standalone Angular component and explicit browser behavior.

Angular✓ 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
GoDates & times

Display an instant at a fixed offset

Display an instant at a fixed offset using a complete Go program with explicit sample inputs.

Go✓ Tested
AngularComponents & communication

Emit a typed object from a child

Emit a typed object from a child with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularComponents & communication

Expose an input with a public alias

Expose an input with a public alias with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
JavaDates & time zones

Find the last day of a month

Java: Use YearMonth so leap years and month lengths are handled by the calendar library.

Java✓ Tested