Blog post here
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
| puts "How many players?" | |
| players = gets.chomp.to_i | |
| puts "How many items?" | |
| items = gets.chomp.to_i | |
| (1..players).each do |i| | |
| puts "card #{i}" | |
| card = Array.new | |
| (1..5).each do |row| | |
| print " " | |
| (1..5).each do |col| |
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
| module GenericRepo | |
| def self.included(base) | |
| base.class_eval do | |
| extend ClassMethods | |
| end | |
| end | |
| module ClassMethods | |
| attr_accessor :model | |
| def create(params) |
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
| #Autor: emartini | |
| require ::File.expand_path('../config/environment', __FILE__) | |
| require "resque/server" | |
| app_name = Rack::Builder.new do | |
| use Rails::Rack::LogTailer | |
| use Rails::Rack::Static | |
| run ActionController::Dispatcher.new | |
| 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
| source 'https://rubygems.org' | |
| gem 'rails', '3.2.1' | |
| # Bundle edge Rails instead: | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'sqlite3' |
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
| --colour | |
| -I app |
This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it
Sister Document - Backup MySQL to Amazon S3 - read that first
# Set our variables
export mysqlpass="ROOTPASSWORD"
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
| namespace :deploy do | |
| HEROKU_ACCOUNT = "account_name" | |
| MAINLINE_BRANCH = "master" | |
| STAGING_REPO = "app-name-staging" | |
| PRODUCTION_REPO = "app-name-production" | |
| def make_git_timestamp | |
| "#{@env}-deploy-#{Time.now.to_s.gsub(/:/, "-").gsub(/\s/, "-").gsub(/--/, "-")}" | |
| 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
| (function(global) { | |
| var silpUrl = '//s3-eu-west-1.amazonaws.com/silp.shootitlive.com/js/silp.min.js'; | |
| // Globals | |
| if(!global.Silp) { global.Silp = {}; }; | |
| var Silp = global.Silp; | |
| // To keep track of which embeds we have already processed | |
| if(!Silp.foundEls) Silp.foundEls = []; |
OlderNewer