.----------------------------------------.
| write(data)-------->emit('data', data`)|
`----------------------------------------`
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
<canvas width=800 height=600></canvas> | |
<script> | |
var id | |
var mem = new Uint8ClampedArray(1024*1024 * 4) | |
function resize () { | |
canvas.width = window.innerWidth | |
canvas.height = window.innerHeight | |
id = new ImageData(mem.slice(0, canvas.width*canvas.height*4), canvas.width, canvas.height) |
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 http = require('http') | |
, httpProxy = require('http-proxy'); | |
httpProxy.createServer(function (req, res, proxy) { | |
// | |
// Put your custom server logic here | |
// | |
proxy.proxyRequest(req, res, { | |
host: 'localhost', | |
port: 9000 |
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 http = require('http'), | |
fs = require('fs'), // to load html/js templates | |
window = require("jsdom").jsdom().createWindow(), // DOM/BOM | |
jQuery = require('jquery'), // for selectors | |
$p = require('pure').$p//FIX | |
templates = {}; | |
http.createServer(function (req, res) { | |
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
//npm install http-proxy socket.io@0.6.17 | |
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 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') | |
function log (str) { | |
console.log('' + str) | |
} | |
http.get({host: 'localhost', port:6666, path: '/xhr'}, function (res) { | |
res.on('data', log) | |
res.on('end', log) |
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 convoy = require('convoy-stream'); | |
var split = require('event-stream').split | |
var through = require('through'); | |
var header = convoy(); | |
var h = header.createStream(); | |
h.write('beep\n'); | |
var _header = convoy() |
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
/* WebRTC consist of a few moving pieces | |
- A signal mechanism for peers | |
- A signal mechanism to send offers & answers | |
- A simplified peerConnection function | |
*/ | |
var uuid = require("node-uuid") | |
, assert = require("assert") |
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
<canvas width=800 height=600></canvas> | |
<script> | |
var id | |
var mem = new Uint8ClampedArray(1024*1024 * 4) | |
function resize () { | |
canvas.width = window.innerWidth | |
canvas.height = window.innerHeight | |
id = new ImageData(mem.slice(0, canvas.width*canvas.height*4), canvas.width, canvas.height) |
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
require 'rubygems' | |
require 'sinatra/base' | |
class Hello < Sinatra::Base | |
get '/' do | |
"hello world" | |
end | |
end |