Skip to content

Instantly share code, notes, and snippets.

@ahamid
ahamid / Rakefile
Created February 26, 2011 03:50
Variable visibility in Rakefile method
target=ENV['TARGET'] || "whatever"
def helpful_helper(a)
# do something extremely helpful
puts "Visible? #{target}"
end
task :default do
puts "My target is #{target}"
helpful_helper("yo")
@ahamid
ahamid / bootstrap-drupal-quercus.sh
Created January 24, 2011 07:30
Bootstrap Drupal 6.20 on Quercus
#!/bin/sh
DRUSH_TGZ=drush-All-versions-4.1.tar.gz
RESIN_TGZ=resin-4.0.14.tar.gz
MYSQL_DRIVER_TGZ=mysql-connector-java-5.1.14.tar.gz
function msg {
echo
echo -e "\033[31m $1 \033[39m"
@ahamid
ahamid / gist:715653
Created November 25, 2010 17:15
Conditional layout with devise
class ApplicationController < ActionController::Base
layout :layout_by_resource
# choose different layout for devise
def layout_by_resource
if devise_controller?
"users"
else
"application"