Skip to content

Instantly share code, notes, and snippets.

View spadgos's full-sized avatar
🕶️
I will be slow to respond, if at all.

Nick Fisher spadgos

🕶️
I will be slow to respond, if at all.
View GitHub Profile
@spadgos
spadgos / bookmarklet.txt
Last active March 21, 2018 12:05 — forked from anonymous/random-task.js
Output a list of random task titles
javascript:(function()%7Bconst adverbs %3D %5B'abruptly'%2C 'actively'%2C 'badly'%2C 'beautifully'%2C'briskly'%2C 'brutally'%2C 'carefully'%2C 'cheerfully'%2C'circularly'%2C 'clearly'%2C 'collectively'%2C 'comfortably'%2C'considerably'%2C 'continuously'%2C 'courageously'%2C 'crazily'%2C'creatively'%2C 'creditably'%2C 'dangerously'%2C 'delicately'%2C'delightfully'%2C 'destructively'%2C 'differently'%2C 'endlessly'%2C'enviously'%2C 'eternally'%2C 'expectedly'%2C 'expertly'%2C'financially'%2C 'firmly'%2C 'forcefully'%2C 'gloriously'%2C'growingly'%2C 'harmfully'%2C 'hatefully'%2C 'healthily'%2C'hopefully'%2C 'imitatively'%2C 'impressively'%2C 'inclusively'%2C'indicatively'%2C 'injuriously'%2C 'insultingly'%2C 'intentionally'%2C'irritatingly'%2C 'leadingly'%2C 'lightly'%2C 'livingly'%2C'madly'%2C 'massively'%2C 'monotonously'%2C 'movingly'%2C'powerfully'%2C 'quickly'%2C 'randomly'%2C 'sadly'%2C'securely'%2C 'sloppily'%2C 'sorrowfully'%2C 'speedily'%2C'truthfully'%2C 'uneasily'%2C 'wearily'%2C 'weirdly'%2C'wholehea
~ npm ###-begin-npm-completion-###
#
# npm command completion script
#
# Installation: npm completion >> ~/.bashrc (or ~/.zshrc)
# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm
#
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
@spadgos
spadgos / gist:895bd47747b39f519ce6
Last active August 29, 2015 14:15
Bound vs wrapped functions
var someObj = something();
return {
bound: someObj.fn.bind(someObj), // 4M ops/sec
wrapped: function (a) { // 16M ops/sec
return someObj.fn(a);
}
};
@spadgos
spadgos / gist:3e0d16518b35eab7ecb1
Created May 14, 2014 09:22
ESLint errors on master
$ git clone [email protected]:eslint/eslint.git
$ cd eslint
$ npm install
$ npm test
1) default-case switch (a) {
case 1: break;
//oh-oh
// no default
}:
@spadgos
spadgos / gist:9356871
Created March 4, 2014 22:11
Marquee code
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](((+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+
@spadgos
spadgos / promises.js
Created March 3, 2014 09:20
Promises causing memory leaks
function bad() {
var promise = somethingAsync();
promise.finally(function () {
logSomeThings();
});
promise = promise.then(function (result) {
return transform(result);
});
@spadgos
spadgos / gist:8097529
Last active March 22, 2021 21:28
Basic rebase and merge flow

Merging feature branches with rebase:

  1. git checkout master
  2. git pull --rebase to make sure you have the latest version of master
  3. git checkout feature/my-branch
  4. git rebase master ... to rebase this branch from master
    1. Optionally, git push --force to update the branch on github. This is useful for making sure it closes a pull request properly.
  5. git checkout master
  6. git merge --no-ff feature/my-branch ... merge the branch into master, making sure there's a merge commit
/*
Below is an incomplete snippet of code which is used to implement the Lazy Require Calls
method described here http://spadgos.github.io/rupy13/#/29
Basically, it takes an AST like this:
var Foo = require('foo');
function bar() {
Foo.quux();
}
@spadgos
spadgos / 01 - before.html
Last active December 28, 2015 04:58
tenXer dashboard content
<div class="dashModContainer">
<div class="box dashModContent">
<div class="boxHead row subBelow">
<div class="span11 dashModDrag">
<h2 class="dashModTitle">
Lines Modified
</h2>
</div>
<div class="span1 configureContainer">
<button type="button" class=" dashModConfigure configureModule bare icon-gear mini iconText" data-form-url="/dashboard/modules/AX5LGVBXVMK94GXREDACTEDFSCUCYRFCSQOZVA/edit/">
@spadgos
spadgos / gist:6534696
Created September 12, 2013 08:55
Acorn AST sample
_.bar()
{
"0": {
"type": "CallExpression",
"start": 0,
"end": 7,
"callee": {
"type": "MemberExpression",
"start": 0,
"end": 5,