- Disable natural scrolling.
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
- Install Homebrew.
source ~/bin/fancy_prompt.sh | |
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"' | |
alias show-hidden='defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder' | |
alias hide-hidden='defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder' | |
alias flushdns='sudo discoveryutil udnsflushcaches' |
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt" | |
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png | |
# A big thanks to \amethyst on Freenode | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color | |
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color | |
fi | |
if tput setaf 1 &> /dev/null; then | |
tput sgr0 |
// vim: ft=javascript: | |
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */ | |
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */ | |
/* | |
* A script to automate requesting data from an external url that outputs CSV data. | |
* | |
* Adapted from the Google Analytics Report Automation (magic) script. | |
* @author nickski15@gmail.com (Nick Mihailovski) | |
* @author ianmlewis@gmail.com (Ian Lewis) | |
*/ |
function sign_s3(access_key, private_key, bucket, object_name, validity, base_url) { | |
if(!base_url) { | |
base_url = "http://s3.amazonaws.com"; | |
} | |
if(!validity) { | |
validity = 60; | |
} | |
expires = Math.floor((new Date()).getTime() / 1000) + validity; | |
object_name = encodeURIComponent(object_name); | |
stringToSign = "GET\n\n\n"+expires+"\n/"+bucket+"/"+object_name; |
I hereby claim:
To claim this, I am signing this object:
# The following script scrapes ESPN's MLB Standings Grid and writes the | |
# standings for each American League (AL) team to a CSV file, which has the following | |
# format: | |
# Team, Opponent, Wins, Losses | |
from bs4 import BeautifulSoup | |
import urllib2 | |
import re | |
import csv |
#!/bin/sh | |
# usage: mkramdisk 1024 ~/scratch | |
function mkramdisk() { | |
ramfs_size_mb=$1 | |
mount_point=$2 | |
ramfs_size_sectors=$((${ramfs_size_mb}*1024*1024/512)) | |
ramdisk_dev=`hdid -nomount ram://${ramfs_size_sectors}` | |
newfs_hfs -v 'ram disk' ${ramdisk_dev} |
module ActiveRecord | |
module RawValues | |
def values(options={}) | |
relation = self | |
select_values = options[:select] | |
flat_result = options[:flat] | |
relation.select_values = select_values if select_values |
javascript:(function(){ $('.profiler-results').toggle(); })(); |