Skip to content

Instantly share code, notes, and snippets.

View tessro's full-sized avatar

Tess Rosania tessro

View GitHub Profile
#!/bin/sh
# setup-xp.sh - Install and configure IE Application Compatibility images in VirtualBox
#
# Some parts from: http://www.peculier.com/blog/create-ie-vbox.html
## Prerequisites:
#
# - VirtualBox 4.0+
# - unrar (`brew install unrar`)
# - 7zip (`brew install 7zip`)
@tessro
tessro / crawl.sh
Created October 20, 2011 20:49
Given a list of Twitter handles (one per line), output a list of values for a given profile field
#!/bin/sh
function usage {
echo "usage: $0 source_file field"
exit 1
}
if [ ! $# -eq 2 ]; then
usage
elif [ ! -f $1 ]; then
@tessro
tessro / broken.m
Created October 21, 2011 18:36
BTW, this math is wrong
// Compress further via advpng on level 1 – 4.
// (level can normally range from 1 – 7)
levelStr = [NSString stringWithFormat:@"-z%d", (level < 5 ? 1 : level - 3)];
#!/bin/sh
## Packages:
# brew install pngcrush
# brew install optipng
# brew install advancemame
# brew install https://raw.github.com/adamv/homebrew-alt/23f9084410476da1fcaf946f24f4dde47fe888ea/non-free/pngout.rb
function usage {
echo "Usage: $0 infile outfile"
@tessro
tessro / pngbai
Created October 21, 2011 19:23
A badass command line PNG compressor
#!/bin/sh
## Packages:
# brew install pngcrush
# brew install optipng
# brew install advancecomp
# brew install https://raw.github.com/adamv/homebrew-alt/23f9084410476da1fcaf946f24f4dde47fe888ea/non-free/pngout.rb
function usage {
echo "Usage: $0 infile outfile"
code = %q{Nputs "code = %q{#{code}}"NNcode.chars.each do |c|N if c > 'M' && c < 'O'N putsN elseN print cN endNendNNputs}
puts "code = %q{#{code}}"
code.chars.each do |c|
if c > 'M' && c < 'O'
puts
else
print c
end
@tessro
tessro / gist:1515117
Created December 23, 2011 19:15 — forked from arnorhs/gist:1509904
gitopen - Open all files from a git diff or show command
#!/bin/bash
# This script will open all files from a git diff or a git show in vim.
# My bash skills are a bit primitive so this can probably be done more intelligently
# Usage:
# gitopen -- opens all added files that have changed since HEAD
# gitopen diff HEAD -- these are the default parameters
# gitopen diff master -- opens files that have changed from master
#!/bin/sh
# setup-xp.sh - Install and configure IE Application Compatibility images in VirtualBox
#
# Some parts from: http://www.peculier.com/blog/create-ie-vbox.html
## Prerequisites:
#
# - VirtualBox 4.0+
# - unrar (`brew install unrar`)
# - 7zip (`brew install 7zip`)
---
BUNDLE_DISABLE_SHARED_GEMS: "1"
---
BUNDLE_PATH: vendor/bundle
BUNDLE_BUILD__MYSQL: --with-mysql-config=/usr/local/mysql/bin/mysql_config