FIND YOUR NEXT FEW LINES

Results for “id”

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

1109 snippets foundClear filters
TypeScriptTypes & functions

Describe an object with an interface

Require named fields on a reusable object shape.

interface✓ 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
jQueryText & attributes

Disable a button

Set the live disabled property with jQuery prop.

jQuery✓ Tested
jQueryAnimation completion

Disable animations for a reduced-motion mode

jQuery: The global fx.off switch causes effects to finish immediately.

jQuery✓ Tested
GitRestoring & revising local work

Discard an unstaged edit to one tracked file

Git: Restore copies the index version back into the selected working file.

Git✓ Tested
HTMLNative disclosure & dialogs

Dismiss a modal with the Escape key

HTML: Native modal dialogs provide keyboard dismissal and return focus to their invoker.

HTML✓ 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
JavaPrecise numeric calculations

Display an integer as unsigned

Java: Use unsigned conversion methods when interpreting a fixed-width bit pattern.

Java✓ Tested
GitRemotes & additional checkouts

Distinguish a bare repository from a working checkout

Git: rev-parse reports repository mode without relying on directory naming conventions.

Git✓ Tested
JavaScriptObject behavior & collections

Distinguish an own property from an inherited one

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

JavaScript✓ 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