# Useful Bookmarklet for GitHub

**URL:** <https://discourse.jupyter.org/t/useful-bookmarklet-for-github/10760>\
**Category:** Binder\
**Created:** [September 14, 2021, 2:51pm UTC](https://discourse.jupyter.org/t/useful-bookmarklet-for-github/10760 "2021-09-14T14:51:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![agoose77](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/agoose77/32/3455_2.png) [@agoose77](https://discourse.jupyter.org/u/agoose77)\
**Post date:** [September 14, 2021, 2:51pm UTC](https://discourse.jupyter.org/t/useful-bookmarklet-for-github/10760/1 "2021-09-14T14:51:27Z")

</div>

Hi all!

I use GitHub with Binder quite frequently, and often want to launch a repo on [MyBinder.org](http://MyBinder.org). In particular, I find Gists to be a very quick way to prepare a shared JupyterLab resource.

This simple bookmarklet constructs the URLs to open Gists and repositories on MyBinder (assuming HEAD revision).

```auto
javascript:(function()%7B(function%20_()%7Bconsole.log(window.location)%3Bdest%20%3D%20new%20URL(%22https%3A%2F%2Fmybinder.org%22)%3Bif%20(window.location.host%20%3D%3D%3D%20%22gist.github.com%22)%7Bdest.pathname%20%3D%20%60%2Fv2%2Fgist%24%7Bwindow.location.pathname%7D%60%3B%7Delse%20if%20(window.location.host%20%3D%3D%3D%20%22github.com%22)%7Bdest.pathname%20%3D%20%60%2Fv2%2Fgh%24%7Bwindow.location.pathname%7D%2FHEAD%60%3B%7D%20else%20%7Breturn%3B%7Dwindow.open(dest)%7D)()%7D)()

```

You can paste the source into [URL Decoder/Encoder](https://meyerweb.com/eric/tools/dencoder/) if you wish to ensure the safety of the code!
