Skip to content

Instantly share code, notes, and snippets.

View BDQ's full-sized avatar
💥

Brian Quinn BDQ

💥
View GitHub Profile
@BDQ
BDQ / gist:1321842
Created October 28, 2011 08:05
Deface DSL
surround :body, :for => 'layouts/spree_application', :name => 'wrap_body' do
%Q{<div class="wrapper">
<div class="w1">
<div class="w2">
<div class="w3">
<div class="main">
<div id="header">
<h1><a href="http://depts.washington.edu/uwc4c/">University of Washington Center for Commercialization</a></h1><a href="http://www.washington.edu/" class="ad-w">UW</a>
</div>
<%= render_original %>
@BDQ
BDQ / Gemfile
Created October 28, 2011 07:40
gem 'deface', :git => 'git://github.com/railsdog/deface.git', :ref => '881e6d09f292a58d929abc19feac5ef2f8d87b70'
describe "States" do
before(:each) do
visit admin_path
click_link "Configuration"
end
context "admin visiting states listing" do
it "should correctly display the states" do
Factory(:state, :name => "Maryland", :abbr => "MD", :country => Factory(:country))
@BDQ
BDQ / gist:1300654
Created October 20, 2011 08:16
Apartment Test output
bqimac:apartment[master]$ bundle exec rake spec
(in /Users/briandquinn/Development/apartment)
/Users/briandquinn/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec rspec spec/adapters/mysql_adapter_spec.rb spec/adapters/postgresql_adapter_spec.rb spec/apartment_spec.rb spec/integration/apartment_rake_integration_spec.rb spec/integration/database_integration_spec.rb spec/integration/delayed_job_integration_spec.rb spec/integration/middleware/subdomain_elevator_spec.rb spec/tasks/apartment_rake_spec.rb spec/unit/config_spec.rb spec/unit/middleware/subdomain_elevator_spec.rb spec/unit/migrator_spec.rb spec/unit/reloader_spec.rb
/Users/briandquinn/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
Apartment::Adapters::MysqlAdapter
using databases
#create
DEPRECATION WARNING: Arel::Visitors::VISITORS is deprecated and will be removed. Database adapters should define a visitor_for method which returns the appropriate visitor for the
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
#longest actions (total)
grep "Completed 200 OK in" log/production.log | cut -d' ' -f 5 | grep '[0-9.]*' -o | sort -n
#longest actions (view)
# grep "Completed 200 OK in" log/production.log | cut -d' ' -f 7 | grep '[0-9.]*' -o | sort -n
# longest actions (database)
echo "test is a test"
echo $?
require 'rubygems'
require 'deface'
html = %q{<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]> <html lang="<%= ::I18n.locale %>" class="no-js"> <![endif]-->}
Deface::Override.new(:virtual_path => "layouts/admin",
:name => "promo_admin_tabs",
:insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
:text => "<%= tab(:promotions) %>",
:disabled => false)
@BDQ
BDQ / Gemfile
Created August 26, 2011 07:39
Spree edge Rails 3.1.0rc6
source 'http://rubygems.org'
gem 'rails', '3.1.0.rc6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'json'