Skip to content

Instantly share code, notes, and snippets.

@Prinzhorn
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Prinzhorn/730b8de787324ab2065d to your computer and use it in GitHub Desktop.
Save Prinzhorn/730b8de787324ab2065d to your computer and use it in GitHub Desktop.
Open the GitHub repository for the current GitHub page

There are so many projects hosted on GitHub pages which do not have a prominent link to the repo on the page. I always (╯°□°)╯︵ ┻━┻ when this happens because I have to manually enter the stupid URL.

Here's a Bookmarklet

javascript:!function(){var o=location.href.match(/(\w+).github.io\/(\w+)/);o&&(window.location="https://github.com/"+o[1]+"/"+o[2])}()
(function() {
var match = location.href.match(/(\w+).github.io\/(\w+)/);
if(match) {
window.location = 'https://github.com/' + match[1] + '/' + match[2]
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment