git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
# Send a metric to statsd from bash | |
# | |
# Useful for: | |
# deploy scripts (http://codeascraft.etsy.com/2010/12/08/track-every-release/) | |
# init scripts | |
# sending metrics via crontab one-liners | |
# sprinkling in existing bash scripts. | |
# | |
# netcat options: | |
# -w timeout If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed. |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
var domain = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port : ''); |
RESTORE=$(echo -en '\033[0m') | |
RED=$(echo -en '\033[00;31m') | |
GREEN=$(echo -en '\033[00;32m') | |
YELLOW=$(echo -en '\033[00;33m') | |
BLUE=$(echo -en '\033[00;34m') | |
MAGENTA=$(echo -en '\033[00;35m') | |
PURPLE=$(echo -en '\033[00;35m') | |
CYAN=$(echo -en '\033[00;36m') | |
LIGHTGRAY=$(echo -en '\033[00;37m') | |
LRED=$(echo -en '\033[01;31m') |
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |
Years ago, some smart folks that worked on JS engines realized that not all JS that's loaded into a page/app initially is needed right away. They implemented JIT to optimize this situation.
JIT means Just-In-Time, which means essentially that the engine can defer processing (parsing, compiling) certain parts of a JS program until a later time, for example when the function in question is actually needed. This deferral means the engine is freer to spend the important cycles right now on the code that's going to run right now. This is a really good thing for JS performance.
Some time later, some JS engine devs realized that they needed to get some hints from the code as to which functions would run right away, and which ones wouldn't. In technical speak, these hints are called heuristics.
So they realized that one very common pattern for knowing that a function was going to run right away is if the first character before the function
keyword was a (
, because that usually m
/* | |
* Migration | |
*/ | |
'use strict'; | |
module.exports = { | |
up: function(queryInterface, Sequelize) { | |
return queryInterface.createTable('Users', { | |
firstName: { | |
type: Sequelize.STRING | |
}, |