This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://rspec.lighthouseapp.com/projects/16211/tickets/305 | |
require 'singleton' | |
module NegativeExpectationsHelper | |
class State | |
include Singleton | |
def is_negative? | |
@negative === true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$global-reset-applied: false; | |
@mixin global-reset { | |
$global-reset-applied: true !global; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |