This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
//retrieved from http://www.timeanddate.com/time/zones/ | |
//with the following console code: | |
(function(){ | |
var trs = $$('#tz-abb tbody tr'), | |
timeZones = trs.map(tr => { | |
var tds = $$('td', tr), | |
keys = ['abbreviation', 'name', 'location', 'offset'], | |
tz = {}; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// retrieved from http://dublincore.org/documents/dcmi-terms/ | |
// with the following Chrome console code: | |
(function() { | |
Element.prototype.getAxis = function(axis) { | |
var td = this.querySelector('td[axis=' + axis + ']'); | |
return td ? td.innerText : ""; | |
} | |
var tbodies = $$('#H2 tbody'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# -lt 1 ]; then | |
echo "usage: loadenv filename" | |
exit 2 | |
fi | |
HASH="#" | |
for ENV_FILE in "$@"; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getByProperty(obj, prop) { | |
if (typeof obj === "object") { | |
return Object.keys(obj).reduce( (a, c) => { | |
if (c === prop) { | |
a = a.concat(obj[c]); | |
} | |
return a.concat( | |
getByProperty(obj[c], prop) || [] | |
); | |
}, []); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getFullname = u => [u.first, u.middle, u.last].filter(Boolean).join(' ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDeep(obj, key) { | |
return key.split('.').reduce((o, x) => { | |
return (o || {})[x]; | |
}, obj); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateJWT(jwt) { | |
let payload = {}, valid = false | |
try { | |
[, payload] = jwt.split('.').slice(0,2).map(p => JSON.parse(atob(p))) | |
valid = true | |
} catch (error) {} | |
return { jwt, payload, valid } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((j,b)=>{j.t=!j.t;const f=j.t?b.addEventListener:b.removeEventListener;console.log('remove mode %s',j.t?'on':'off');j.rE=j.rE||(({target:el})=>{console.log('removing:',el);el.parentNode.removeChild(el);});f('click',j.rE);})(window.JMT=window.JMT||{},document.body); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ten = 'no numbers'.length; | |
[...Array(ten * ten).keys()].forEach(i => console.log(++i)); |
OlderNewer