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
!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$ |
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
https://gist.github.com/941137 |
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 | |
# Remove all the mysql 5.1.56 commands from your Homebrew installation. | |
ls -aFl $(brew --prefix)/bin/mysql* | grep 56 | awk {'print $9'} | tr -d '@' | xargs rm |
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
varnishlog -x 'CLI' -x 'WorkThread' -x 'Debug' -o TxURL '^/esi/block/' |
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
OLD_CFG=`varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.list" | grep active | awk '{print $3}'` | |
NEW_CFG="vcl-"`date +%s` | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.load $NEW_CFG /etc/varnish/default.vcl" | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.use $NEW_CFG" | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.discard $OLD_CFG" | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "purge req.url ~ .*" |
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
def verify(a:String) = {(10 - a.reverse.tail.zip(Stream.continually(List(2, 1)).flatten).foldLeft(0)((sum, vals) => sum + (vals._1.toString.toInt * vals._2).toString.toList.foldLeft(0)(_+_.toString.toInt)) % 10).toString.last.toString.toInt == a.last.toString.toInt} |
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 | |
# Variables definitions | |
DBNAME="tony_local_test" | |
MYSQL_COMMON="-uroot -D$DBNAME" | |
SQL_QUERY="SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$DBNAME' AND ENGINE='MyISAM';" | |
ALTER_TABLE_QUERY="" | |
# Build up one giant SQL string. | |
for i in `mysql $MYSQL_COMMON --skip-column-names -s -e "$SQL_QUERY"`; do |
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 sys = require("sys"), | |
http = require("http"), | |
growl = require("./node-growl/lib/growl"), | |
child_process = require("child_process"); | |
function createClient() { | |
var i = http.createClient(80, website); | |
// Handle a connection error. | |
// Thanks to http://rentzsch.tumblr.com/post/664884799/node-js-handling-refused-http-client-connections. |
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 | |
date=`date "+%Y-%m-%d"` | |
for i in /Applications/MAMP/db/mysql/*/; do | |
dbname=`basename $i` | |
/Applications/MAMP/Library/bin/mysqldump -uroot $dbname > ~/hdd-smerrill/Documents/Backups/$dbname-$date.sql | |
done |
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
sub vcl_deliver { | |
if (obj.hits > 0) { | |
set resp.http.X-Cache = "HIT"; | |
} else { | |
set resp.http.X-Cache = "MISS"; | |
} | |
return (deliver); | |
} |