FIND YOUR NEXT FEW LINES

Results for “pin”

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

89 snippets foundClear filters
jQueryInsertion & wrapping

Insert a sibling before an element

jQuery: before inserts outside the selected element.

jQuery✓ Tested
jQueryInsertion & wrapping

Insert an item at the beginning

jQuery: prepend inserts before the existing children.

jQuery✓ Tested
PythonMappings & sets

Invert a dictionary with unique values

Python: Swap keys and values when the values are hashable and unique.

Python✓ Tested
PythonMappings & sets

Keep only the most recent items

Python: Use a bounded deque to discard the oldest item as new values arrive.

Python✓ Tested
jQueryInsertion & wrapping

Move a node without losing its event handler

jQuery: detach retains jQuery data and events for reinsertion.

jQuery✓ Tested
PythonMappings & sets

Read an optional dictionary key

Python: Use get with a fallback while leaving the dictionary unchanged.

Python✓ Tested
jQueryInsertion & wrapping

Remove a wrapper while preserving its children

jQuery: unwrap replaces a selected element’s parent with that parent’s contents.

jQuery✓ Tested
PythonMappings & sets

Remove and return a dictionary entry

Python: Use pop with a default when a missing entry is an expected condition.

Python✓ Tested
jQueryInsertion & wrapping

Replace an element while preserving its position

jQuery: replaceWith swaps an entire node.

jQuery✓ Tested
Arduino / CDigital input & output

Turn on the built-in LED

Configure the Uno’s LED pin as an output and drive it high.

LED_BUILTIN✓ Tested
jQueryInsertion & wrapping

Wrap a collection in one shared parent

jQuery: wrapAll places all selected elements inside one wrapper.

jQuery✓ Tested
jQueryInsertion & wrapping

Wrap each matched element separately

jQuery: wrap adds a parent around each selected element.

jQuery✓ Tested