This file contains 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
# download, from_repo, and commit_state methods swiped from | |
# http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb | |
require 'open-uri' | |
def download(from, to = from.split("/").last) | |
#run "curl -s -L #{from} > #{to}" | |
file to, open(from).read | |
rescue | |
puts "Can't get #{from} - Internet down?" |
This file contains 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
From 63254641c717dbdafdeb92fa0a3b70034d237a91 Mon Sep 17 00:00:00 2001 | |
From: Neil Middleton <[email protected]> | |
Date: Thu, 15 Oct 2009 14:32:33 +0100 | |
Subject: [PATCH 2/2] Changes to enable bcms deploment on heroku | |
--- | |
.gems | 1 + | |
config/environment.rb | 1 + | |
config/initializers/browsercms.rb | 7 ++++ | |
config/s3.yml | 9 +++++ |
This file contains 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
conditions = {} | |
conditions[:age] = params[:age] if params[:age].present? | |
conditions[:gender] = params[:gender] if params[:gender].present? |
This file contains 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
# Store named scopes | |
active = User.scoped(:conditions => {:active => true}) | |
recent = User.scoped(:conditions => ['created_at > ?', 7.days.ago]) | |
# Which can be combined | |
recent_active = recent.active | |
# And operated upon | |
recent_active.each { |u| ... } |
This file contains 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
Profile.scoped(:conditions => conditions).all(:conditions => ["description LIKE ?", "%#{params[:description]}%") |
This file contains 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
<%= h some_string %> | |
is now the same as | |
<%= some_string %> |
This file contains 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
<%= some_string.html_safe %> |
This file contains 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
SELECT * FROM sometable WHERE textfield ILIKE '%value%'; |
This file contains 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
SELECT * FROM sometable WHERE textfield LIKE '%value%'; |
This file contains 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
~ ➔ rvm --trace install ree | |
--trace install ree | |
rvm 0.1.38 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/] | |
+ [[ -z '' ]] | |
+ [[ ! -z ree ]] | |
+ rvm_action=use | |
+ [[ ! -z '' ]] | |
+ [[ ! -z '' ]] |
OlderNewer