FIND YOUR NEXT FEW LINES

Results for “Get-Content”

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

914 snippets foundClear filters
TypeScriptUTC date operations

Detect an invalid Date object

TypeScript: An invalid Date has a NaN time value.

TypeScript✓ Tested
TypeScriptNumbers & numeric validation

Detect NaN without converting the input

TypeScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.

TypeScript✓ 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
Arduino / CArrays & embedded state

Dispatch a command through function pointers

Arduino / C: A small function table can map validated command indices to actions.

Arduino / C✓ Tested
Arduino / CSerial protocols

Dispatch a one-character serial command

Arduino / C: A switch provides explicit handling for accepted and unknown commands.

Arduino / C✓ Tested
TypeScriptNumbers & numeric validation

Display a number with a fixed decimal width

TypeScript: toFixed returns a formatted string rather than a numeric value.

TypeScript✓ Tested
TypeScriptObject behavior & collections

Distinguish an own property from an inherited one

TypeScript: Object.hasOwn avoids depending on an object’s possibly shadowed hasOwnProperty method.

TypeScript✓ Tested
HTMLImages & embedded documents

Draw a basic rectangle on a labeled canvas

HTML: Canvas requires script to draw pixels; provide alternative content and an accessible label.

HTML✓ Tested
Arduino / CDigital signals & interrupts

Drive the built-in LED low after turning it on

Arduino / C: digitalWrite changes the actual output level of a configured pin.

Arduino / C✓ Tested
TypeScriptNumbers & numeric validation

Drop the fractional part toward zero

TypeScript: Math.trunc differs from floor for negative inputs.

TypeScript✓ Tested
Arduino / CBinary values & packets

Encode a value as little-endian bytes

Arduino / C: Store the least significant byte first when the protocol requires it.

Arduino / C✓ Tested
C#Asynchronous work & URI handling

Escape text for an HTML context

C#: HtmlEncode converts markup delimiters in plain text before rendering it as HTML content.

C#✓ Tested