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
# Disable gesture navigation only in Chrome | |
# http://apple.stackexchange.com/a/80163/53921 | |
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE | |
# Make Finder display "hidden" files and folders | |
# like ~/.ssh | |
defaults write com.apple.finder AppleShowAllFiles TRUE | |
# Apache in Mountain Lion | |
# http://reviews.cnet.com/8301-13727_7-57481978-263/how-to-enable-web-sharing-in-os-x-mountain-lion/ |
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
this.on('change', function () { | |
changes.push(this.previousAttributes()); | |
}); | |
undo: function () { | |
undone.push(this.toJSON()); | |
this.set(changes.pop()); | |
}; | |
redo: 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
var slug = require('slug'); | |
console.log(slug('Ȁ ȁ Ȃ ȃ Ȅ ȅ Ȇ ȇ Ȉ ȉ Ȋ ȋ Ȍ ȍ Ȏ ȏ Ȑ ȑ Ȓ ȓ Ȕ ȕ Ȗ')); | |
// '' |
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 | |
# | |
# To enable this hook, link or rename this file to "pre-commit". | |
# If you save it in your ~bin/ directory as "check" and link it as "pre-commit," | |
# you can easily run it manually from a dirty wc in addition to running as hook | |
STATUS=0 | |
SELF=`basename $0` | |
CACHED="" |
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 FeedParser = require('feedparser') | |
, request = require('request') | |
, STATUS_CODES = require('http').STATUS_CODES; | |
module.exports = function (feed, cb) { | |
var parser = new FeedParser(); | |
var req = request(feed); | |
var items = []; | |
var _called = false; |
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
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"not": { | |
"bool": { | |
"must": { |
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 feed = 'http://somefeed.com/rss' | |
var req = request(feed) | |
req.on('response', function (response) { | |
if (sometest(feed)) { | |
req.pipe(iconv).pipe(parser) | |
} | |
else { | |
req.pipe(parser) | |
} | |
}) |
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
[dan@Dans-MacBook-Pro code]$ node | |
> var code = 'function printer (val) { return val; }; var result = printer(a); console.log(result);' | |
undefined | |
> eval(code) | |
ReferenceError: a is not defined | |
at eval (eval at <anonymous> (repl:1:7), <anonymous>:1:62) | |
at repl:1:2 | |
at REPLServer.self.eval (repl.js:110:21) | |
at Interface.<anonymous> (repl.js:239:12) | |
at Interface.EventEmitter.emit (events.js:95:17) |
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/bash | |
if [ $# -ne 3 ] | |
then | |
echo "Usage: `basename $0` remote remote-port local-port" | |
exit 1 | |
fi | |
ssh -N -R $2:localhost:$3 $1 |
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/bash | |
if [ $# -ne 3 ] | |
then | |
echo "Usage: `basename $0` remote remote-port local-port" | |
exit 1 | |
fi | |
ssh -N -L $3:localhost:$2 $1 |