Skip to content

Instantly share code, notes, and snippets.

@michaelrhodes
Last active September 6, 2020 00:43
Show Gist options
  • Save michaelrhodes/d7e2a47879b7ba1e717d to your computer and use it in GitHub Desktop.
Save michaelrhodes/d7e2a47879b7ba1e717d to your computer and use it in GitHub Desktop.
A bookmarklet for toggling between github repositories and their github pages.
javascript:(function(){(function(){if(/github.io$/.test(location.host)){var%20paths=location.href.match(/^.+\/\/(.+)\.github\.io\/([^\/]+)?\/?.*$/).slice(1);location.href="https://github.com/"+paths[0]+"/"+(paths[1]||'')}else%20if(location.host=="github.com"){var%20paths=location.pathname.substr(1).split("/");location.href="http://"+paths[0]+".github.io/"+paths[1]}})()})();
@michaelrhodes
Copy link
Author

This is a modified version of a bookmarklet that went from repo to page, but not back. I forget where it came from, so sorry original author.

@thadk
Copy link

thadk commented Mar 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment