Skip to content

Instantly share code, notes, and snippets.

View usmonster's full-sized avatar
🫖

Usman usmonster

🫖
  • Paris, New York, Internet
View GitHub Profile
@usmonster
usmonster / markdown-details-collapsible.md
Last active November 6, 2020 22:17 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.
1. Click to expand!


Peek-a-boo!

2. Click to expand!
  • One
  • Two
  • But also
@usmonster
usmonster / textContent.js
Last active April 11, 2024 06:18 — forked from eligrey/textContent.js
Updated Node.prototype.textContent shim for IE8 ONLY
(function() {
// inspired by Eli Grey's shim @ http://eligrey.com/blog/post/textcontent-in-ie8
// heavily modified to better match the spec:
// http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent
if (Object.defineProperty && Object.getOwnPropertyDescriptor &&
Object.getOwnPropertyDescriptor(Element.prototype, 'textContent') &&
!Object.getOwnPropertyDescriptor(Element.prototype, 'textContent').get) {
// NOTE: Neither of these "drop-in" patterns would work:
// Object.defineProperty(..., ..., descriptor); // nope!