Skip to content

Instantly share code, notes, and snippets.

View csanz's full-sized avatar
🎯
Focusing

Christian Sanz csanz

🎯
Focusing
View GitHub Profile
> db.users.find();
{ "_id" : ObjectId("4d82e8e0a212e32240e91d49"), "name" : "Mike" }
{ "_id" : ObjectId("4d8393086a370e29032422ce"), "name" : "Mike" }
{ "_id" : ObjectId("4d83930a6a370e29032422cf"), "name" : "Mike" }
{ "_id" : ObjectId("4d83930f6a370e29032422d0"), "name" : "chris" }
{ "_id" : ObjectId("4d8393106a370e29032422d1"), "name" : "chris" }
{ "_id" : ObjectId("4d8393126a370e29032422d2"), "name" : "chris" }
{ "_id" : ObjectId("4d8393136a370e29032422d3"), "name" : "chris" }
{ "_id" : ObjectId("4d8393176a370e29032422d4"), "name" : "jenn" }
{ "_id" : ObjectId("4d83931e6a370e29032422d5"), "name" : "denise" }
@csanz
csanz / gist:879067
Created March 21, 2011 05:10
dup results.
[
{
"name" : "Mike",
"count" : 3
},
{
"name" : "chris",
"count" : 4
},
{
@csanz
csanz / get_elapsed_time.js
Created March 22, 2011 00:14
get the elapsed time from a server
/* usage
node get_elapsed_time.js -u localhost -p 8000 */
var start, elapsed, end, argv, http;
argv = require('optimist').argv;
http = require('http');
if (argv.u.length == 0) return console.log('need url');
start = new Date();
http.get({ host : argv.u , port: (argv.p) ? argv.p : 80}, function(res){
console.log('\nnget console util\n');
@csanz
csanz / javascript_engineer.js
Created March 24, 2011 09:04
Javascript Engineer @ Storify.com
var reqs, skills, passion;
reqs = require('smart');
skills = require('javascript_html_css_mongodb');
passion = require('change_the_world_of_storytelling');
/**
We are looking for talented + well-rounded developers to
join storify.com's core engineering team. We are young,
funded and picking up a lot of momentum. We run a pure
Javascript stack, from node.js on the server, mongodb on the
backend and jQuery on the browser. We are also
@csanz
csanz / javascript_engineer.js
Created March 24, 2011 19:16
Javascript Engineer @ Storify.com
var reqs = require('smart'),
skills = require('javascript_html_css_mongodb'),
passion = require('change_the_world_of_storytelling');
/**
We are looking for talented + well-rounded developers to
join storify.com's core engineering team. We are young,
funded and picking up a lot of momentum. We run a pure
Javascript stack, from node.js on the server, mongodb on the
backend and jQuery on the browser. We are also
fanatics about HTML5 and CSS3.
@csanz
csanz / gist:923529
Created April 16, 2011 21:41
Github API View
General API Info
How to authenticate as a user, URL schema, secure and unsecured access and access limitations.
>> Authentication
Users API
API for accessing and modifying user information.
>> Searching for Users
>> Getting User Information
@csanz
csanz / getting_started_with_node.js
Created April 23, 2011 01:48
Getting started with node.js as Gist
var c = require('commitment');
/*
Ok, before you start this, be committed to following
each step NON-STOP until you are done with all the instructions!
I'm assuming you are a mac os x user.
If you are using windows, sorry about that...
Install
/\
/ &\
/i。& \
/⸮ ⸮& \
/ @ \
/⸛@ ⸮i 。 \
/ 。 ⁂ & \
/ &&⸛& & &i &\
/ & ⸛。⁂⁂i⸛ ⸛ i\
vi ~/.mods
colors
connect
everyauth
express
jade
n
npm
nyam
@csanz
csanz / gist:951222
Created May 2, 2011 05:55
ngen 1st draft proposal
ngen blog
create
create app/controllers
create app/views
create test
create public
create db
create lib
create config