Skip to content

Instantly share code, notes, and snippets.

View rempargo's full-sized avatar
💭
Working

Paul Verschoor rempargo

💭
Working
  • www.pixelhobby.com
  • Wervershoof
View GitHub Profile
@rempargo
rempargo / my_first_gist_file.rb
Created June 13, 2012 06:15
Some gist description
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end