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.exports = debounce | |
function debounce(fn, delay, at_start) { | |
var timeout | |
if(typeof delay === 'undefined') { | |
delay = 0 | |
} | |
return function() { |
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 document = require('dom-lite').document | |
, htmlparser = require('htmlparser2') | |
var el_proto = Object.getPrototypeOf(document.createElement('p')) | |
, node_proto = Object.getPrototypeOf(el_proto) | |
Object.defineProperty(el_proto, 'innerHTML', { | |
get: get_html | |
, set: set_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
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() { |
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
{ | |
"_id": "altr", | |
"_rev": "13-51f35b7d481978efdd85d1e3737f4d0f", | |
"name": "altr", | |
"description": "README.md", | |
"dist-tags": { | |
"latest": "0.0.6" | |
}, | |
"versions": { | |
"0.0.0": { |
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
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 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/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 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 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 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 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 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> | |
</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 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 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'] | |
}); | |
}; |