Skip to content

Instantly share code, notes, and snippets.

View ahawthorne's full-sized avatar

Andrew Hawthorne ahawthorne

View GitHub Profile
@ahawthorne
ahawthorne / views.php
Created March 9, 2012 03:36
Drupal 6 views 2.16 fix
#!/usr/bin/env php
<?php
// set some server variables so Drupal doesn't freak out
$_SERVER['SCRIPT_NAME'] = '/views';
$_SERVER['SCRIPT_FILENAME'] = '/views';
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['REQUEST_METHOD'] = 'POST';
@ahawthorne
ahawthorne / build_redirect.sh
Created February 21, 2012 19:55
Build RerwiteRules from CSV
#!/bin/bash
# Pass in a csv file from STDIN as follows. No spaces.
#
# pattern,substitution
# pattern,substitution
if ! [ -t 0 ]; then
STDIN=`cat /dev/stdin`
fi
@ahawthorne
ahawthorne / .bash_profile
Created January 27, 2012 23:18
OSX ssh-agent forwarding -> .bash_profile
#####################
# ssh-agent stuff #
#####################
# get the ssh agent started
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
@ahawthorne
ahawthorne / .rvmrc
Created July 14, 2011 17:21
setup function for ~/.rvmrc
# This function will pull an .rvmrc from a gist and place it in a directory
# Add this function to /home/username/.rvmrc
#
# usage: setup_rvmrc gemset /path/to/application/
# example setup_rvmrc 1.9.2@app /var/www/app/
#
# NOTE: The trailing slash on the path is important.
function setup_rvmrc() {
_REPO="git://gist.github.com/1080580.git"
@ahawthorne
ahawthorne / .rvmrc
Created July 13, 2011 15:49
more useful .rvmrc
# enter your gemset below
rvm ruby-1.9.2-p180@eyd
# no need to edit below here
alias rails="bundle exec rails"
alias specjour="bundle exec specjour"
alias rspec="bundle exec rspec"
alias rake="bundle exec rake"
_VIM=$(which vim)