Public Gists by shinzui

Gravatar
Sat Nov 21 14:40:29 -0800 2009
1
2
3
$ cat test.rb
class Person
end
Gravatar
Wed Nov 18 17:47:40 -0800 2009
1
2
3
 if RAILS_ENV != 'development'
      require 'cache_money'
     
Gravatar
Thu Nov 12 15:52:16 -0800 2009
1
2
3
# an example Monit configuration file for collectiveidea's fork of delayed_job.
# See: http://stackoverflow.com/questions/1226302/how-to-monitor-delayedjob-with-monit/1285611
#
Gravatar
Fri Oct 30 17:46:32 -0700 2009

      
Gravatar
Fri Oct 30 17:45:15 -0700 2009

      
gist: 217690 Subdomain routing in rails
Gravatar
Sat Oct 24 11:58:05 -0700 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:
gist: 214739 Rack route decoupling examp...
Gravatar
Tue Oct 20 17:22:28 -0700 2009
1
2
3
# Example from Rick Olson's Sparklines middleware
# http://github.com/technoweenie/rack-sparklines/blob/master/lib/rack-sparklines.rb
module Rack
Gravatar
Sat Oct 17 20:38:10 -0700 2009

      
Gravatar
Wed Oct 14 15:49:02 -0700 2009

      
Gravatar
Thu Oct 08 01:30:02 -0700 2009

      
Gravatar
Thu Oct 01 01:56:38 -0700 2009

      
Gravatar
Thu Oct 01 01:56:23 -0700 2009

      
gist: 189913 Dopplr City Color
Gravatar
Sun Sep 20 13:27:31 -0700 2009
1
2
3
require "digest/md5"
 
def dopplr_city_color(city)
Gravatar
Sun Sep 13 10:25:54 -0700 2009
1
2
3
Surround a heredoc with quotes and you can continue the code on the same line:
 
    render :status => 404, :text => <<-'EOH' and return unless setup
Gravatar
Sat Aug 29 20:54:35 -0700 2009
1
2
3
      === Epic Snow Leopard Upgrayyyyd Guide ===
 
Son, you’re now living in the land of 64-bit systems.
Gravatar
Wed Aug 26 20:39:00 -0700 2009
1
2
3
class Object
  def send_through(object, *args)
    object.dispatcher_for(self).call(self, *args)
Gravatar
Wed Aug 12 14:43:46 -0700 2009
1
alias dewip="sed -E -i '' -e '/^[[:blank:]]*@wip$/d;s/,[[:blank:]]*@wip//g;s/@wip,[[:blank:]]*//g' features/**/*.feature"
Gravatar
Tue Jul 21 23:42:23 -0700 2009
1
2
3
#!/usr/bin/env ruby
#
# A hook script to verify that only syntactically valid ruby code is commited.
Gravatar
Tue May 19 00:33:40 -0700 2009
1
2
3
# Cache Headers
# Middleware for configuring HTTP cache policy headers in Rack based web applications.
# Apply cache headers to HTTP responses corresponding to requests that match defined
Gravatar
Sat Apr 25 15:04:01 -0700 2009
1
2
3
# printf "\033[0m0 All attributes off\033[0m\n"
# printf "\033[1m1 Bold\033[0m\n"
# printf "\033[4m4 Underline\033[0m\n"