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
if (!module.constructor.prototype.declare) { | |
module.constructor.prototype.declare = function(deps, factory) { | |
if (!factory) | |
factory = deps; | |
var _self = this; | |
var req = function(id) { | |
if (id.indexOf("./") == 0) | |
id = _self.filename.match(/(.*\/)/)[1] + id.slice(2) | |
return require(id); |
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
<html> | |
<head> | |
<script type="text/javascript" charset="utf-8"> | |
String.prototype.escapeHTML = function() { return this + ""; }; | |
console.log("OK", "<\\n>".toString()) | |
console.log("OK", new String("<\\n>").escapeHTML()) | |
console.log("fails", "<\\n>".escapeHTML()) | |
</script> |
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
<html> | |
<head> | |
<script src="socket.io.js"></script> | |
<script> | |
var logDiv; | |
function test() { | |
var socket = new io.Socket(null, { | |
rememberTransport : false, | |
transports : [ 'xhr-polling' ], |
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
XHRMultipart.prototype._get = function(){ | |
var self = this; | |
this._xhr = this._request('', 'GET', true); | |
- this._xhr.onreadystatechange = function(){ | |
- if (self._xhr.readyState == 3) self._onData(self._xhr.responseText); | |
- }; | |
+ if ("onload" in this._xhr) { | |
+ this._xhr.onload = function() { | |
+ self._onData(self._xhr.responseText); | |
+ } |
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
telefonmann:ace fjakobs$ node lib/ace/test/all.js | |
[4/1] test: toggle comment lines should not do anything OK | |
[4/2] test: lines should keep indentation OK | |
[4/3] test: new line after { should increase indent OK | |
[4/4] test: no indent increase after { in a comment OK | |
[5/1] test: tokenize pixel number OK | |
[5/2] test: tokenize hex3 color OK | |
[5/3] test: tokenize hex6 color OK | |
[5/4] test: tokenize parens OK | |
[5/5] test for last rule in ruleset to catch capturing group bugs OK |
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
//npm install http-proxy [email protected] | |
var server = require("http").createServer(function(req, res) { | |
res.writeHead(200, {"content-type": "text/html"}); | |
res.end("<html><body><script src='/socket.io/socket.io.js'></script>\ | |
<script>\ | |
var socket = new io.Socket(null, {transports: ['xhr-multipart']});\ | |
socket.connect();\ | |
</script></body></html>"); | |
}) |
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
<html> | |
<body> | |
JUHU | |
<script> | |
var req = new XMLHttpRequest(); | |
req.multipart = true; | |
req.open("GET", "/xhr"); | |
req.onload = function(){ | |
if (req.readyState == 4) |
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 architect = require("architect"); | |
var fs = require("fs"); | |
var path = require("path"); | |
var user = { | |
name: "fjakobs", | |
uid: 1 | |
}; | |
var project = { | |
name: "geekdots", |
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 tls = require("tls"); | |
var net = require("net"); | |
var fs = require("fs"); | |
var host = "c9.dev"; | |
tls.createServer({ | |
key: fs.readFileSync(__dirname + "/key.pem"), | |
cert: fs.readFileSync(__dirname + "/cert.pem") | |
}, function(client) { |
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
#!/bin/bash | |
# install rvm | |
curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby | |
source $HOME/.rvm/scripts/rvm | |
echo rvm_autolibs_flag=0 >> ~/.rvmrc | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> .bashrc | |
# install ruby | |
rvm install 2.0.0 |