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

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

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).
Copy the URL.
Then, go to Tools > Preferences, paste the snippets notebook URL in Custom snippet notebook URL and save.
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

We currently have not exposed a way to register additional snippets.
Curious if you'd be interested in personal snippets that follow you between notebooks, or notebook-specific snippets that only appear for a specific notebook.

Related

How can I replace one or multiple lines in the code editor with a WebView, File Preview or an Image?

I'm trying to develop an extension that needs to render text, images and the preview of an external file in the code as a decoration. The problem is that I only can find text decoration and nothing that allows me to for example show a PNG between two lines of code without modifying the file.
Is this possible or I need to create a Custom Editor using the API? The problem of this solution is the need to integrate all the extension on the language I'm working what will take too much time.
I have seen the Comments API allows to show the reference of a text file but I can't find where is the API to generate this type of views:
The closest thing I can find is the Comments API with this sample. However, I need to add more than just text and the idea is to only show the content, nothing more.
Any guide, information or reference is highly appreciated.

In Google Colab, can you add a Markdown setting which will be applied automatically?

I write most of my text in Hebrew, or a mix of Hebrew / English. for this, I need to add the following line to each text block:
div dir="rtl" lang="he" xml:lang="he">
(this didn't paste very well...)
but it's annoying to paste this each time. Is there a way to have this auto-pasted? better yet, is there a method to configure colab to work right to left by default?
My answer is not exactly what you are looking for, but here is tip that may help. You can create a code snippet with the line that you want to insert to more easily add it to your notebooks.
I create a small notebook with your snippet here https://gist.github.com/alexheat/b1bf37371a2d132cbd5b562e89d008d5.
In Google Colab settings, there is a section that says "Custom notebook snippet URL' enter this URL https://colab.research.google.com/gist/alexheat/b1bf37371a2d132cbd5b562e89d008d5/ltr.ipynb
Now create a new notebook and insert a snippet. You can type "Hebrew" to find the snippet. Insert the snippet.
This will create a code cell. To convert it to a markdown cell type Command+M+M.

Is there a way to download a google slides document of which I have view perms and I just have the link?

This is the google slides document in question: https://docs.google.com/presentation/d/e/2PACX-1vQCYjdh1xx8HY-rP_D33zlJ-DR9s5knPDbBXPUAZJoLCT8Sb5Iwr56MZXhnodGfYSYx1xfXr8jaCvem/pub?start=false&loop=false&delayms=3000#slide=id.p
I'm at the start of my year studying again, and I wanted to download these notes...is there way to achieve this? I tried to save page but that obviously won't work, it's an html, I want the original file to save it to my pc.
Is there maybe any web I can paste the link and get the file?
PS: If this is not the appropriate subforum, please tell me where I could post the issue in the stack exchange forums. Thanks!
Answer:
The publish link is a view-only Presesntation mode copy of the Google Slide file, and making a copy from this is disallowed. This is by design and can not be changed.
More Information:
From the help article on publishing Workspace files:
If you send someone the URL of a published file, they’ll see a version they can’t edit that looks different from yours. Here’s what others will see:
Presentations: A view-only version or a version in presentation mode with full-screen slides.
And from the Publish dialog:
Make your content visible to anyone by publishing it to the web. You can link to or embed your document. Learn more
Note: the wording here is view-only and visible, which is not the same as read-only, which would include file copying.
If you wish to obtain a copy of the presentation, I suggest contacting the owner of the file.

How to add pictures in colab text

I have used Jupyter notebook before and there is no problem to add pictures in the text cells.
In Colab, I have tried all the different ways I can come up with and I have searched the web. I have found a lot of solutions but none work for me. I think that the format of the downloadable link differs from the suggested solutions I have found. I have tried to modify the links in different ways but nothing seems to work.
I Found this in stack overflow: Insert Image in Google Colab Text Cell
I have uploaded my image to Google drive. If I right click the image I can select "Get Link". I think that one shall make the link "Open". Click "Copy link" and return to the markdown cell.
Where you want the image positioned, write "![](https://drive.google.com/uc?id=" then Ctrl + V to add the copied link, but delete all but the bold code as below :
"https://drive.google.com/file/d/1CDIZwkVNiKNmaskHPwnCFTkt-4_RxIhP/view?usp=sharing"
The resulting image link should look something like this:
"![ ] (https://drive.google.com/uc?id=1CDIZwkVNiKNmaskHPwnCFTkt-4_RxIhP)"
(Sorry for my English)
It is only just about adding a !.
Let me give an example,
Add a link.
Paste Image link
Then put ! before link text.(eg ![link text](https://i.example.com/e7e8ea16d242676.png))

Use leaflets over pdf files using angularjs

I am trying to do something like this
leafletoverimage.
Currently I am using background image and angular-leaflets tool for the click and comment.
I am trying to find out a way where I can have pdf file actually rendering on browsers, and able to click on different section of pdf file, have popover and enter comment about that section.
This is similar to what https://app.fieldlens.com/ and www.plangrid.com is doing.
is there something available in angularjs or any other solution is appreciated.