FIND YOUR NEXT FEW LINES

Results for “tar”

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

1058 snippets foundClear filters
TypeScriptUTC date operations

Find the final day of a month

TypeScript: Day zero of the following UTC month selects the previous month’s final day.

TypeScript✓ Tested
TypeScriptArray traversal & selection

Find the first matching array item

TypeScript: find returns undefined when no item satisfies the predicate.

TypeScript✓ Tested
JavaDates & time zones

Find the next chosen weekday

Java: TemporalAdjusters.next excludes the starting day even if it already has that weekday.

Java✓ Tested
TypeScriptArray traversal & selection

Find the position of a matching item

TypeScript: findIndex returns -1 when the predicate matches nothing.

TypeScript✓ Tested
TypeScriptArray restructuring

Flatten a single nesting level

TypeScript: flat defaults to a depth of one and creates a new array.

TypeScript✓ Tested
Docker / ComposeContainer lifecycle

Force a disposable container to stop

Docker / Compose: kill sends SIGKILL by default without a graceful shutdown interval.

Docker / Compose✓ Tested
Arduino / CText & bounded buffers

Format several integers in a fixed buffer

Arduino / C: snprintf limits writes to the buffer size and includes a terminating null byte.

Arduino / C✓ Tested
TypeScriptUTC date operations

Format whole seconds as hours minutes and seconds

TypeScript: Use integer divisions and remainders for a nonnegative duration.

TypeScript✓ Tested
TypeScriptArray restructuring

Generate a bounded integer range

TypeScript: Array.from supplies each output position to its mapping function.

TypeScript✓ Tested
JavaDates & time zones

Generate a half-open range of dates

Java: datesUntil includes the starting date and excludes the end date.

Java✓ Tested
Arduino / CDigital signals & interrupts

Generate and measure a short output pulse

Arduino / C: delayMicroseconds can create a short blocking pulse on an output pin.

Arduino / C✓ Tested
Docker / ComposeCompose service options

Give a read-only service writable scratch space

Docker / Compose: A tmpfs mount provides temporary storage independent of the root filesystem.

Docker / Compose✓ Tested