Skip to content

Instantly share code, notes, and snippets.

@Neomeng
Neomeng / gist:3870015
Created October 11, 2012 03:41
Proper IRB unicode in Ruby 1.9.3 using RVM
$ rvm get latest
$ rvm pkg install readline
$ rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
P.S. configuring with homebrew readline does not seem to work, so it's rvm pkg all the way.
@Neomeng
Neomeng / better_logger.rb
Created October 8, 2012 09:36 — forked from indirect/better_logger.rb
Rails 3 logs with severity and PIDs
# You must require this file in application.rb, above the Application
# definition, for this to work. For example:
#
# # Syslog-like Rails logs
# if Rails.env.production?
# require File.expand_path('../../lib/better_logger', __FILE__)
# end
#
# module MyApp
# class Application < Rails::Application
@Neomeng
Neomeng / will_paginate.rb
Created June 14, 2012 03:31 — forked from isaacbowen/will_paginate.rb
will_paginate和bootstrap
# config/initializers/will_paginate.rb
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
class BootstrapLinkRenderer < LinkRenderer