It works!
$ npm test
npm info it worked if it ends with ok
npm info using npm@2.7.5
npm info using node@v0.10.38
npm info pretest npm-scripts-envvar@1.0.0
var filtered = { | |
bazz: true, | |
buzz: true | |
}; | |
var maps = { | |
foo: function (value, acc) { | |
return value * 10; | |
}, | |
bar: function (value, acc) { |
# | |
# 1. Set your npm prefix to ~/.node_modules | |
# nb. Windows users here be dragons. | |
# | |
npm c set prefix $HOME/.node_modules | |
mkdir $HOME/.node_modules | |
# | |
# 2. Update your path to give the bin location of | |
# the new prefix directory highest precedence |
function deacronym(anyKey) { | |
return anyKey.replace(/([A-Z]+)[A-Z]/g, function (match, cap, i, str) { | |
var sub; | |
if (i + match.length === str.length) { | |
sub = match.slice(1); | |
} else { | |
sub = !i ? cap.slice(1) : match.slice(1, -1); | |
} | |
return match.replace(sub, sub.toLowerCase()); |
var format = winston.label() | |
.pipe(winston.timestamp()) | |
.pipe(winston.colorize()) | |
var logger = winston.logger({ | |
transports: [ | |
winston.file({ | |
format: format, | |
}) | |
.pipe(winston.gzip()) |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');
Those suck for maintenance and they're ugly.
function logAndSum(sum, n) { | |
console.log('%s + %s = %s', sum, n, n + sum); | |
return n + sum; | |
} | |
function logAndSumAll () { | |
var args = Array.prototype.slice.call(arguments); | |
console.log( | |
args.join(' + ') + ' = ' + args.reduce(function (sum, n) { return sum + n }, 0) | |
); |
If you haven’t heard already: Nodejitsu is joining the team at GoDaddy. I can only speak of my own experience, but I imagine that every startup exit is much like running the startup itself: a whirlwind of emotions that takes a high constitution to process. Now don’t read any negative connotations in that statement since a whirlwind of positive emotions is still a whirlwind of emotions. The startup rollercoaster. After all, no one said that building a technically challenging vision on a brand new technology that was still evolving while simultaneously helping the underlying technology itself (Node.js) become successful was going to be easy.
If it was easy it would just be the way.
Being a founder, CEO, and technical product manager over the last (almost) five years at Nodejitsu is and has been an amazing experience. I often tell people who are thinking of starting companies: don’t. Expressing that sentiment is only to deter those without the wherewithal a
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
... any takers? Comment on this gist! The discussion all started from a Tweet:
Who's going to be the first to write a wrapper for the @thalmic #myo C++ library? Latest headers: https://gist.github.com/indexzero/60d1224f0082f0d16f14
As pointed out by @c4milo there are a number of libraries that exist, but from first glance they all have deficiencies: