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
    
  
  
    
  | =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') | 
  
    
      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
    
  
  
    
  | # Usage | |
| # DJ config | |
| require Rails.root.join('lib', 'dj_plugin.rb') | |
| Delayed::Worker.plugins << Delayed::Plugins::EmailNotify | |
| # lib/dj_plugin.rb | |
| require 'exception_notification' | 
  
    
      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
    
  
  
    
  | # NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
| $ cd /usr/src | |
| $ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
| $ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
| $ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
| $ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
| $ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz | 
  
    
      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
    
  
  
    
  | ## in controller | |
| # skip verify_authenticity_token when data from another server | |
| skip_before_filter :verify_authenticity_token, :only => [:restore] | |
| def restore | |
| restore_session_from(params[:session_id]) | |
| redirect_to '/' | |
| end | |
| ## ApplicationController | 
  
    
      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
    
  
  
    
  | #put in lib/tasks/fixtures.rake | |
| namespace :db do | |
| namespace :fixtures do | |
| desc 'Create YAML test fixtures from data in an existing database. | |
| Defaults to development database. Set RAILS_ENV to override.' | |
| task :dump => :environment do | |
| sql = "SELECT * FROM %s" | |
| skip_tables = ["schema_migrations"] | |
| ActiveRecord::Base.establish_connection(:development) | |
| (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| | 
  
    
      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
    
  
  
    
  | require 'uri' | |
| require 'net/http' | |
| class Chunked | |
| def initialize(data, chunk_size) | |
| @size = chunk_size | |
| if data.respond_to? :read | |
| @file = data | |
| end | |
| end | 
  
    
      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
    
  
  
    
  | sudo apt-get install apache2 php5 php5-mysql libapache2-mod-php5 | |
| # copy wordpress to /var/www | |
| # OPTINAL: change apache user | |
| # sudo gedit /etc/apache2/envvars | |
| # change next: | |
| # export APACHE_RUN_USER=your_user | |
| # export APACHE_RUN_GROUP=your_gpoup | |
| sudo gedit /etc/php5/apache2/php.ini | 
  
    
      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
    
  
  
    
  | require 'uri' | |
| require 'net/http' | |
| class Chunked | |
| def initialize(data, chunk_size) | |
| @size = chunk_size | |
| if data.respond_to? :read | |
| @file = data | |
| end | |
| end | 
  
    
      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
    
  
  
    
  | PATH_TO_RAILS_APP/log/*.log { | |
| daily | |
| missingok | |
| rotate 30 | |
| dateext | |
| compress | |
| delaycompress | |
| notifempty | |
| copytruncate | |
| } | 
NewerOlder