Skip to content

Instantly share code, notes, and snippets.

View csanz's full-sized avatar
🎯
Focusing

Christian Sanz csanz

🎯
Focusing
View GitHub Profile
@csanz
csanz / short_code_generator.js
Created June 15, 2011 10:36
Just a simple, mini short code generator.
// For Nodejs
const crypto = require('crypto');
/**
* Get Short Code
*
* Mini Short Code Generator
*
* @param {Number} size
When I search fro this:
https://twitter.com/#!/search/looking%20slick!%20beta
I get 5 results
When I do it inside storify I get 1 :(
http://www.cl.ly/0y1C271J1l0O3i462j1a
var express = require('express')
, stylus = require('stylus')
, nib = require('nib');
var app = express.createServer(express.logger());
// Configure general expressjs
app.configure(function(){
The ExpressJS-MongooseJS.org initiative ;)
Trying to come up with a standard expressjs + mongoose mvc-like folder structure.
still keep it flexible, so anyone can do whatever they want,
but provide a structure for new people.
(borrowing a little form rails)
-/app
--/controller
Yo Brian -
Re: https://github.com/bnoguchi/mongoose-auth/blob/master/lib/modules/password/everyauth.js#L6-8
What do you think about something more like this for the error handling:
validation fields
/models/user/validation.js
{
gem install jsonpretty
then try it out
$curl http://github.com/api/v2/json/repos/show/csanz?page=1 -s | jsonpretty
SICK shit. That's it.
@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
vi ~/.mods
colors
connect
everyauth
express
jade
n
npm
nyam
/\
/ &\
/i。& \
/⸮ ⸮& \
/ @ \
/⸛@ ⸮i 。 \
/ 。 ⁂ & \
/ &&⸛& & &i &\
/ & ⸛。⁂⁂i⸛ ⸛ i\
@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