Skip to content

Instantly share code, notes, and snippets.

@queuebit
queuebit / pre-commit
Last active August 29, 2015 14:03 — forked from mileszs/pre-commit
Git pre-commit hook for prompting to remove binding.pry and debugger lines lines. (Includes a commented example of adding a check for focus in spec files.)
#!/usr/bin/env ruby
hits = []
checks = {
#'_spec\.rb$' => ['focus:[:space:]*true'],
'\.(rb|erb|haml)$' => ['binding\.pry', 'debugger'],
'\.(js|coffee)$' => ['debugger']
}
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/queuebit/6118987/raw/SelectBullseye.js?x="+(Math.random());})();