Skip to content

Instantly share code, notes, and snippets.

##Quick changelog git log staging..HEAD --no-merges --pretty=format:%s

@corse32
corse32 / zip.js
Created March 23, 2018 01:15
Variable Arity Array Zip
function zip() {
const [arr1, ...rest] = arguments
return arr1.map((e, i) => [e, ...rest.reduce((accum, arrN) => [...accum, arrN[i]], [])])
}
@corse32
corse32 / dump-styles.js
Created December 13, 2017 00:36
JS (ES 6) one liner for extracting CSS rules from a DOM element
//blah is a reference to the dom node in question, e.g. const blah = document.getElementById('popover882889')
Array.from(window.getMatchedCSSRules(blah)).reduce((acc, rule) => `${acc} \n ${rule.cssText}`)