Results for “pin”
Small, practical examples. Search by task or narrow things down below.
Insert a sibling before an element
jQuery: before inserts outside the selected element.
jQuery✓ Tested
Insert an item at the beginning
jQuery: prepend inserts before the existing children.
jQuery✓ Tested
Invert a dictionary with unique values
Python: Swap keys and values when the values are hashable and unique.
Python✓ Tested
Keep only the most recent items
Python: Use a bounded deque to discard the oldest item as new values arrive.
Python✓ Tested
Move a node without losing its event handler
jQuery: detach retains jQuery data and events for reinsertion.
jQuery✓ Tested
Read an optional dictionary key
Python: Use get with a fallback while leaving the dictionary unchanged.
Python✓ Tested
Remove a wrapper while preserving its children
jQuery: unwrap replaces a selected element’s parent with that parent’s contents.
jQuery✓ Tested
Remove and return a dictionary entry
Python: Use pop with a default when a missing entry is an expected condition.
Python✓ Tested
Replace an element while preserving its position
jQuery: replaceWith swaps an entire node.
jQuery✓ Tested
Turn on the built-in LED
Configure the Uno’s LED pin as an output and drive it high.
LED_BUILTIN✓ Tested
Wrap a collection in one shared parent
jQuery: wrapAll places all selected elements inside one wrapper.
jQuery✓ Tested
Wrap each matched element separately
jQuery: wrap adds a parent around each selected element.
jQuery✓ Tested