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
alias server='open http://localhost:8000 && python -m SimpleHTTPServer' |
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 | |
# | |
# Prerequisites: brew install mpg123 vorbis-tools | |
for fm in "$@"; do | |
f="${fm%.mp3}" | |
if [ "$f" != "$fm" ] && [ -a "$fm" ]; then | |
mpg123 -w - "$f.mp3" | oggenc -o "$f.ogg" - | |
fi | |
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
#!/bin/bash | |
# dependencies: | |
# sudo port install sox | |
TITLE="On the hour..." | |
MESSAGE="...where are you?" | |
SOUND="/System/Library/Sounds/Hero.aiff" | |
PLAY="/usr/bin/afplay" |
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 | |
# Prerequisites: | |
# sudo port install mpeg4ip | |
mp4creator -hint=1 "$1" | |
mp4creator -hint=2 "$1" | |
mp4creator -optimize "$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
#!/usr/bin/env python | |
# prerequisites | |
# sudo easy_install markdown | |
# install https://code.google.com/p/wkhtmltopdf/ | |
WKHTMLTOPDF_PATH = "/usr/local/bin/wkhtmltopdf" | |
import sys, os, subprocess, re, urllib, tempfile | |
import markdown |
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 | |
for file in $*; do | |
advpng -z1 "$file" && optipng -i0 -o7 "$file" && advpng -z4 "$file" | |
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
#!/bin/sh | |
for file in $*; do | |
jpegtran -optimize -progressive -copy none \ | |
"$file" > "$file.tran" | |
mv -f "$file".tran "$file" | |
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
sudo port install apache2 php5 php5-gd php5-curl php5-openssl php5-mbstring | |
# php5-gmp php5-iconv php5-mcrypt php5-posix | |
cd /opt/local/etc/php5 | |
sudo cp php.ini-development php.ini | |
# set mysql.default_socket, mysqli.default_socket and pdo_mysql.default_socket to /opt/local/var/run/mysql5/mysqld.sock | |
cd /opt/local/apache2/conf |
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 f in *.pdf; do | |
echo "Extracting first page of $f..." | |
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \ | |
-dFirstPage=1 -dLastPage=1 \ | |
-sOutputFile="${f}_first.pdf" \ | |
"$f" | |
done | |
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \ | |
-sOutputFile=Combined.pdf \ |
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/env rspec | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'rspec' | |
class Convert | |
MAPPING = { | |
# singles |
NewerOlder