Skip to content

Instantly share code, notes, and snippets.

View benzittlau's full-sized avatar

Ben Zittlau benzittlau

View GitHub Profile
@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
@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 / .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 / 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
~$ 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 / cucumber require
Created September 2, 2011 20:55
Running cucumbers in nested subfolders
cucumber -r features features/components/partner_organizations/
@benzittlau
benzittlau / cachereset
Created September 3, 2011 19:04
Reset cache on a mac
sudo dscacheutil -flushcache
@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 / gist:1227704
Created September 19, 2011 21:45
Rails config settings for sending mail through gmail
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:domain => "whatever.com",
:authentication => :plain,
:user_name => "xxxxxx@whatever.com",
:password => "xxxxxxxxx",
:openssl_verify_mode => OpenSSL::SSL::VERIFY_NONE
}
@benzittlau
benzittlau / gist:1230560
Created September 20, 2011 22:09
Github file finder
Press "t" to active the file finder. It's amazing