Skip to content

Instantly share code, notes, and snippets.

View antonror's full-sized avatar
👨‍💻

Anton antonror

👨‍💻
View GitHub Profile
@thotmx
thotmx / install_chrome_driver
Created March 21, 2015 06:12
Install chromedriver in Ubuntu (14.04)
$ sudo apt-get install chromium-chromedriver
$ sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver
@stevebartholomew
stevebartholomew / gist:50180
Created January 21, 2009 20:52
Simple database backup rake task for Rails using mysqldump
namespace :backup do
desc "Backup database"
task :db do
RAILS_ENV = "development" if !defined?(RAILS_ENV)
app_root = File.join(File.dirname(__FILE__), "..", "..")
settings = YAML.load(File.read(File.join(app_root, "config", "database.yml")))[RAILS_ENV]
output_file = File.join(app_root, "..", "backup", "#{settings['database']}-#{Time.now.strftime('%Y%M%d')}.sql")
system("/usr/bin/env mysqldump -u #{settings['username']} -p#{settings['password']} #{settings['database']} > #{output_file}")