Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to add your own snippets in google colaboratory

I want to know if I can add my personal snippets in google colaboratory.

enter image description here

like image 378
vikas Avatar asked Feb 13 '18 06:02

vikas


People also ask

How do I add a code to snippets?

With a code file open in the editor, choose Snippets > Insert Snippet from the right-click menu, then My Code Snippets. You should see a snippet named Square Root. Double-click it. The snippet code is inserted in the code file.

Does Google own colab code?

The Basics. Colaboratory, or “Colab” for short, is a product from Google Research. Colab allows anybody to write and execute arbitrary python code through the browser, and is especially well suited to machine learning, data analysis and education.


1 Answers

  1. Create a snippets notebook and write your snippets there (make sure to provide a searchable title in a text block to each snippet - see the screenshot below).

  2. Copy the URL.

enter image description here

  1. Then, go to Tools > Preferences, paste the snippets notebook URL in Custom snippet notebook URL and save.

enter image description here

Now the snippets in the snippets notebook can be searched under Code Snippets Using the title provided in the text box.


See the tweet by @jakevdp here

like image 194
akilat90 Avatar answered Sep 28 '22 02:09

akilat90