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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
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
from twisted.internet import reactor | |
from autobahn.websocket import WebSocketClientFactory, \ | |
WebSocketClientProtocol, \ | |
connectWS | |
from twisted.internet import stdio | |
class MessageBasedHashClientProtocol(WebSocketClientProtocol): | |
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
Foo |
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 util = require('util'); | |
/** | |
* Generate a new class | |
* -------------------- | |
* | |
* - When attached to an existing class, generates a new class | |
* which inherits from the prototype of the existing class | |
* | |
* - Otherwise, generates a new, clean class. |
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
// Let's create a class with some abstract methods | |
var Animal = Class.extend({ | |
init: function() { | |
console.log('A new', this.name, 'is born!') | |
}, | |
talk: function() { | |
console.log('The', this.name, 'goes', this.action) |
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 util = require('util'); | |
// Let's create a class with some abstract methods | |
function Animal() { | |
console.log('A new', this.name, 'is born!') | |
} | |
Animal.prototype.talk = function() { |
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
'use strict'; | |
var _ = require('underscore'); | |
var data = {}; | |
var timing = require('./timing'); | |
console.log('generating'); | |
for (var i = 1; i < 100000; i++) { | |
data['item' + i.toString(10)] = i; | |
} |
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
'use strict'; | |
var _ = require('underscore'); | |
var data = {}; | |
var timing = require('./timing'); | |
console.log('generating'); | |
for (var i = 1; i < 100000; i++) { | |
data['item' + i.toString(10)] = i; | |
} |
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
q.makePromise.prototype.attachNodeStyleCallback = function(callback) { | |
if (!callback) | |
return this; | |
return this.then(function(result) { | |
callback(null, result); | |
return result; |
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 q = require('q'); | |
q.sequential = function(promises) { | |
var results = []; | |
return promises.reduce(function(aggregate, promise) { | |
return aggregate.then(function() { |
OlderNewer