Skip to content

Instantly share code, notes, and snippets.

@domoritz
Last active January 8, 2020 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save domoritz/e04fd2e5b13c11ce88741cc56d2eaf23 to your computer and use it in GitHub Desktop.
Save domoritz/e04fd2e5b13c11ce88741cc56d2eaf23 to your computer and use it in GitHub Desktop.
CoLab bookmarklet for GitHub
license: mit
<h1>Simple Bookmarklet to open Jupyter Notebooks on GitHub in Colaboratory</h1>
<p>
You can use the bookmarklet when you are browsing GitHub and open a Jupyter Notebook. Just click the bookmarklet and it will open the notebook in Colaboraty where you can run it.
</p>
<p>
News: The Colab team released an <a href="https://chrome.google.com/webstore/detail/open-in-colab/iogfkhleblhcpcekbiedikdehleodpjo">extension that does the same</a>.
</p>
<p>
To install it, drag this to your bookmark bar: <a href="javascript:void(location.href='https://colab.research.google.com/github/'+location.href.substr(19))">Colaboratory for GitHub</a>
</p>
<p>
If this does not work, you can:
<ul>
<li>In Chrome, click Bookmarks -> Bookmark Manager.</li>
<li>Select the "Bookmarks Bar" folder on the left.</li>
<li>Right-click on the right side and select "Add new Bookmark".</li>
<li>You should see two input fields. Type the name of the bookmark you would like (e.g., "Colaboratory for GitHub") in the first field.</li>
<li>Paste the JavaScript code below into the second field.</li>
</ul>
<input style="width: 600px; padding: 6px;" value="javascript:void(location.href='https://colab.research.google.com/github/'+location.href.substr(19))"></input>
</p>
<p style="padding-top: 2em">
<a href="https://twitter.com/domoritz">@domoritz</a> made this page based off of <a href="https://twitter.com/scheidegger/status/1032823363377364992">this tweet</a>.
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment