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
Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger | |
======================================================================= | |
EC2 Setup | |
--------- | |
1 Launch New ec2 instance - ami-1634de7f | |
2 Create elastic IP [ELASTIC_IP] and associate it with instance | |
3 go to domain registrar DNS settings, @ and www to ELASTIC_IP | |
4 set the `:host` in `config/deploy.rb` to ELASTIC_IP |
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
# put this in an initializer | |
# a Rails 3.2 addendum for: http://accuser.cc/posts/1-rails-3-0-exception-handling | |
class MyShowExceptions | |
def initialize() | |
@@rescue_responses = Hash.new(:internal_server_error) | |
@@rescue_responses.update({ | |
'ActionController::RoutingError' => :not_found, | |
'AbstractController::ActionNotFound' => :not_found, | |
'ActiveRecord::RecordNotFound' => :not_found, |
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
/* | |
this.ajax({ | |
xhr: { | |
url: 'some/thing' | |
}, | |
events: { | |
done: 'somethingDone', | |
fail: { node: document, event: 'ajaxError' } | |
} |
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
# app/models/experience.rb | |
# | |
# == Schema Information | |
# | |
# Table name: experiences | |
# | |
# id :integer not null, primary key | |
# title :string | |
# description :text | |
# created_at :datetime not null |
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
#!/usr/bin/env ruby | |
require 'aws-sdk' | |
# | |
# This script requires you to have the following environment variables set: | |
# AWS_REGION="us-west-2" | |
# AWS_ACCESS_KEY_ID="<YOUR_KEY>" | |
# AWS_SECRET_ACCESS_KEY="<YOUR_SECRET_KEY>" | |
# |
OlderNewer