Skip to content

Instantly share code, notes, and snippets.

View crafterm's full-sized avatar

Marcus Crafter crafterm

View GitHub Profile
def highlight(document)
document.gsub(%r{<pre><code>(.*?)</code></pre>}m) do |match|
Uv.parse($1, 'xhtml', 'ruby', false, 'twilight')
end
end
# demo of adding a CSV description to any arbitrary object using the 'comma' gem
#
# http://github.com/crafterm/comma for more info
class Book < ActiveRecord::Base
# ================
# = Associations =
# ================
has_many :pages