Global Modules: npm install -g bbb coffee-script express geddy grunt houston jitsu mocha node-dev nib nodester-cli sinon socketstream stylus
Project Modules: restler (HTTP Requests) socket.io (websocket)
Deployment / Services: jitsu nodester-cli
| express = require 'express' | |
| app = module.exports = express() | |
| prefix = "api" | |
| # The collection of models | |
| models = | |
| "writeoff": require '../models/writeoff' | |
| ### | |
| # Create http interface for a model.<namespace> |
Global Modules: npm install -g bbb coffee-script express geddy grunt houston jitsu mocha node-dev nib nodester-cli sinon socketstream stylus
Project Modules: restler (HTTP Requests) socket.io (websocket)
Deployment / Services: jitsu nodester-cli
| var express = require('express'), | |
| app = express(); | |
| app.use( function(req, res, next) { | |
| res.header('Access-Control-Allow-Origin', '*'); | |
| res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'); | |
| res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept'); | |
| next(); | |
| }); |
| //==================================================================== VARS | |
| ani_speed = 0.5s | |
| img_path( filename ) | |
| 'assets/images/'+filename | |
| font_path( filename ) | |
| 'assets/fonts/'+filename |
| define([], function(app) { | |
| var Graph = {}, | |
| adj = {}; //Map of adjacency lists for each node | |
| //@nodes (int[]) | |
| Graph.init = function(nodes){ | |
| //your node labels are consecutive integers starting with one. | |
| //to make the indexing easier we will allocate an array of adjacency one element larger than necessary | |
| adj = adj.clone(); | |
| for (var i = 0; i < nodes.length; ++i) { |
| define [ "modules/user" ], (User)-> | |
| describe "User", -> | |
| users = new User.Collection() | |
| me = null | |
| it "create new user", -> | |
| users.create | |
| "email" : "[email protected]" |
| if _( others ).include( dubstep.banger ) | |
| for bassface in [1..140] | |
| "WUB" |
| <script type="text/javascript"> | |
| // 2012-09-21 : RWM | |
| (function(){ | |
| var countrysortinator = function(){ | |
| // Sort object | |
| var sortinator = { | |
| parse_countries : function($container){ | |
| var countries = []; |
| // This is the main application configuration file. It is a Grunt | |
| // configuration file, which you can learn more about here: | |
| // https://github.com/cowboy/grunt/blob/master/docs/configuring.md | |
| // http://net.tutsplus.com/tutorials/javascript-ajax/meeting-grunt-the-build-tool-for-javascript/ | |
| // If you need support for a pre-compiler or a new tool to play with, check out | |
| // http://gruntjs.com/ | |
| module.exports = function(grunt) { | |
| // directory paths |
| fs = require 'fs' | |
| ID3 = require 'node-id3' | |
| findit = require 'findit' | |
| cradle = require 'cradle' | |
| db = new(cradle.Connection)().database('music') | |
| allowed_files = [ 'mp3', 'aiff', 'wav', 'ogg' ] | |
| mnt = [ | |
| '/Users/<username>/Music', | |
| '/Users/<username>/Podcasts' ] |