Skip to content

Instantly share code, notes, and snippets.

View bigfleet's full-sized avatar

Jim Van Fleet bigfleet

View GitHub Profile
@bigfleet
bigfleet / gist:81802
Created March 19, 2009 13:05 — forked from dhh/gist:29752
config.action_controller.asset_host = Proc.new do |source, request|
non_ssl_host = "http://asset#{source.hash % 4}.backpackit.com"
ssl_host = "https://asset1.backpackit.com"
if request.ssl?
case
when source =~ /\.js$/
ssl_host
when request.headers["USER_AGENT"] =~ /(Safari)/
non_ssl_host
[sudo] gem install term-ansicolor treetop diff-lcs nokogiri builder
[sudo] gem install rspec rspec-rails cucumber webrat
rails newproj
cd newproj
git clone git://github.com/aslakhellesoy/cucumber.git vendor/plugins/cucumber
git clone git://github.com/brynary/webrat.git vendor/plugins/webrat
ruby script/generate cucumber
ruby script/generate scaffold Frooble name:string color:string description:text
rake db:migrate
ruby script/generate feature Frooble name:string color:string description:text
blink:community bigfleet$ cucumber -p verbose
Ruby files required:
* features/support/env.rb
* features/support/paths.rb
* features/step_definitions/response_steps.rb
* features/plugins/steps/tradeking_recognia_steps.rb
* features/plugins/steps/tradeking_relish_steps.rb
* features/plugins/steps/tradeking_utils_steps.rb
* features/step_definitions/aasm_steps.rb
* features/step_definitions/activity_controller_steps.rb
@bigfleet
bigfleet / gist:122506
Created June 2, 2009 19:16 — forked from ohammersmith/gist:122489
DB per branch
<%= branch = `git symbolic-ref HEAD`.gsub('refs/heads/', '').chomp.gsub('/', '_') %>
login: &login
adapter: mysql
username: root
password: xxxxxxxxxxxxxx
host: localhost
socket: /opt/local/var/run/mysql5/mysqld.sock
development:
@bigfleet
bigfleet / config
Created June 9, 2009 22:24 — forked from jtimberman/config
EC2 .ssh/config entries
Host ec2*compute-1.amazonaws.com
User some_user
StrictHostKeyChecking no
Host my_chef_instance
User some_user
Hostname ec2-xx-xx-xx-xx.compute-1.amazonaws.com
StrictHostKeyChecking no
LocalForward 8443 localhost:443
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
#
# Put this in your .bashrc or whatever.
pathed_cd () {
if [ "$1" == "" ]; then
cd
else
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
We couldn’t find that file to show.
$ ack \(Given\|When\|Then\) features/step_definitions
features/step_definitions/admin_steps.rb
3:Given /^I signed up as an admin with "(.*)\/(.*)"$/ do |email, password|
10:Given /^I signed up as an admin who cannot publish deals with "(.*)\/(.*)"$/ do |email, password|
20:Then /^I should see the admin index page$/ do
24:Then /^I should see a user named "(.*)"$/ do |name|
features/step_definitions/clearance_steps.rb
3:Then /^I should see error messages$/ do
@bigfleet
bigfleet / packer.erl
Created September 16, 2009 02:02 — forked from kevsmith/packer.erl
-module(packer).
-export([pack/1, test/0]).
pack(Data) ->
pack(Data, []).
test() ->
[[a, a, a], [b, b, b]] = packer:pack([a,a,a,b,b,b]),
[[a,a,a,a], [b], [c, c], [a, a], [d], [e, e, e, e]] = packer:pack([a,a,a,a,b,c,c,a,a,d,e,e,e,e]),