Skip to content

Instantly share code, notes, and snippets.

@yearofthewhopper
Created March 29, 2019 19:12
Show Gist options
  • Save yearofthewhopper/db06c8dc3fa57c122919e4baa7ffaa24 to your computer and use it in GitHub Desktop.
Save yearofthewhopper/db06c8dc3fa57c122919e4baa7ffaa24 to your computer and use it in GitHub Desktop.
/usr/local/share/jupyter/nbextensions/google.colab/
#make your path =
/nbextensions/google.colab/
!cp /content/drive/My\ Drive/Colab\ Notebooks/yourfiles/yourJavaScript.js \
/usr/local/share/jupyter/nbextensions/google.colab/
@register_cell_magic
def dojs(line, src):
return HTML(f"""
<canvas id="renderCanvas" touch-action="none" width="1280px" height="720px"></canvas>
<script src="/nbextensions/google.colab/testJavascript.js"></script>
<script>
{src}
</script>
""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment