Skip to content

Instantly share code, notes, and snippets.

@rickenharp
rickenharp / env.rb
Created September 24, 2012 08:05
Setting the locale in capybara with selenium-webdriver
Capybara.register_driver :selenium_de do |app|
require 'selenium/webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile['intl.accept_languages'] = "de"
Capybara::Selenium::Driver.new(app, :profile => profile)
end
Capybara.javascript_driver = :selenium_de
@rickenharp
rickenharp / textmate_ruby
Created May 6, 2011 12:16
better textmate_ruby wrapper for rvm
#!/usr/bin/env sh
source ~/.rvm/scripts/rvm
LOGFILE=/dev/null
exec 6>&1
exec > $LOGFILE
cd .
exec 1>&6 6>&-
exec ruby "$@"
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
class CreateCheckins < ActiveRecord::Migration
def self.up
create_table :checkins do |t|
t.string :name
t.point :latlon, :srid => 4326
t.timestamps
end
add_index :checkins, :latlon, :spatial => true
end
ANSI[:RESET] = "\001\e[0m\002"
ANSI[:BOLD] = "\001\e[1m\002"
ANSI[:UNDERLINE] = "\001\e[4m\002"
ANSI[:LGRAY] = "\001\e[0;37m\002"
ANSI[:GRAY] = "\001\e[1;30m\002"
ANSI[:RED] = "\001\e[31m\002"
ANSI[:GREEN] = "\001\e[32m\002"
ANSI[:YELLOW] = "\001\e[33m\002"
ANSI[:BLUE] = "\001\e[34m\002"
ANSI[:MAGENTA] = "\001\e[35m\002"
Here's my list of WoW AddOns. You may download, install and update
these at any time using WowMatrix at http://www.wowmatrix.com/
!BugGrabber - Grabs bugs for the bug sack.
!Swatter - Debugging tool for handling and displaying of error messages in a useful way.
Ace2 - AddOn development framework
Ace3 - AddOn development framework