I hereby claim:
- I am ottonascarella on github.
- I am ottonascarella (https://keybase.io/ottonascarella) on keybase.
- I have a public key ASCbxUbhsdCT9B9aWy0v8Rk36QTs9bu3KZC_pQ0V0-kj9go
To claim this, I am signing this object:
<button class="plus">+</button> | |
<code>0</code> | |
<button class="minus">-</button> |
[ | |
[:editor "ctrl-shift-m" :editor.sublime.selectBetweenBrackets] | |
[:editor "pmeta-shift-d" :editor.sublime.duplicateLine] | |
[:editor "pmeta-shift-space" :editor.sublime.selectScope] | |
[:editor "pmeta-ctrl-up" :editor.sublime.swapLineUp] | |
[:editor "ctrl-shift-up" :editor.sublime.selectLinesUpward] | |
[:editor "ctrl-shift-k" :editor.delete-line] | |
[:editor "pmeta-shift-l" :editor.sublime.splitSelectionByLine] | |
[:editor "ctrl-m" :editor.sublime.goToBracket] | |
[:editor "pmeta-ctrl-down" :editor.sublime.swapLineDown] |
I hereby claim:
To claim this, I am signing this object:
const getIn = (...path) => target => { | |
return path.reduce((obj, k) => { | |
return (obj == null) ? obj : obj[k]; | |
}, target); | |
} |
function type (v) { | |
if (typeof v.constructor['@@type'] === 'string') return v.constructor['@@type']; | |
if (isNaN(v)) return 'NaN'; | |
return ({}).toString.call(v).replace(/\[object\s|\]/g, ''); | |
} |
function flatten(xs) { | |
return xs.reduce((acc, item) => { | |
if (Array.isArray(item)) { | |
return acc.concat(flatten(item)); | |
} | |
acc.push(item); | |
(ns flatten-it) | |
(defn flatten-it [coll] | |
(loop [acc [], aseq coll] | |
(let [[fst & rst] aseq] | |
(cond | |
(empty? aseq) (seq acc) | |
(sequential? fst) (recur (into acc (flatten-it fst)) rst) | |
:otherwise (recur (into acc [fst]) rst))))) |
/* improved version of the one found at https://developer.mozilla.org/docs/Web/API/Element/matches */ | |
(function(p) { | |
if (p.matches) return; | |
p.matches = | |
p.matchesSelector || | |
p.mozMatchesSelector || | |
p.msMatchesSelector || | |
p.oMatchesSelector || | |
p.webkitMatchesSelector || | |
function(s) { |
Function.prototype.debounce = function(delay) { | |
var outter = this, | |
timer; | |
return function() { | |
var inner = this, | |
args = [].slice.apply(arguments); | |
clearTimeout(timer); |
Function.prototype.throttle = function(delay) { | |
var outter = this, | |
timer, control = false; | |
return function() { | |
if (control) return; | |
control = true; | |
var inner = this, |