Skip to content

Instantly share code, notes, and snippets.

ErrorDocument 503 /system/maintenance.html
RewriteCond %{REQUEST_URI} !.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ - [redirect=503,last]
# an example of composition using value classes
class Person < ActiveRecord::Base
# "gender" (string) column will use Gender value class
# to represent it instead of string
composed_of :gender
end
gem 'ruby-debug', :group => [:test, :cucumber, :development]
gem 'email_spec', :group => [:test, :cucumber], :require => 'email_spec'
group :test do
gem 'rspec-rails', '>= 1.3.2'
end
group :cucumber do
gem 'cucumber-rails', '>=0.3.1'
gem 'database_cleaner', '>=0.5.0'
Given %r`a guest(?: user)? named "([^\"]+)" for the "([^\"]+)" store$` do |login, uri|
store = Store.find_by_slug!(uri)
User.make(:guest, :login => login, :store => store)
end
Given %r`not logged in$` do
s = UserSession.destroy
end
Given %r`(?:log|am logged) in as "([^\"]+)"$` do |login|
# https://rspec.lighthouseapp.com/projects/16211/tickets/305
require 'singleton'
module NegativeExpectationsHelper
class State
include Singleton
def is_negative?
@negative === true
# https://rails.lighthouseapp.com/projects/8994/tickets/4743-session-cookie-breaks-if-used-with-custom-cookie-in-rails-238
# http://gist.github.com/431811
if Rails.version == '2.3.8'
class RackRailsCookieHeaderHack
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
$global-reset-applied: false;
@mixin global-reset {
$global-reset-applied: true !global;
}
@avit
avit / config.rb
Created September 17, 2010 17:51
# Require any additional compass plugins here.
load 'compass-layouts'
# Set this to the root of your project when deployed:
http_path = ""
sass_dir = "src"
css_dir = "public/stylesheets"
images_dir = "public/images"
javascripts_dir = "public/javascripts"
http_stylesheets_path = "stylesheets"
http_images_path = "images"
// Align text baselines for blocks with different font sizes, so both elements have the same height.
//
// Suitable for aligning single-line elements while keeping the same height.
//
// Block elements with different font-sizes and the same line-height have
// their middles aligned vertically instead of the same baseline. Use this
// to make floated or inline-block elements align on the same baseline.
//
// This mixin should be used on the smaller font-size element to align its
// baseline to the larger text element's line-height.
// Gets called whenever an en event is fired
Handle = function(ev){
// Step 1: Event setup
var elements = [],
target = ev.target,
isPropagationStopped = false,
isDefaultPrevented = false;
// We are on the Capture Phase to start with