- Vieweing ipynb files on Nbviewer is so much faster than on the Github.
javascript:(function()%7Bjavascript%3A(function()%20%7Bvar%20currentUrl%20%3D%20window.location.href.split(%22%2F%22)%3Bif%20(currentUrl.includes(%22github.com%22))%20%7Bvar%20jupyterUrl%20%3D%20%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub%2F%22%20%2B%20currentUrl.slice(3).join(%22%2F%22)%3Bwindow.location%20%3D%20jupyterUrl%3B%7D%20else%20if%20(currentUrl.includes(%22gist.github.com%22))%20%7Bvar%20jupyterUrl%20%3D%20%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgist%2F%22%20%2B%20currentUrl.slice(3).join(%22%2F%22)%3Bwindow.location%20%3D%20jupyterUrl%3B%7Delse%20%7Balert(%22The%20current%20page%20does%20not%20contain%20github%20in%20its%20URL.%22)%3B%7D%7D)()%7D)()
If you are curious, it’s the following javascript but url encoded.
javascript:(function() {
var currentUrl = window.location.href.split("/");
if (currentUrl.includes("github.com")) {
var jupyterUrl = "https://nbviewer.jupyter.org/github/" + currentUrl.slice(3).join("/");
window.location = jupyterUrl;
} else if (currentUrl.includes("gist.github.com")) {
var jupyterUrl = "https://nbviewer.jupyter.org/gist/" + currentUrl.slice(3).join("/");
window.location = jupyterUrl;
}
else {
alert("The current page does not contain github in its URL.");
}
})();