Skip to content

Instantly share code, notes, and snippets.

@reeddunkle
Created October 24, 2020 14:32
Show Gist options
  • Save reeddunkle/8a90c731c3a3cba5be93a81cc7efcd4b to your computer and use it in GitHub Desktop.
Save reeddunkle/8a90c731c3a3cba5be93a81cc7efcd4b to your computer and use it in GitHub Desktop.
Save as bookmark. Open on a GH repo to see first commit.
javascript:(b=>fetch('https://api.github.com/repos/'+b[1]+'/commits?sha='+(b[2]||'')).then(c=>Promise.all([c.headers.get('link'),c.json()])).then(c=>{if(c[0]){var d=c[0].split(',')[1].split(';')[0].slice(2,-1);return fetch(d).then(e=>e.json())}return c[1]}).then(c=>c.pop().html_url).then(c=>window.location=c))(window.location.pathname.match(/\/([^\/]+\/[^\/]+)(?:\/tree\/([^\/]+))?/));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment