Skip to content

Instantly share code, notes, and snippets.

View natewinck's full-sized avatar

Nathaniel Winckler natewinck

View GitHub Profile
@natewinck
natewinck / keybase.md
Created March 24, 2016 22:26
Keybase

Keybase proof

I hereby claim:

  • I am natewinck on github.
  • I am natewinck (https://keybase.io/natewinck) on keybase.
  • I have a public key whose fingerprint is 7601 7934 FA75 0684 E13A 68A5 6195 E01E 91ED 1982

To claim this, I am signing this object:

// Create a link out of any element while maintaining
// the ability to open those links in a new window/tab/etc.
$("body").on("click", "[data-href]", function(e) {
// Create the anchor based on the data-href attribute
$anchor = $("<a>").attr("href", $(this).attr("data-href"));
$anchor.css("display", "none");
// Check to see if the user is holding a modifier key
if (e.ctrlKey || e.shiftKey || e.metaKey) {
$anchor.attr("target", "_blank");