This file contains hidden or 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
postcodes = FasterCSV.read(data_source_for("postcodes.csv")) | |
postcodes.each do |(post_code, name, state_name, _, _, _, _, _, _, category)| | |
if category.squish == "Delivery Area" | |
post_code = sprintf("%04d", post_code.to_i) | |
state = State.find_or_create_by_name(state_name) | |
Locality.create(:post_code => post_code, :name => name, :state => state) | |
end | |
end |
This file contains hidden or 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
# Monitor HTTP requests being made from your machine with a one-liner.. | |
# Replace "en1" below with your network interface's name (usually en0 or en1) | |
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" | |
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile: | |
# (again replace "en1" with correct network interface name) | |
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"" | |
# All the above tested only on OS X. |
This file contains hidden or 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
# Get your commit hash from git log | |
git revert b899e585972342c4c33426535c30722f1f1ca14c | |
# Commit message if required (defaults to Created commit abe8722: Revert "YOur message") | |
git pull | |
git push | |
# Win. |
This file contains hidden or 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 ruby | |
# Open a new tab in Terminal | |
# usage: tab [cmd] | |
# If cmd is specified, it will be run in new tab while old tab is reactivated. | |
# If no cmd, new tab is activated | |
require "rubygems" | |
require "appscript" | |
include Appscript | |
window = app("Terminal").windows.first |
NewerOlder