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
| Add the gem "twitter" to Gemfile. | |
| client = Twitter::Client.new( | |
| :consumer_key => "key", | |
| :consumer_secret => "secret", | |
| ) | |
| [8] pry(main) client.users("unnitallman")[0].id | |
| => 11976602 |
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
| secret = "a_big_secret" | |
| #expects S3 credentials in congif/aws.yml | |
| s3 = AWS::S3.new | |
| i = 0 | |
| source = 'source_bucket_name' | |
| target = 'target_bucket_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
| # see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version | |
| # see https://github.com/defunkt/resque/issues/49 | |
| # see http://redis.io/commands - new commands | |
| namespace :resque do | |
| desc "Clear pending tasks" | |
| task :clear => :environment do | |
| queues = Resque.queues | |
| queues.each do |queue_name| | |
| puts "Clearing #{queue_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 '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 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
| 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 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
| 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 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
| cd /usr/local | |
| git fetch origin | |
| git reset --hard origin/master |
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
| echo export RAILS_ENV=production > .powenv && touch tmp/restart.txt |
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 cp $(brew --prefix mysql)/support-files/my-small.cnf /etc/my.cnf |