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
init: function (done) { | |
// 1 | |
if (this.$session['user_id'] == null) { | |
return this.redirectTo('backend:sign:login'); | |
} | |
// 2 | |
this.$users.one(this.$session['user_id'], function (err, user) { | |
// 4 | |
if (!err) { | |
this.current_user = user; |
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
var darkside = require('darkside'); | |
var SignController = function (users) { | |
darkside.base(darkside.ViewController, this); | |
this.$users = users; | |
}; | |
require('util').inherits(SignController, darkside.ViewController); |
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
var darkside = require('darkside'); | |
var DashboardController = function (users) { | |
darkside.base(darkside.ViewController, this); | |
this.$users = users; | |
}; | |
require('util').inherits(DashboardController, darkside.ViewController); |
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
var assert = require('assert'); | |
function dump(actions, graph) { | |
console.log(); | |
actions.forEach(function (action) { | |
if (graph) { | |
switch (action[0]) { | |
case 'retain': | |
process.stdout.write(new Array(action[1] + 1).join('>') + ' | '); |
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
var area = document.getElementById('area'); | |
var buffer = []; | |
var position = 0; | |
var last_id = 1; | |
var socket = io.connect('http://localhost:5000'); | |
socket.on('operation', function (operation) { |
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
/** | |
* @constructor | |
*/ | |
function Injector() { | |
/** | |
* @type {!Object.<string, function(Injector=): !Object>} | |
*/ | |
this.factories = {}; |
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
Object.defineProperty(Function.prototype, 'initializing', { | |
value: false, | |
writable: true, | |
}); | |
Object.defineProperty(Function.prototype, '$super', { | |
value: function () { | |
throw new Error('The $super method is not available.'); | |
}, | |
writable: true, | |
}); |
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
var http = require('http'); | |
var gzip = require('http-gzip'); | |
var server = http.createServer(function (req, res) { | |
gzip(req, res); | |
res.writeHead(200, { | |
'content-type': 'text/plain' | |
}); | |
res.write('I am gonna be gzip encoded, dude!'); |
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
var stdout = process.stdout; | |
var info = console.info; | |
var warn = console.warn; | |
var error = console.error; | |
var DEFAULT = "\033[m"; | |
var BLUE = "\033[1;34m"; | |
var YELLOW = "\033[1;33m"; | |
var RED = "\033[1;31m"; |
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
goog.provide('Deferred'); | |
/** | |
* Handles deferred calls | |
* @constructor | |
*/ | |
var Deferred = function () { | |
this.pending_ = []; | |
this.completed = false; | |
this.status = null; |