page.response_headers['Content-Type'].should == "text/csv"
page.response_headers['Content-Disposition'].should == "attachment; filename=\"some_file.csv\""
find("a.some_link")["href"].should == "http://google.com"
page.response_headers['Content-Type'].should == "text/csv"
page.response_headers['Content-Disposition'].should == "attachment; filename=\"some_file.csv\""
find("a.some_link")["href"].should == "http://google.com"
| /^(?=.*\d)(?=.*?[a-z])(?=.*?[A-Z]).{8,40}$/ |
| index = 0 | |
| loop do | |
| failure = Resque::Failure.all(index) | |
| break if failure.nil? | |
| if failure["queue"] == "queue_name" | |
| Resque::Failure.requeue(index) | |
| Resque::Failure.remove(index) |
$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')
If you need the table names:
$ ActiveRecord::Base.connection.tables
=> ["accounts", "assets", ...]
$ cat somefile.txt | ruby version*.rb
Version 1:
input = $stdin.read
input.each_line do |line|
...
end
Version 2:
http://xquartz.macosforge.org/landing/
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'mysql' | |
| require 'net/ssh/gateway' | |
| HOST = '' | |
| SSH_USER = '' | |
| SSH_PASS = '' | |
| DB_HOST = "127.0.0.1" | |
| DB_USER = "" |