Skip to content

Instantly share code, notes, and snippets.

View shunchu's full-sized avatar

Shun Chu shunchu

View GitHub Profile
@shunchu
shunchu / .ruby-version
Last active August 6, 2017 15:01
chruby hack for chefdk
chefdk
@shunchu
shunchu / pg.rake
Created July 8, 2012 10:25 — forked from royratcliffe/pg.rake
Rake task to dump PostgreSQL structure using a compatible pg_dump
namespace :pg do
namespace :structure do
# Does exactly the same as db:structure:dump but with one important
# difference. It tries to use a compatible version of pg_dump. If you see
# the following error message, use pg:structure:dump instead.
#
# pg_dump: server version: 9.1.0; pg_dump version: 9.0.4
# pg_dump: aborting because of server version mismatch
# rake aborted!
# Error dumping database
@shunchu
shunchu / dynamic_proxy.rb
Created June 5, 2012 07:17 — forked from nusco/dynamic_proxy.rb
Spell: Dynamic Proxy
# ====================
# Spell: Dynamic Proxy
# ====================
# Forward to another object any messages that don’t match a method.
class MyDynamicProxy
def initialize(target)
@target = target
end