Public Gists by dhh

Gravatar
Fri Jan 09 02:18:48 -0800 2009
1
2
3
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
Gravatar
Sun Dec 21 04:02:39 -0800 2008
1
2
3
case request.format
when :html then render
when :js then render
Gravatar
Wed Dec 17 10:21:36 -0800 2008
1
2
3
class Poller < Rails::Metal
  def process(env)
    if env["PATH_INFO"] =~ /^\/poller_rack/
Gravatar
Sun Nov 30 03:40:54 -0800 2008
1
2
3
#!/bin/sh
# git-create-remote-branch <branch_name>
 
Gravatar
Fri Nov 28 07:49:33 -0800 2008
1
2
3
def root(*args)
  if defined?(RAILS_ROOT)
    args.compact.empty? ? RAILS_ROOT : File.join(RAILS_ROOT, args)
Gravatar
Thu Nov 27 05:57:36 -0800 2008
1
2
3
config.action_controller.asset_host = Proc.new do |source, request|
  non_ssl_host = "http://asset#{source.hash % 4}.backpackit.com"
  ssl_host = "https://asset1.backpackit.com"