This is now an actual repo:
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
/** | |
* Module dependencies. | |
*/ | |
var fs = require('fs'); | |
var ogg = require('ogg'); | |
var lame = require('lame'); | |
var vorbis = require('vorbis'); |
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
/** | |
* Very simple Mealy style finite state machine relying on a nodejs event emitter. Absolutely not tested | |
* and contains absolutely no fancy feature. You can put multiple "from" and "to" states by separating | |
* them with a space. Putting no "from" or "to" amounts to setting them as "undefined", a supported state. | |
*/ | |
// Example: | |
/* | |
var fsm = new Fsm([ | |
{ name : 'wakingup' , from: 'sleeping' , to : 'awake' }, |
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
function git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/' | |
} | |
PS1=" λ \W\$(git_branch): " | |
PS2=" | " |
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
<!-- This should be served by your server --> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
var socket = io.connect('http://localhost'); | |
socket.on('news', function (data) { | |
console.log(data); | |
socket.emit('my other event', { my: 'data' }); | |
}); | |
</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
// This route can be used to complete the tutorial at: | |
// https://developer.mozilla.org/en/BrowserID/Quick_Setup | |
app.post('/api/login', function( req, res, next ) { | |
var options = { | |
host: 'browserid.org', | |
path: '/verify', | |
method: 'POST' | |
}; |