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
/* | |
Escape JSON | |
*/ | |
var escapeJSON = exports.escapeJSON = function(json) { | |
var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | |
var meta = { // table of character substitutions | |
'\b': '\\b', | |
'\t': '\\t', | |
'\n': '\\n', | |
'\f': '\\f', |
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
javascript:(function () {var script = document.createElement('script');script.setAttribute('src', 'https://raw.github.com/gist/3713207/$FILEPATH');document.body.appendChild(script);}()); |
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
## Get the process on a given port | |
function port() { | |
lsof -i ":${1:-80}" | |
} |
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
<snippet> | |
<content><![CDATA[ | |
<html> | |
<head> | |
<title>${1} component</title> | |
<link rel="stylesheet" href="../build/build.css"> | |
</head> | |
<body> | |
<h1>$1 component</h1> | |
<script src="../build/build.js" type="text/javascript"></script> |
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
property i : 1 | |
set apps to {"Google Chrome Canary", "Sublime Text 2", "iTerm"} | |
set devapp to item i of apps | |
if appIsRunning(devapp) then | |
tell application devapp | |
activate | |
end tell | |
end if |
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
## filesize | |
# | |
# Usage: | |
# | |
# filesize blah.js file.txt | |
# | |
# 12K blah.js | |
# 10K file.txt | |
# |
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 command = require('./'); | |
command() | |
.run('touch lol.js') | |
.run('echo "hi" > lol.js') | |
.end(function(err) { | |
console.log(err); | |
}); |
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
Tue, 29 Jan 2013 01:47:32 GMT component:builder hook into "before styles" | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder hook into "before scripts" | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder building . | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder building . scripts | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder reading /Users/Matt/Projects/wordsmith/component.json | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder reading /Users/Matt/Projects/wordsmith/component.json | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder building . styles | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder reading /Users/Matt/Projects/wordsmith/component.json | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder build asset images | |
Tue, 29 Jan 2013 01:47:32 GMT component:builder reading /Users/Matt/Projects/wordsmith/component.json |
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
Sync.prototype.sync = function(fn) { | |
var self = this, | |
batch = new Batch, | |
tag = this.tag; | |
Note.all(function(err, notes) { | |
notes = notes.select(function(note) { return ~note.tags.indexOf(tag); }) | |
if(!notes.length) return fn(); | |
notes.each(function(note) { |