This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster = require 'cluster' | |
express = require 'express' | |
workers = require('os').cpus().length | |
app = express() | |
app.get '/', (req, res) -> | |
res.send('Working!') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Stream collection/model data. | |
* @exports mixins/Stream | |
* @module Stream | |
*/ | |
var Stream = { | |
/** | |
* Is the collection steaming? | |
* | |
* @property streaming |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use express for server/middleware | |
express = require 'express' | |
# create new instance of express | |
app = express() | |
# set static directory to root directory of this file | |
app.use express.static __dirname | |
# run the application on port 9000 | |
app.listen 9000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Class | |
snippet bc | |
var ${1:Thing} = Class.extend({ | |
initialize: function(${2:Attributes}) { | |
} | |
}); | |
# Model | |
snippet bbm | |
var ${1:Thing} = Backbone.Model.extend({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function namespace(string, obj) { | |
var current = window, | |
names = string.split('.'), | |
name; | |
while(name = names.shift()) { | |
current[name] = current[name] || {}; | |
current = current[name]; | |
} |
NewerOlder