Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)
- Some utilities:
sudo apt-get install vim tmux git curl- Copy/paste from the command line:
| // | |
| //Regions | |
| // | |
| var NoWrapRegion = Backbone.Marionette.Region.extend({ | |
| attachHtml: function (view) { | |
| this.el.innerHTML=""; | |
| var children = view.el.childNodes; | |
| while (children.length > 0) { | |
| this.el.appendChild(children[0]); |
| namespace :qc do | |
| desc "start queue classic" | |
| task :start do | |
| run "nohup sh #{current_path}/qc_worker start > /dev/null 2>&1 &" | |
| end | |
| desc "stop queue classic" | |
| task :stop do | |
| run "sh #{current_path}/qc_worker stop" | |
| end |
| # This is a bread crumb. It stores the URL, view | |
| # state, whatever. | |
| class BreadCrumb extends Model | |
| class BreadCrumbs extends Collection | |
| model: BreadCrumb | |
| # Views for displaying it | |
| class BreadCrumbView extends Marionette.ItemView | |
| template: 'breadcrum/templates/crumb' |
| #!/usr/bin/env bash | |
| # Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`. | |
| # Please modify the CONSTANT variables to fit your configurations. | |
| # The script will start with config set by $PUMA_CONFIG_FILE by default | |
| PUMA_CONFIG_FILE=config/puma.rb | |
| PUMA_PID_FILE=tmp/pids/puma.pid | |
| PUMA_SOCKET=tmp/sockets/puma.sock |
| ##Userable | |
| module Userable | |
| def self.included(base) | |
| base.has_one :user, :as => :userable, :dependent => :destroy, :autosave => true | |
| base.validate :user_must_be_valid | |
| base.alias_method_chain :user, :autobuild | |
| base.extend ClassMethods | |
| base.define_user_accessors | |
| end | |
sudo apt-get install vim tmux git curl| 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 |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |