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
<?php | |
// return host name from server for debugging purposes | |
header('X-App-Host: served from ' . php_uname('n')); |
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
for w in 320 640 960; | |
do webkit2png -Fs 1 -W $w -o $w$(date +%Y%m%d-%H%M%S) "http://mediaqueri.es"; | |
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
#!/usr/bin/expect | |
# set variables | |
set username [email protected] | |
set password changeme | |
set certificate_accept y | |
spawn mount -t davfs https://www.box.com/dav/ /mnt/box.net/ | |
# Look for username prompt | |
expect "username:" |
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
# 1. Install mplayer command line (via Brew, Macports, or APT) | |
# 2. Add the following aliases to ~/.profile | |
# 3. Type `source ~/.profile` | |
# 3. Type `news` or `current` to listen in your terminal | |
alias news="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" # MPR News | |
alias current="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/the_current.pls" # The Current | |
alias classical="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/classical.pls" # Classical MPR | |
alias localcurrent="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/local.pls" # Local Current | |
alias heartland="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/radio_heartland.pls" # MPR Radio Heartland |
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
# add .tpl for smarty files | |
--type-set=smarty=.tpl | |
--type-set=tpl=.tpl | |
# plain text CSV files | |
--type-set=csv=.txt,.csv,.tsv | |
# CSS/LESS | |
--type-set=css=.css,.less |
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
<?php | |
/** | |
* Scan the api path, recursively including all PHP files | |
* | |
* @param string $dir | |
* @param int $depth (optional) | |
*/ | |
protected function _require_all($dir, $depth=0) { | |
if ($depth > $this->max_scan_depth) { |
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
# Push changes from development branch into production | |
# Add to .git/config | |
[alias] | |
deploy = !sh -c 'git checkout master && git merge development && git checkout development && git push --all' |
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
# Local Dates: | |
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt | |
# ISO Dates: | |
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.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
# http://mesmor.com/2012/03/18/akamai-pragma-debug-headers/ | |
alias akacurl='curl -v -s -o /dev/null -H "accept-encoding: gzip" -H "Pragma: akamai-x-get-cache-key" -H "Pragma: akamai-x-cache-on" -H "Pragma: akamai-x-cache-remote-on" -H "Pragma: akamai-x-get-true-cache-key" '; | |
akacurl http://example.com/akamai-test-object.html; |
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 | |
GIT_WORK_TREE=/home/username/webapps/django/myproject git checkout -f | |
GIT_WORK_TREE=/home/username/webapps/django/myproject git reset --hard |