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
require 'rubygems' | |
require 'right_aws' | |
aws_access_key_id = 'access-id' | |
aws_secret_access_key = 'access-key' | |
target_bucket = 'yoursaycafe' | |
destination_bucket = 'unni-test' | |
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key) |
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
pry(main)> s3= AWS::S3.new(:region=> "eu-west-1") | |
=> <AWS::S3> | |
[3] pry(main)> s3.buckets | |
=> <AWS::S3::BucketCollection> | |
[4] pry(main)> s3.buckets.create | |
ArgumentError: wrong number of arguments (0 for 1..2) | |
from /Users/unni/.rvm/gems/ruby-2.0.0-p195@ehqv2/gems/aws-sdk-1.11.1/lib/aws/s3/bucket_collection.rb:91:in `create' | |
[5] pry(main)> s3.buckets.create("unni-test") | |
=> #<AWS::S3::Bucket:unni-test> | |
[6] pry(main)> s3.buckets |
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
=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 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
no change in User#usertype | |
def present_user | |
user_signed_in? ? current_user : non_logged_in_user | |
end | |
def non_logged_in_user | |
unverified_user_present? ? unverified_user : User.new | |
end |
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
cd /usr/local | |
git fetch origin | |
git reset --hard origin/master |
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
echo export RAILS_ENV=production > .powenv && touch tmp/restart.txt |
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
sudo cp $(brew --prefix mysql)/support-files/my-small.cnf /etc/my.cnf |
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
#config/initializers/conversions.rb | |
Time::Conversions::DATE_FORMATS.update(:event => '%I:%M%p') | |
Time.now.to_s(:event) #=> "03:23PM" |
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
=link_to "http://google.co.in" do | |
Hello | |
<i class="icon-search icon-white">Unni</i> | |
<b> World </b> |
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
Customer.stub(:find).with(:all) { data_array } |