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 |
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
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |
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
# needed to get spork/rspec running under snow leopard | |
# edit line 12 of rspec-1.2.8/lib/spec/runner/drb_command_line.rb | |
# was | |
# DRb.start_service("druby://localhost:0") | |
# should be | |
DRb.start_service("druby://127.0.0.1:0") | |
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
# 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 |
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
def index | |
@assets = current_account.assets.paginate :page => params[:page], :per_page => 10 | |
end | |
# How to spec this??? | |
before(:each) do | |
@account = Account.new | |
@assets = [Asset.new(:account => @account)] | |
end | |
it "should paginate the assets" |
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
class Liquid::Strainer | |
def is_haml?; false; end | |
def controller | |
@controller ||= @context.registers[:controller] | |
end | |
delegate :request, :to => :controller | |
delegate :params, :to => :request | |
end |
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
class VisitorStats | |
def initialize | |
@redis = Redis.new | |
end | |
# every time there's a hit, increment a counter for the | |
# day and week, and add the session id to a set of unique | |
# vistitors for the day/week | |
def hit(session_id) | |
today = Date.today |
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
/* Add this CSS to your store Styles section under CSS mode */ | |
/* http://www.storenvy.com/ */ | |
/* Photo Slider */ | |
.product_photo_slider { | |
background: #fff; /*: Product Slider Background :*/ | |
border: 5px solid #eaeaea; /*: Product Slider Border :*/ | |
color: #555; /*: Product Slider Product Description :*/ | |
display: block; | |
margin-left:8px; |