Skip to content

Instantly share code, notes, and snippets.

View brandonzylstra's full-sized avatar
🛤️
Riding the Rails

Brandon Zylstra brandonzylstra

🛤️
Riding the Rails
  • UC Berkeley
  • the tubes
View GitHub Profile
#!/bin/bash
###########################################################
# TRIBUNE-SPECIFIC BUILD HOME script:
# This script sets up your home directory fast with basic
# necessities and amenities, to give you sanity when you
# work on a Unix box where you don't have root access.
###########################################################
# TO USE:
# curl https://raw.github.com/gist/259348/build_home.sh | bash
# OR:
def date_to_epoch(date, offset)
Time.local(date.year, date.month, date.day + offset).to_i
end
# example:
# departure_date = Date.today
# days_until_return = 1
# puts date_to_epoch(departure_date, days_until_return)
#!/bin/zsh
mkdir -p /tmp/gist
cd /tmp/gist
curl http://github.com/defunkt/gist/raw/master/gist.rb > gist
chmod 755 gist
sudo mv gist /usr/local/bin/gist
echo "Command-line Gist is now installed"
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi
# Action php5-cgi /cgi-bin/php5-cgi
# AddHandler php5-cgi .php
############################################
## GoDaddy specific options
@brandonzylstra
brandonzylstra / script-generate.bash
Created February 5, 2009 04:45
Never forget to run your migrations again
# add this to your .bash_profile or your .zshrc or whatever
# then use sg (or your preferred abbreviation) instead of script/generate
# and never forget to run migrations again
function sg() {
script/generate $@
echo "Would you like to run the migrations right now?"
read CHOICE
if [ "$CHOICE" = "y" ] || [ "$CHOICE" = "yes" ]
then
echo "rake db:migrate" && rake db:migrate