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
namespace :db do | |
namespace :test do | |
task :prepare_postgis do | |
`/usr/local/pgsql/bin/psql dbname -f /usr/local/pgsql-9.0/share/contrib/postgis-1.5/postgis.sql -U postgres` | |
`/usr/local/pgsql/bin/psql dbname -f /usr/local/pgsql-9.0/share/contrib/postgis-1.5/spatial_ref_sys.sql -U postgres` | |
end | |
end | |
end | |
Rake::Task["db:test:prepare"].enhance do |
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 my-project | |
git clone --bare . ../my-project.git | |
scp -r ../my-project.git user@server:/path/to/git-repositories/ | |
git remote add origin user@server:/path/to/git-repositories/my-project.git | |
# then you can do: | |
git push | |
git pull | |
etc etc |
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
/* | |
** Template.templates.customer_address = "<div class='address'>${name}, ${line1}, ${postcode}</div>" | |
** | |
** var address = jQuery.parseJSON('{"name": "Steve", "line1": test}') | |
** Template.render("customer_address", address) | |
** | |
*/ | |
var Template = { | |
templates : {}, | |
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 ~/Desktop | |
wget http://release.seleniumhq.org/selenium-remote-control/1.0.1/selenium-remote-control-1.0.1-dist.zip | |
unzip selenium-remote-control-1.0.1-dist.zip | |
echo 'Copying in latest selenium' | |
sudo cp selenium-remote-control-1.0.1/selenium-server-1.0.1/selenium-server.jar /usr/local/lib/ruby/gems/1.8/gems/Selenium-1.1.14/lib/selenium/openqa/selenium-server.jar.txt | |
echo 'Removing dirs' |
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
namespace :db do | |
desc "Reset database and load seed data" | |
task :seed do | |
Rake::Task["db:migrate:reset"].invoke | |
require 'active_record/fixtures' | |
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) | |
Dir.glob(File.join(RAILS_ROOT, 'db', 'seed', '*.{yml,csv}')).each do |fixture_file| | |
Fixtures.create_fixtures('db/seed', File.basename(fixture_file, '.*')) | |
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
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}") |
NewerOlder