A tab completion script that works for Bash. Relies on the BSD md5
command on Mac and md5sum
on Linux, so as long as you have one of those two commands, this should work.
$ gradle [TAB]
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
module Feedzirra | |
module Parser | |
class FlickrEntry | |
include SAXMachine | |
include FeedEntryUtilities | |
element :guid, :as => :id | |
element :link, :as => :url |
# = YERB | |
# | |
# Who needs HAML when you have YAML + ERB? ;) | |
# | |
# See example.yaml below for an example. You can run this code | |
# by cloning this gist and then `ruby _yerb.rb example.yaml`. | |
# | |
# Notice that you need Ruby 1.9 so the hash order is preserved. | |
# Obviously, this is just for fun. Definitely slow as hell. | |
# |
<VirtualHost *:80> | |
ServerName ##APP_DOMAIN## | |
ServerAlias www.##APP_DOMAIN## | |
ServerAlias ##APPLICATION_ENV##.www.##APP_DOMAIN## | |
ServerAlias ##APPLICATION_ENV##.##APP_DOMAIN## | |
ServerAdmin admin@##APP_DOMAIN## | |
SetEnv APPLICATION_ENV ##APPLICATION_ENV## | |
SetEnv SERVER_HOSTNAME ##SERVER_HOSTNAME## | |
Header append X-Host-List "%{SERVER_HOSTNAME}e" |
ENV["RAILS_ENV"] ||= "production" | |
module UnicornServer | |
# http://unicorn.bogomips.org/Unicorn/Configurator.html | |
CONFIG_PATH = File.join(Rails.root, "config", "unicorn.rb") | |
PID_PATH = File.join(Rails.root, "tmp", "pids", "unicorn.pid") | |
RBENV = %x[which rbenv].strip | |
DAEMON = "bundle exec unicorn_rails" | |
DAEMON_OPTS = "-c #{CONFIG_PATH} -E #{ENV["RAILS_ENV"]} -D" |
Oscar Correa: oscar@batteries911.com