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
define_builder(Country) do |klass, overrides| | |
# set up some presets | |
canada = { :iso => 'CA', :name => 'CANADA', :printable_name => 'Canada', :iso3 => 'CAN', :numcode => '124'} | |
usa = { :iso => 'US', :name => 'UNITED STATES', :printable_name => 'United States', :iso3 => 'USA', :numcode => '840' } | |
uk = { :iso => 'GB', :name => 'UNITED KINGDOM', :printable_name => 'United Kingdom', :iso3 => 'GBR', :numcode => '826' } | |
zimbabwe = { :iso => 'ZW', :name => 'ZIMBABWE', :printable_name => 'Zimbabwe', :iso3 => 'ZWE', :numcode => '716' } | |
# set up the default | |
country_attributes = canada | |
# check for a preset | |
overrides.process(:preset) do |preset| |
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
document.observe("dom:loaded", function() { | |
tabs = new UpperTabs(); | |
}); | |
UpperTabs = Class.create({ | |
sticky: new Array, | |
current: new Array, | |
menus: new Array, | |
submenus: new Array, | |
timer: null, |
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
#!/bin/bash | |
# ec2-run-instances --key build --user-data-file ec2-userdata.sh --group default --group basic ami-ed46a784 | |
set -e -x | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update && apt-get upgrade -y | |
# ruby | |
wget http://rubyforge.org/frs/download.php/58679/ruby-enterprise_1.8.6-20090610_i386.deb |
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
class Charge < ActiveRecord::Base | |
CHARGE_TYPES = ["upload", "storage", "deposit"] | |
belongs_to :member | |
default_scope :order => "charges.updated_at DESC" | |
validates_presence_of :name, :unit_price, :quantity | |
validates_inclusion_of :charge_type, :in => CHARGE_TYPES | |
validates_inclusion_of :chargeable_type, :in => %w(Payment VideoUpload) | |
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
# Use Bundler (preferred) | |
begin | |
require File.expand_path('../../.bundle/environment', __FILE__) | |
rescue LoadError | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup | |
# To use 2.x style vendor/rails and RubyGems | |
# |
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
# Edit this Gemfile to bundle your application's dependencies. | |
source 'http://rubygems.org' | |
gem "rails", "2.3.7" | |
#gem "mysql" | |
gem "sqlite3-ruby", :require => "sqlite3" | |
gem "authlogic", '2.1.4' | |
gem "aws-s3", "0.6.2", :require => "aws/s3" |
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
# Don't change this file! | |
# Configure your app in config/environment.rb and config/environments/*.rb | |
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) | |
module Rails | |
class << self | |
def boot! | |
unless booted? | |
preinitialize |
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
class CreateRoles < ActiveRecord::Migration | |
def self.up | |
create_table :roles do |t| | |
t.string :name | |
t.string :role | |
t.timestamps | |
end | |
create_table :user_roles do |t| | |
t.references :user |
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
class TheatresController < ApplicationController | |
def index | |
@theatre = Theatre.all | |
end | |
def new | |
@theatre = Theatre.new(params[:theatre]) | |
end | |
def create |
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
<% | |
# _counter is defined only if we pass :collection to the partial | |
if defined?(blog_post_counter) | |
showing_individual_post = false | |
else | |
showing_individual_post = true | |
blog_post_counter = 0 | |
end | |
%> | |
<div id="blog_post_<%= blog_post.id %>" class="blog_post"> |
OlderNewer