start new:
tmux
start new with session name:
tmux new -s myname
#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| |
1. | |
LOGIN_PAGE=http://localhost/users/sign_in | |
curl --cookie-jar cookie_file $LOGIN_PAGE | grep csrf-token | |
2. | |
<meta content="csrf-token" name="csrf-token" /> | |
require 'google_drive' | |
client = Google::APIClient.new(application_name: 'Google Drive Ruby test', application_version: '0.0.1') | |
key = Google::APIClient::KeyUtils.load_from_pkcs12( | |
'path to your p12 key file (all the path with file name)', | |
'your secret here given at download file it seems to be always the same: notasecret') | |
asserter = Google::APIClient::JWTAsserter.new( | |
'service account - email address - here', | |
['https://www.googleapis.com/auth/drive'], |