Skip to content

Instantly share code, notes, and snippets.

View indexzero's full-sized avatar
🌎
Always bet on Open Source

Charlie Robbins indexzero

🌎
Always bet on Open Source
View GitHub Profile
@indexzero
indexzero / readme-outline.md
Created November 14, 2011 08:26
A quick outline of a README.md

README.md Outline

  • Header and a Brief description (should match package.json)
  • Example (if applicable)
  • Motivation (if applicable)
  • API Documentation: This will likely vary considerably from library to library.
  • Installation
  • Tests
  • Contributors
  • License

If two versions of colors exist on disk then this will always throw. This is extremely common in development scenarios with npm link but also if two packages depended on by a third both depend on colors but the parent does not.

  parent-app
  `--- pkg-a
  |   `---colors
  `--- pkg-b
     `---colors
@indexzero
indexzero / MostUsedCommands.md
Created December 31, 2011 21:55 — forked from csanz/MostUsedCommands.md
Most used commands

history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r

         288 git
          29 heroku
          28 bin/runserver
          24 cd
          23 node
          13 ll
          11 vi

10 open

@indexzero
indexzero / gist:1545460
Created December 31, 2011 21:55 — forked from csanz/gist:1545189
My Hacker History
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -rn
284 git
29 heroku
28 bin/runserver
24 cd
23 node
13 ll
11 vi
10 open
@indexzero
indexzero / v8-0412.js
Created January 3, 2012 05:30
Properties of Error instances in the latest V8 included by [email protected] are not enumerable. And thus cannot be serialized through JSON.stringify
> var err = new Error('wtf?');
> JSON.stringify(err)
'{"stack":"Error: wtf?\\n at [object Context]:1:11\\n at Interface.<anonymous> (repl.js:179:22)\\n at Interface.emit (events.js:64:17)\\n at Interface._onLine (readline.js:153:10)\\n at Interface._line (readline.js:408:8)\\n at Interface._ttyWrite (readline.js:585:14)\\n at ReadStream.<anonymous> (readline.js:73:12)\\n at ReadStream.emit (events.js:81:20)\\n at ReadStream._emitKey (tty_posix.js:307:10)\\n at ReadStream.onData (tty_posix.js:70:12)","message":"wtf?"}'
> Object.keys(err);
[ 'stack', 'arguments', 'type', 'message' ]
> Object.getOwnPropertyDescriptor(err, 'stack');
{ get: [Function], set: [Function], enumerable: true, configurable: true }
> process.versions.v8
'3.1.8.26'
@indexzero
indexzero / cluster.js
Created January 11, 2012 19:59 — forked from mnutt/cluster.js
clustering with node 0.6.7
global.config = require('./lib/config').load("config/app.json");
var cluster = require('cluster');
var fs = require('fs');
var app = require('./app');
// Logging
var log = require('./lib/winston');
global.log = log;
// Write out pidfile
var fs = require('fs')
var DataCollector = function(arr) {
this.setFiles(arr)
}
DataCollector.prototype = {
setFiles: function(arr) {
this.files = arr
}
@indexzero
indexzero / README.md
Created January 14, 2012 04:38
npmcount output for groups of node.js thought leaders
@indexzero
indexzero / .gitignore
Created January 17, 2012 05:58 — forked from chilts/.gitignore
The application itself
node_modules
*.log
*~
@indexzero
indexzero / gist:1627460
Created January 17, 2012 16:52 — forked from evantahler/gist:1574158
Build Node on Phidget (ARMv4tl + emdebian)

For more information, you can read a related blog post on this topic

Install Node.js on an ARMv4tl Phidget Board (SBC2)

What is a Phidget SBC2?

Node is awesome, Phidgets are awesome. Syngergy. All I wanted to do was tweet the temperature of my house automatically…

What you will need:

  • A computer (or a virtual machine) running a full version of the Debian operating system