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 sio = require('socket.io'); | |
var fn = function () {}; | |
var http = require('http'); | |
module.exports = function (compound) { | |
var app = compound.app; | |
var server = http.createServer(app); | |
compound.server = server; | |
var io = compound.io = sio.listen(server); |
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 Controller = require('base_controller'); | |
var Application = module.exports = Controller.extend(function Application(init) { | |
init.before(function protectFromForgeryHook(ctl) { | |
ctl.protectFromForgery('13cf581adb4cd3c1cccce3604a6c044215f21679'); | |
}); | |
}); |
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 Application = require('./application') | |
, User = compound.models.User; | |
var UserController = module.exports = function UserController(init) { | |
Application.call(this, init); | |
init.before(loadUser, { | |
only: ['show', 'edit', 'update', 'destroy'] | |
}); | |
}; |
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
<html> | |
<head> | |
</head> | |
<body> | |
lat:<input type="text" name="lat" value="45.52578"><br> | |
lon:<input type="text" name="lon" value="-122.683672"><br> | |
<img src=""> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
<script type="text/javascript"> |
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 to_bytes(str) { | |
var arr = [] | |
, byte_count | |
, padding | |
, binary | |
, prefix | |
, bytes | |
, code | |
for(var i = 0, len = str.length; i < len; ++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
function request(method, path, body, headers, ready) { | |
var xhr = new XMLHttpRequest | |
, zone | |
if(typeof headers === 'function') { | |
ready = headers | |
headers = {} | |
} else if(typeof body === 'function') { | |
ready = body | |
body = null |
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
#!/bin/sh | |
# | |
# Simply prepends the branch name to every commit message | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
if [ $branch != 'master' ] && [ $branch != 'HEAD' ]; then | |
echo "[$branch] `cat $1`" > $1 | |
fi |
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
diff --git a/lib/filters/add.js b/lib/filters/add.js | |
index 44d3f99..2c22e8a 100644 | |
--- a/lib/filters/add.js | |
+++ b/lib/filters/add.js | |
@@ -1,12 +1,21 @@ | |
var through = require('through') | |
-module.exports = function(num) { | |
- console.log(num) | |
- num = +num |
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
{ | |
"_id": "altr", | |
"_rev": "13-51f35b7d481978efdd85d1e3737f4d0f", | |
"name": "altr", | |
"description": "README.md", | |
"dist-tags": { | |
"latest": "0.0.6" | |
}, | |
"versions": { | |
"0.0.0": { |
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 cls = require('continuation-local-storage') | |
, concat = require('concat-stream') | |
, http = require('http') | |
var foo = cls.createNamespace('foo') | |
http.createServer(foo.bind(function(req, res) { | |
req.pipe(concat(done)) | |
function done() { |
OlderNewer