Skip to content

Instantly share code, notes, and snippets.

View drmercer's full-sized avatar

Dan Mercer drmercer

View GitHub Profile
drmercer / jQuery-coverage.js
Last active October 18, 2017 19:48
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.
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 October 13, 2017 05:32
Put this script somewhere in your $PATH. Then you can type "git gud" for help with the last git command you used
#!/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 October 5, 2017 05:30
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 April 19, 2017 21:12 — forked from wesbos/commit-msg
ESLint 3.0 Git Pre Commit Hook
# 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 June 15, 2018 15:43
A pair of git hooks for emulating receive.denyCurrentBranch=updateInstead on older git versions (MIT)
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 October 27, 2015 18:12
An intent filter that only accepts intents from a certain application package. (For Android development)
<!-- 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 ("") -->