Skip to content

Instantly share code, notes, and snippets.

View dpnsan's full-sized avatar

Dave Pijuan-Nomura dpnsan

  • Nomura Photography
  • Hamilton
View GitHub Profile
@mislav
mislav / deploy.rb
Created June 12, 2009 13:04
Thor task for easier hotfixes with Capistrano & git (instructions below)
# copy to your Capistrano recipe file
namespace :deploy do
task :clear_cached_assets, :roles => :web do
dir = "#{current_release}/public"
run %(rm #{dir}/javascripts/all.js #{dir}/stylesheets/master.css)
end
end
@grantr
grantr / gist:1105416
Created July 25, 2011 22:31
Chef mysql master/slave recipes
## mysql::master
ruby_block "store_mysql_master_status" do
block do
node.set[:mysql][:master] = true
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password])
m.query("show master status") do |row|
row.each_hash do |h|
node.set[:mysql][:master_file] = h['File']
node.set[:mysql][:master_position] = h['Position']
end
@latentflip
latentflip / Rakefile
Created January 9, 2012 17:44
A better Rakefile for rails?
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
#Load all the tasks in lib/tasks
Dir[File.expand_path('../lib/tasks/', __FILE__) + '/*.rake'].each do |file|
load file
end
#The original rails rakefile loading