Created
July 8, 2014 20:47
-
-
Save weiland/7b04f898ff37259f52a8 to your computer and use it in GitHub Desktop.
Switch between a GitHub Repository and their gh-pages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { var s,r,c; var l = window.location; if(l.origin.indexOf('github.io') !== -1) { r = /(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/i; s = window.location.origin.match(r)[1]; window.location.href='https://github.com/' + s + l.pathname; } else if(l.origin.indexOf('github.com') !== -1) { s = window.location.pathname.split('/')[1]; c = window.location.pathname.split('/')[2]; window.location.href='http://' + s + '.github.io/' + c; }})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment