Skip to content

Instantly share code, notes, and snippets.

module.exports = function(app){
var res = app.response;
res.flash = function(type, msg) {
res.cookie("floored-flash", "test");
}
res.flash.error = function(msg) {
res.flash("error", msg);
}
var kue = require('./kue');
var jobs = kue.createQueue();
var autoscale = require('./autoscale')(jobs);
exports.create = function(type, options, callback) {
// Make 'options' parameter optional
if (typeof options === "function") {
callback = options;
options = null;
}
grunt.registerTask('deploy:staging', function() {
var child = grunt.util.spawn({
cmd: 'ls',
args: ['-a']
}, function(err, result) {
console.log(err);
console.log(result);
});
});
var util = require('util');
var _ = require('underscore');
httpError('NotFound', 'Not Found', 404);
httpError('Server', 'There was an error', 500);
httpError('Unauthorized', 'You must log in to access this', 401);
httpError('Forbidden', 'You do not have permission to access this', 403);
httpError('BadRequest', 'There was an error with your input', 400);
function httpError(name, default_msg, status_code) {
var _ = require('underscore');
var obj = {
one_level_string: "1",
one_level_array: ["hey", "there"],
two_levels: {
a: "a",
b: "b",
c: ["ccc", "ddd"],
d: {
#!/usr/bin/env node
var Dissolve = require("dissolve");
var parser = Dissolve().loop(function(end) {
this.uint8("numHouses")
.tap(function() {
this.housesCount = 0;
})
.loop("houses", function(end) {