Tuesday, 3 September 2019

How to Save Custom Google Colab Snippets

Create or open a Colab notebook, write multiple snippets in there. One snippet is combination of 2 blocks: 1 text block and 1 code block following the text block. The text block needs a header (h1), for example: #My Snippet

Copy the URL of the Colab notebook above, go to:

  • Colab menu
  • Tools >> Preferences >> Site
Then:
  • Paste the URL into the input box with placeholder 'Custom snippet notebook URL'
  • Click 'Save'.
Now wait for a little while (as per my experience, Colab needs this little while to process the custom snippet notebook), open another Colab notebook; click the 'Code snippets' tab on left panel and search for the header mentioned in the beginning of this article.

No comments:

Post a Comment