Skip to content

Instantly share code, notes, and snippets.

View benzittlau's full-sized avatar

Ben Zittlau benzittlau

View GitHub Profile
@benzittlau
benzittlau / Add gitolite repo
Created September 15, 2011 17:48
Adding repo to gitolite
Ben-Zittlaus-MacBook-Pro:bs_migrate bzittlau$ git remote add origin gitolite:bs_migrate
Ben-Zittlaus-MacBook-Pro:bs_migrate bzittlau$ git push origin master
@benzittlau
benzittlau / cachereset
Created September 3, 2011 19:04
Reset cache on a mac
sudo dscacheutil -flushcache
@benzittlau
benzittlau / cucumber require
Created September 2, 2011 20:55
Running cucumbers in nested subfolders
cucumber -r features features/components/partner_organizations/
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7-p330 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
@benzittlau
benzittlau / nginx
Created July 21, 2011 02:59
NGINX /etc/init.d file
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@benzittlau
benzittlau / .rdebugrc
Created June 22, 2011 20:58
Default rdebugrc file to make ruby debug somewhat less painful
set autolist
set autoeval
set autoreload
@benzittlau
benzittlau / monkey_patch.rb
Created June 2, 2011 19:39
Monkey patch for using default_url_options from the application controller in cucumber tests
#monkey patch to fix the fact that ActionDispatch::Integration::Session blows
#away the ApplicationController default_url_options which are necessary
#for the locale scope to work
module ActionDispatch
module Integration
class Session
def default_url_options
{ :host => host, :protocol => https? ? "https" : "http" }.merge!(ApplicationController.new.default_url_options)
end
end
@benzittlau
benzittlau / How to curl a failing ssl certificate
Created June 2, 2011 18:31
Curl insecurely (don't verify ssl cerficate)
curl -k https://rvm.beginrescueend.com/install/rvm
mongoid.attributes.user.email
@benzittlau
benzittlau / generate_june_data.rake
Created May 26, 2011 02:35
A quick rake task to manually create the garbage pickups for Edmonton in June 2011.
namespace :alertzy do
desc "Populate June 2011 data"
task :populate_june => :environment do
generate_june_data
end
end
def generate_june_data
mondays = [6,13,20,27]
tuesdays = [7,14,21,28]