This file contains 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
#!/bin/sh | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
PRY_PATTERN="require.+[\'\"]pry[\'\"]|binding\.pry" | |
# Redirect output to stderr. | |
exec 1>&2 | |
if git diff --cached | grep '^\+' | grep -q -E $PRY_PATTERN; then | |
echo "ERROR: There is left over pry stuff in this commit" |
This file contains 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
module DealsHelper | |
def render_deals | |
Deal.all.collect do |deal| | |
content_tag :div, :class => 'deal' do | |
image_tag(deal.photo_url) | |
content_tag :h3, deal.title, :class => 'title' | |
content_tag :p, deal.full_price, :class => 'full_price' | |
content_tag :p, deal.selling_price, :class => 'selling_price' | |
content_tag :p, deal.discount, :class => 'discount' | |
content_tag :p, deal.store.name, :class => 'store_name' |
This file contains 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
# Template which configures a generic Rails app with Shoulda, Factory Girl, | |
# HAML, etc while commiting each step into git. | |
# | |
# Make sure you have Rails 2.3rc1 or greater installed and run: | |
# rails -d mysql -m http://gist.github.com/raw/57458/06345c42a92048e699af3140ccd28bbcd8915bc5/archfear.rb my_app | |
# Helper methods | |
def environment(data = nil, options = {}, &block) | |
options = { :sentinel => 'Rails::Initializer.run do |config|' }.merge(options) |
This file contains 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
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |