FIND YOUR NEXT FEW LINES

Results for “target”

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

264 snippets foundClear filters
TypeScriptRegular expressions & URL encoding

Resolve a relative URL against a base

TypeScript: A trailing slash makes the final base path component a directory.

TypeScript✓ Tested
TypeScriptTypes & functions

Return the first item with a generic function

Preserve the element type while allowing empty arrays.

generics✓ Tested
TypeScriptUtilities & async

Return typed data from an async function

Await a Promise and handle failures explicitly.

async✓ Tested
Arduino / CGetting Started

Reuse an LED action with a function

Arduino / C: Put a short LED sequence in a named function and call it twice.

Arduino / C✓ Tested
TypeScriptArray restructuring

Reverse a copy while preserving the original

TypeScript: Copy before reverse because reverse mutates the array it receives.

TypeScript✓ Tested
Docker / ComposeContainer commands

Run a command in a running container

Execute an additional process inside an existing container.

exec✓ Tested
Arduino / CGetting Started

Run a first sketch and read serial output

Arduino / C: Run a first sketch and read serial output on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
TypeScriptPromises & iteration protocols

Run cleanup after a promise settles

TypeScript: finally runs after success or failure and normally preserves the original outcome.

TypeScript✓ Tested
TypeScriptPromises & iteration protocols

Run dependent async steps in order

TypeScript: Await one result before using it as the input of the next calculation.

TypeScript✓ Tested
TypeScriptGetting Started

Run your first program

TypeScript: Start with a complete program that prints one line. Follow the run instructions below.

TypeScript✓ Tested
TypeScriptSafe data handling

Safely read a caught error

Check the error type before accessing its message.

unknown✓ Tested
Arduino / CSerial protocols

Search the stream for a message marker

Arduino / C: find consumes input through a matching marker or until timeout.

Arduino / C✓ Tested