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
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
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
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
#!/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
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
!.*/(\.[^/]*|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
!.*/(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
# Mimic xsel simply for the benefit of X11 apps. | |
xsel() { | |
if [[ $@ == "-ib" ]]; then | |
command pbcopy; | |
elif [[ $@ == '-ob' ]]; then | |
command pbpaste; | |
else | |
command xsel "$@"; | |
fi | |
} |
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
tell application "System Events" | |
set frontmost_app to item 1 of (get name of processes whose frontmost is true) | |
end tell | |
tell application "Google Chrome" | |
activate | |
set i to 0 | |
repeat with t in (tabs of (first window)) | |
set i to i + 1 | |
if title of t is "Amazon Cloud Player" then |