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
#!/usr/bin/env node | |
var nom = require('nom'), | |
join = require('path').join, | |
args = process.argv.slice(2); | |
if(!args[0]) { | |
console.log('Usage: read <url>'); | |
process.exit(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
app.engine('mu', function(path, options, fn) { | |
var views = app.get('views'), | |
view = path; | |
if(options.layout) { | |
view = join(views, '..', options.layout); | |
options.body = fs.readFileSync(path, 'utf8'); | |
} | |
cons.hogan(view, options, function(err, str) { |
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
app.engine('mu', function(path, options, fn) { | |
var views = app.get('views'), | |
view = path; | |
if(options.layout) { | |
// Assumes layouts and views are at same level | |
view = join(views, '..', options.layout); | |
options.body = fs.readFileSync(path, 'utf8'); | |
} |
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 express = require('express'), | |
cons = require('consolidate'), | |
port = process.argv[2] || 8080, | |
app = express(); | |
app.engine('html', cons.hogan); | |
app.set('view engine', 'html'); | |
app.set('views', __dirname); | |
app.configure(function() { |
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
/** | |
* toggle between n functions | |
* | |
* Example: | |
* | |
* var a = function(p) { console.log("a:", p); }; | |
* var b = function(p) { console.log("b:", p); }; | |
* | |
* var func = toggle(a, b); | |
* func('hi') // => "a: hi" |
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
/** | |
* Module Dependencies | |
*/ | |
var relative = require('path').relative | |
/** | |
* Action | |
*/ |
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
/** | |
* Written by Jonathan Bolster | |
* Blog Post: http://bolsterweb.com/2011/10/how-clean-is-your-window-object/ | |
*/ | |
(function(window){ | |
var keys = {}, | |
cleanWindow, | |
iframe = document.createElement("iframe"); | |
iframe.style.display ="none"; |
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 __bind(fn, context) { | |
return function() { | |
return fn.apply(context, arguments); | |
}; | |
} |
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 express = require('express'), | |
app = module.exports = express(); | |
app.use('/a', express.vhost('*', require('./a'))); | |
app.use('/b', express.vhost('*', require('./b'))); | |
app.listen(8080); |
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 Debug = require('redux-debug') | |
var debug = require('debug') | |
var assign = require('object-assign') | |
var thunk = require('redux-thunk') | |
var Redux = require('redux') | |
function store_enhancer (options) { | |
return function (next) { | |
return function (reducer, initial_state) { |