Skip to content

Instantly share code, notes, and snippets.

# See http://m.onkey.org/running-rails-performance-tests-on-real-data
# START : HAX HAX HAX
# Load Rails environment in 'test' mode
RAILS_ENV = "test"
require File.expand_path('../../config/environment', __FILE__)
# Re-establish db connection for 'performance' mode
silence_warnings { RAILS_ENV = "performance" }
ActiveRecord::Base.establish_connection
@nickL
nickL / spec_helper.rb
Created September 4, 2012 19:13
spec helper example w/ spork
require 'rubygems'
require 'spork'
require 'faker'
begin
require 'simplecov'
SimpleCov.start 'rails' do
add_filter "/rocket_pants/"
end
rescue LoadError => e
puts 'SimpleCov not available, skipping coverage...'
@nickL
nickL / .rvmrc
Created November 14, 2012 22:25
Project-Friendly RVMC
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
# Only full ruby name is supported here, for short names use:
# echo "rvm use 1.9.3" > .rvmrc
environment_id="ruby-1.9.3@App_Name"
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@nickL
nickL / domSelect.js
Last active December 17, 2015 08:19
domSelect.js -- (super-light jquery like dom selection)
window.$ = function(a) {
var b, c;
b = {
"#": "getElementById",
".": "getElementsByClassName",
"@": "getElementsByName",
"=": "getElementsByTagName",
"*": "querySelectorAll"
};
c = /[=#@.*]/.exec(a)[0];
@nickL
nickL / help.coffee
Last active August 29, 2015 14:06 — forked from robertwalsh0/help.coffee
#Trying to figure out how to get protractor working
# My first test is simple. Visit the page and see if this thing is on the page
# That test works fine.
# The second test is clicking a button and waiting to see if errors appear
# No matter what I try that I find on the net I can't get it to work. Help?
beforeEach ->
# the following command allows us to
# use protractor with our non-angular application