Skip to content

Instantly share code, notes, and snippets.


Dan Mercer drmercer

View GitHub Profile
drmercer / jQuery-coverage.js
Last active Oct 18, 2017
A jQuery plugin for tracking HTML "coverage" of jQuery selectors - it helps you figure out which selectors aren't actually selecting any elements, which may signify dead code.
View jQuery-coverage.js
Include using
<script type="text/javascript" src=""></script>
Be sure to include it after you've loaded jQuery.
window.jqcoverage = (function ($) {
"use strict";
drmercer / git-gud
Last active Oct 13, 2017
Put this script somewhere in your $PATH. Then you can type "git gud" for help with the last git command you used
View git-gud
#!/bin/bash -i
last_command=$(fc -ln | grep -v 'git gud' | grep -E '^\s*git' | tail -n 1 | cut -d ' ' -f 3)
if [ -n "$last_command" ] ; then
git help "$last_command"
echo "(now ur gud at 'git $last_command')"
echo "No recent git command found :("
drmercer /
Created Oct 5, 2017
Proof of GitHub for keybase

Keybase proof

I hereby claim:

  • I am drmercer on github.
  • I am drmercer ( on keybase.
  • I have a public key ASDrfHmLQpiMB3kbo2_jSTdtx2AMb1yxzq9zsmXDOsycxgo

To claim this, I am signing this object:

drmercer / pre-commit
Last active Apr 19, 2017 — forked from wesbos/commit-msg
ESLint 3.0 Git Pre Commit Hook
View pre-commit
# Get a list of all JS files currently staged for commit
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [ -z "$files" ] ; then
echo "(No JavaScript files to lint.)"
exit 0
drmercer / Git updateInstead backwards emulation
Last active Jun 15, 2018
A pair of git hooks for emulating receive.denyCurrentBranch=updateInstead on older git versions (MIT)
View Git updateInstead backwards emulation
These two git hooks could be placed in your (remote) repository's `hooks` directory to emulate the behavior of
receive.denyCurrentBranch=updateInstead on older versions of git that don't support that option for that setting.
Make sure both are executable, and don't put any file extensions on them.
These hooks are licensed under the MIT license (found in the `~LICENSE` file).
drmercer / IntentFilterToReceiveFromSpecificApp.xml
Last active Oct 27, 2015
An intent filter that only accepts intents from a certain application package. (For Android development)
View IntentFilterToReceiveFromSpecificApp.xml
<!-- This is a mock AndroidManifest.xml file, to show you the general context of this intent filter -->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
package="net.danmercer.ponderizer" >
<application ... >
<!-- Accept text via ACTION_SEND only from the Github Android app ("") -->