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 / app.in
Created October 25, 2011 16:49 — forked from tj/ast.js
Declarative JS
with application
set env to production
set view engine to jade
get /user/tj
send "hello"
delete /user/tj
send "no can do!"
// Here is a proposal for minimalist JavaScript classes, humbly offered.
// There are (at least) two different directions in which classes can be steered.
// If we go for a wholly new semantics and implementation, then fancier classical
// inheritance can be supported with parallel prototype chains for true inheritance
// of properties at both the class and instance level.
// If however, we keep current JavaScript prototype semantics, and add a form that
// can desugar to ES3, things must necessarily stay simpler. This is the direction
// I'm assuming here.
var cursor = dbclient.collection('example', _).find(_);
var count = cursor.count(_);
for(var obj = cursor.nextObject(_), oi = 0; obj; obj =
cursor.nextObject(_), oi++) {
/**
* do something with every obj here
* suppose for this example it needs total count and offset (oi).
*/
});
@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 / 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 / .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
@indexzero
indexzero / readme.md
Created January 25, 2012 22:07 — forked from mislav/readme.md
CLI tool that checks the build status of current branch on Travis CI

Check build status of a project on the command line

Install (copy & paste):

curl -sL \
  gist.github.com/raw/1676577/eb66596ba3d69bf1ba9d782ce7ddaaab295cc4db/travis.rb \
  > ~/bin/travis && chmod +x ~/bin/travis

gem install hub | tail -2