Skip to content

Instantly share code, notes, and snippets.

View ckraybill's full-sized avatar

Chris Kraybill ckraybill

View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 7, 2024 11:52
set -e, -u, -o, -x pipefail explanation
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