This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
namespace :synchronize do | |
desc "Synchronizing EFP and Edflats databases" | |
task(:synchronize => :environment) do | |
props = Property.find(:all) | |
@bookings = Array.new | |
if props.length > 0 | |
props.each do |prop| | |
enquiries = Enquiry.find(:all, :conditions=>["property_id=? AND status='BOOKING_CONFIRMED' AND ISNULL(synced_at)", prop.id]) | |
enquiries.each do |enq| | |
@bookings.push(enq.booking) |
# Methods added to this helper will be available to all templates in the application. | |
module ApplicationHelper | |
def sheet(*args, &block) | |
code = <<-EOF | |
<table border="0" cellspacing="0" cellpadding="0" width="#{args[0]}"> | |
<tr> | |
<td height="11" width="6"><img src="/images/shadow_tl.png" width="6" height="11" border="0" /></td> | |
<td rowspan="2" style="background-color: #fff; padding: 2px;"> |
Day job: | |
Rails Programmer, Trondheim, Norway (in need of a conference, last one was RailsConf Europe 2007!) | |
Your Rails contributions (if any): | |
Contribution to image_submit_tag - http://contributors.rubyonrails.org/contributors/alastair-brunton/commits | |
What's your Ruby/Rail experience?: |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
set :stages, %w(testing staging production) | |
set :default_stage, "testing" | |
require 'capistrano/ext/multistage' | |
task :protect do | |
# http://www.htaccesstools.com/htaccess-authentication/ | |
run "echo 'username:$apr1$gT8Ap...$3f8RadFS7xottW8AYVX5b0' >> #{File.join(current_path, '.htpasswd')}" | |
run "echo 'AuthType Basic' >> #{File.join(current_path, '.htaccess')}" |
When starting a project that includes refinerycms-blog: | |
$ rake refinery:override view=refinery/pages/* | |
$ rake refinery:override view=layouts/* | |
$ rake refinery:override view=refinery/blog/shared/* | |
$ rake refinery:override view=refinery/blog/posts/* | |
$ rake refinery:override view=refinery/* | |
$ rake refinery:override controller=refinery/blog/* | |
$ rake refinery:override controller=refinery/* |
Make sure that you have the latest version of Xcode installed from the Mac App Store, and that you have the command line tools installed. To install the command line tools, open Xcode, click Xcode->Preferences->Downloads->Command Line Tools
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"