This file contains 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 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 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 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 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 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 IndexController = function () { | |
darkside.base(this, darkside.ViewController); | |
}; | |
util.inherits(IndexController, darkside.ViewController); | |
This file contains 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 ApiController() { | |
Controller.call(this); | |
} | |
ApiController.prototype = Object.create(Controller.prototype); | |
ApiController.prototype.error = function (status, message) { | |
this.render(status, { 'error': message }); | |
}; |
This file contains 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
- (void)connect { | |
NSHost *host = [NSHost hostWithName:@"example.com"]; | |
// iStream and oStream are instance variables | |
[NSStream getStreamsToHost:host port:2000 inputStream:&iStream | |
outputStream:&oStream]; | |
[iStream retain]; | |
[oStream retain]; | |
[iStream setDelegate:self]; | |
[oStream setDelegate:self]; |
This file contains 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('VKontakte'); | |
goog.require('goog.crypt.Md5'); | |
VKontakte = function (user_id, app_id, app_secret) { | |
this.user_id_ = user_id; | |
this.app_id_ = app_id; | |
this.app_secret_ = app_secret; | |
}; |
This file contains 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
$a = function () { | |
echo 'x'; | |
}; | |
$a(); |