<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tom Anderson</title>
    <description>The latest articles on DEV Community by Tom Anderson (@ndsn).</description>
    <link>https://dev.to/ndsn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F438848%2F5beafe99-4c8f-4004-9cd4-bca2f978d244.jpeg</url>
      <title>DEV Community: Tom Anderson</title>
      <link>https://dev.to/ndsn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ndsn"/>
    <language>en</language>
    <item>
      <title>Why Excalidraw is mightier than the pen (and the sword)</title>
      <dc:creator>Tom Anderson</dc:creator>
      <pubDate>Sat, 08 Aug 2020 19:05:15 +0000</pubDate>
      <link>https://dev.to/ndsn/why-excalidraw-is-mightier-than-the-pen-and-the-sword-329f</link>
      <guid>https://dev.to/ndsn/why-excalidraw-is-mightier-than-the-pen-and-the-sword-329f</guid>
      <description>&lt;p&gt;&lt;em&gt;(Cover photo by &lt;a href="https://unsplash.com/@kobuagency?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;KOBU Agency&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;. Originally posted on &lt;a href="https://medium.com/@ndsn/why-excalidraw-is-mightier-than-the-pen-and-the-sword-47ecea8e81" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;.)&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TLDR: &lt;a href="https://excalidraw.com/" rel="noopener noreferrer"&gt;Excalidraw&lt;/a&gt; is a web-based diagramming tool that I believe may seriously replace the need for pen and paper for quick sketches and diagrams.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  “A picture speaks a thousand words”
&lt;/h3&gt;

&lt;p&gt;For me, it’s a quote that couldn’t be more true. I often find myself searching for a pen and paper to try and draw out whatever it is I’m trying to explain or understand. How very analogue.&lt;/p&gt;

&lt;h4&gt;
  
  
  It’s 2020, and there should be a web app for everything I need!
&lt;/h4&gt;




&lt;p&gt;While it’s true that there are several online apps that can be used for diagramming (many of which I’ve tried), none have managed to prove themselves better than just keeping a pen and paper handy.&lt;/p&gt;

&lt;p&gt;But why is that? Let’s look at what makes the pen and paper so good:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;⏱️ &lt;strong&gt;Pick up and go.&lt;/strong&gt; (There’s no loading screen for a piece of paper.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✏️ &lt;strong&gt;Complete freedom in what you draw.&lt;/strong&gt; (Text, Images, Arrows, whatever!)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📘 &lt;strong&gt;Permanent from the start.&lt;/strong&gt; (As soon as you’ve drawn on it, it’s there forever.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📑 &lt;strong&gt;Annotate after the fact.&lt;/strong&gt; (Add extra bits of information as you go.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💷 &lt;strong&gt;Free!&lt;/strong&gt; (Minus the cost of the paper, I guess.)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But there are &lt;em&gt;definitely&lt;/em&gt; some things that we can improve on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;👫 &lt;strong&gt;Collaboration.&lt;/strong&gt; (It’s kind of hard to share a paper, especially over a video call.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💽 &lt;strong&gt;Digital Storage.&lt;/strong&gt; (I don’t want paper cluttering up my desk!)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔐 &lt;strong&gt;Security.&lt;/strong&gt; (I often draw out things for clients at work, I don’t want to have to shred every scrap of paper.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🌍 &lt;strong&gt;The Planet.&lt;/strong&gt; (Paper isn’t very sustainable, we can do better.)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;For a long time, pen and paper went unbeaten. Then I discovered &lt;a href="https://excalidraw.com/" rel="noopener noreferrer"&gt;Excalidraw&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Entirely web-based, end-to-end encrypted and completely open-source (with nearly &lt;a href="https://github.com/excalidraw/excalidraw" rel="noopener noreferrer"&gt;10k stars on GitHub&lt;/a&gt;!), it was a tool that I instantly got along with and is now my go-to tool whenever I need to sketch out my thoughts or help explain something visually.&lt;/p&gt;

&lt;p&gt;So what makes it different?&lt;/p&gt;

&lt;p&gt;Well, for one it follows the &lt;a href="https://en.wikipedia.org/wiki/KISS_principle" rel="noopener noreferrer"&gt;KISS Principle&lt;/a&gt; perfectly. To get going with it you just visit the URL and start drawing. &lt;strong&gt;No loading, no sign-up, just draw.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2704%2F1%2AZKJa3SEavzl9f8-RcdAzYA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2704%2F1%2AZKJa3SEavzl9f8-RcdAzYA.png" alt="Excalidraw’s simple interface and ‘arty’ visuals"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Shapes are kept simple so that the application is quick to use. Text can be added by double-clicking the place you want it. It uses an infinite canvas. Text and background colours can either be selected from a palette or via standard HTML Hex Colour codes. The list goes on!&lt;/p&gt;

&lt;p&gt;The second thing that makes it different in my opinion is the security and sharing capability of the drawings themselves. Excalidraw stores all drawings on the server as &lt;a href="https://en.wikipedia.org/wiki/Binary_large_object" rel="noopener noreferrer"&gt;blobs&lt;/a&gt; that are &lt;a href="https://blog.excalidraw.com/end-to-end-encryption/" rel="noopener noreferrer"&gt;end-to-end encrypted&lt;/a&gt; meaning that even though the data is held remotely, no one on the server can see the content. Drawings persist across visits and can be exported as PNG, SVG or even just as a link that includes the blob reference and decryption key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2442%2F1%2AIcjSNmqfT3Z1j0uh1ptUpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2442%2F1%2AIcjSNmqfT3Z1j0uh1ptUpw.png" alt="Excalidraw’s live collaboration in action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But above all, it was the live collaboration that convinced me that Excalidraw could be a replacement for the pen and paper. While there are other platforms that implement collaboration (&lt;a href="https://lucidchart.com" rel="noopener noreferrer"&gt;Lucidchart&lt;/a&gt; and &lt;a href="https://creately.com/" rel="noopener noreferrer"&gt;Creately&lt;/a&gt; spring to mind as good examples of this), none are as useable as Excalidraw’s &lt;a href="https://blog.excalidraw.com/building-excalidraw-p2p-collaboration-feature/" rel="noopener noreferrer"&gt;Socket.io-based&lt;/a&gt; implementation. From starting a diagram, I can (with two clicks) generate a URL to give to others to let them see and contribute to my drawing.&lt;/p&gt;

&lt;p&gt;They can then jump in my drawing and in real-time I can see their cursor, see anything they (or I) add to the document and we can start to transform my basic diagram into whatever it needs to be: a process diagram, block diagram, architecture diagrams (to an extent) or just a generic whiteboard to capture notes.&lt;/p&gt;

&lt;p&gt;I use the live collaboration features of Google Docs every day both at work and at home, and yet the ability to have 5 or 6 people add to and annotate my diagram in real-time still blew my mind the first time I shared a diagram on a video call with a client.&lt;/p&gt;




&lt;p&gt;So let’s see how Excalidraw stacks up against the benefits of pen and paper we saw earlier:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;⏱️ &lt;strong&gt;Pick up and go.&lt;/strong&gt; ✅ Excalidraw loads super fast, and by adding it to my bookmarks bar I can load it up in a comparable time to grabbing a pen and paper.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;✏️ &lt;strong&gt;Complete freedom in what you draw.&lt;/strong&gt; ✅ While the shape variety is basic, it covers 90% of my use cases when combined with arrows and text!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📘 &lt;strong&gt;Permanent from the start.&lt;/strong&gt; ✅ Drawings persist across sessions, and I can save them both locally (as BLOBs) and share them online (as URLs).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📑 &lt;strong&gt;Annotate after the fact.&lt;/strong&gt; ✅ The infinite canvas lets me expand into whatever space I need and I can place text arbitrarily on the canvas.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💷 &lt;strong&gt;Free!&lt;/strong&gt; ✅ Not only is it free, but it’s &lt;em&gt;completely&lt;/em&gt; open-source. There’s even a Docker image that I could self-host (Cloud Run anyone?) and use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;👫 &lt;strong&gt;Collaboration.&lt;/strong&gt; ✅ See above, it’s absolutely &lt;strong&gt;epic.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💽 &lt;strong&gt;Digital Storage.&lt;/strong&gt; ✅ Digital from the get-go. I can store drawings either locally or online and sharing is a breeze.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔐 &lt;strong&gt;Security.&lt;/strong&gt; ✅ End-to-end encryption + P2P-based collaboration = Secure enough for me!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🌍 &lt;strong&gt;The Planet.&lt;/strong&gt; ✅ While it &lt;em&gt;does&lt;/em&gt; run on a server that takes up power, the more popular it becomes the more efficient it is per-person!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;All in all, I’m quite impressed with it as a tool so far! But there may be some questions that have crossed your mind:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is Excalidraw a replacement for {Lucidchart|Creately|Draw.io|Google Drawings|Visio|Insert Tool Here}?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No. Those tools are &lt;em&gt;excellent&lt;/em&gt; for complex diagrams, precise architectural diagrams and those flowchart diagrams that get printed out on A3. Stick to those for those tasks. Use Excalidraw for the simple stuff.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can Excalidraw be a replacement for everything I do on pen and paper?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No. I don’t believe &lt;em&gt;any&lt;/em&gt; web application used with a mouse or trackpad will ever replicate the freedom of freehand drawing on paper. But most of the time I’m just wanting to put some text in a box and draw a line between them, and Excalidraw is perfect for that.&lt;/p&gt;

&lt;p&gt;So while I &lt;em&gt;don’t&lt;/em&gt; want to claim it’s the perfect solution for every drawing occasion, I &lt;em&gt;do&lt;/em&gt; want you to give Excalidraw a try the next time you need a drawing to help illustrate your message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1686%2F1%2AqrHSMmwwtJTXvw56c_NZeQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1686%2F1%2AqrHSMmwwtJTXvw56c_NZeQ.png" alt="See this on Excalidraw: [https://excalidraw.com/#json=6284204660752384,7mj-mPm-h-XcvXtLUmPx7g](https://excalidraw.com/#json=6284204660752384,7mj-mPm-h-XcvXtLUmPx7g)"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;🧡 Tom Anderson&lt;br&gt;
&lt;a href="https://www.thomas-anderson.net/?utm_source=devto" rel="noopener noreferrer"&gt;www.thomas-anderson.net&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Liked something I did and want to help me out?&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/ndsn" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FBuy%2520me%2520a%2520coffee-orange%3Flogo%3DBuy%2520Me%2520A%2520Coffee%26logoColor%3Dwhite" alt="Buy me a coffee"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tools</category>
      <category>productivity</category>
      <category>diagrams</category>
      <category>excalidraw</category>
    </item>
    <item>
      <title>Add Dev.to posts to your static site in 20 lines of code</title>
      <dc:creator>Tom Anderson</dc:creator>
      <pubDate>Sun, 02 Aug 2020 18:14:57 +0000</pubDate>
      <link>https://dev.to/ndsn/add-dev-to-posts-to-your-static-site-in-20-lines-of-code-409h</link>
      <guid>https://dev.to/ndsn/add-dev-to-posts-to-your-static-site-in-20-lines-of-code-409h</guid>
      <description>&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;I'm relatively new to writing for Dev.to, and am continually impressed by both this community and the content available within the site. 👍 Recently, I found the API interface that's available, which lets me access the content I write programmatically - interesting!&lt;/p&gt;

&lt;p&gt;I also have an &lt;a href="https://github.com/Driminary/thomas-anderson.net"&gt;open-sourced personal site 🧑‍💻&lt;/a&gt;, where I use 11ty and Tailwind to generate a completely static site that I deploy on 🔥 Firebase Hosting.&lt;/p&gt;

&lt;p&gt;So I set out to try and link the two by pulling the last 5 posts from Dev.to and putting them on the homepage of my personal site, in the most straightforward way that I knew how. The process for doing this can be found below, or at the &lt;a href="https://github.com/Driminary/devto.ndsn.io"&gt;GitHub template repo&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧰 The Architecture
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: I use &lt;a href="https://11ty.dev"&gt;11ty&lt;/a&gt; to generate my static sites, so that's what I have used in the below architecture, but you may replace 11ty with whatever Static Site generator you prefer, just ensure you can pull data with JavaScript into your templates.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tjR5BVqv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/6n6j5nG/devto-architecture.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tjR5BVqv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/6n6j5nG/devto-architecture.png" alt="Architecture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📂 Folder Structure
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;─ _source/
  ├── _data/
  |   └── devtoapi.js
  └── index.liquid
─ package.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There are only 2 input files for this demo:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;_data/devtoapi.js&lt;/strong&gt; - The JavaScript module that calls the Dev.to API using Axios. (10 lines of code to actually pull the data)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;index.liquid&lt;/strong&gt; - The liquid template that shows the Dev.to posts on the index page. (10 lines of code to show the posts)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ensure you have an initialised package.json file (or existing project). We only have 2 npm dependencies: &lt;code&gt;axios&lt;/code&gt; and &lt;code&gt;@11ty/eleventy&lt;/code&gt; - add them to your package.json file.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧑‍💻 The Code
&lt;/h2&gt;

&lt;p&gt;I did promise 20 lines of code, so here goes:&lt;/p&gt;

&lt;h3&gt;
  
  
  ↩️ &lt;strong&gt;The API calls (10 lines)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;_data/devtoapi.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;api_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DEVTO_APIURL&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://dev.to/api/articles?username=ndsn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;api_url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;api_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Yes, there's a new line on line 3 but I'm counting it as 10 total!)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To make the API calls to the Dev.to API we need two key things: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The JavaScript library &lt;a href="https://github.com/axios/axios"&gt;Axios&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;The correct Dev.to &lt;a href="https://docs.dev.to/api/#tag/articles"&gt;API Endpoint for articles&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From there, we export an asynchronous function that returns the API response as per 11ty's JavaScript Data File docs. At build time, 11ty calls this script and creates a collection object with the returned value(s) with the same name as the JavaScript file name.&lt;/p&gt;

&lt;h3&gt;
  
  
  🧾 &lt;strong&gt;Showing the posts (10 lines)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;index.liquid&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
  {% for item in devtoapi.posts limit:5 %}
    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{ item.url }}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ item.title }}&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;{{ item.description }}&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Categories: {{ item.tag_list | join: ', ' }}&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Published on {{ item.published_timestamp | date: "%A %e %B %Y at %I:%M%P" }}&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  {% endfor %}
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Showing the posts is the simple case of creating a wrapper HTML structure (in this case I chose an unordered list), then using &lt;a href="https://shopify.github.io/liquid"&gt;Liquid tags&lt;/a&gt; to output the data from the &lt;strong&gt;devtoapi.posts&lt;/strong&gt; collection. &lt;/p&gt;

&lt;p&gt;This is the collection that is created automatically by 11ty when it runs the &lt;code&gt;devtoapi.js&lt;/code&gt; data file.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎉 &lt;strong&gt;That's it!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To build and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install
&lt;/span&gt;npx @11ty/eleventy &lt;span class="nt"&gt;--input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;_source &lt;span class="nt"&gt;--serve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The built index.html will be saved to the &lt;code&gt;_site&lt;/code&gt; directory, and the &lt;code&gt;--serve&lt;/code&gt; parameter will start a BrowserSync server to serve that folder. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: This will only fetch the posts &lt;strong&gt;at build time&lt;/strong&gt;, therefore if you make a new post, you'll need to &lt;strong&gt;re-run the build&lt;/strong&gt;!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🚀 Next Steps
&lt;/h2&gt;

&lt;p&gt;If you already use 11ty for your static site, just add the above code into any of your templates and you're good to go.&lt;/p&gt;

&lt;p&gt;Explore the &lt;a href="https://dev.to/api/articles?username=ndsn"&gt;API response&lt;/a&gt; to see which fields you could include in your template.&lt;/p&gt;

&lt;p&gt;If you use another Static Site generator, you should be able to create a fairly lightweight wrapper around the API that you can use in your templates.&lt;/p&gt;

&lt;p&gt;For the more advanced, you could even use a Dev.to API Key to call the &lt;code&gt;/articles/me&lt;/code&gt; endpoint to get additional stats about your posts as well as the raw markdown of the content.&lt;/p&gt;

&lt;p&gt;As mentioned above, this will &lt;strong&gt;only fetch posts at build time&lt;/strong&gt;, so if you want to include new posts, you'll need to &lt;strong&gt;rebuild and re-deploy your site&lt;/strong&gt; after the API updates. For the more adventurous, you could explore automating this process using &lt;a href="https://docs.dev.to/api/#operation/createWebhook"&gt;Dev.to webhooks&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  👨‍🦰 Let me know what you think!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Have you used 11ty and JavaScript Data Files before?&lt;/li&gt;
&lt;li&gt;Have you put your Dev.to posts on your own site?&lt;/li&gt;
&lt;li&gt;Would you recommend a different way?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;🧡 Tom Anderson&lt;br&gt;
&lt;a href="https://www.thomas-anderson.net/?utm_source=devto"&gt;www.thomas-anderson.net&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Liked something I did and want to help me out?&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/ndsn"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3lkhkJJp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Buy%2520me%2520a%2520coffee-orange%3Flogo%3DBuy%2520Me%2520A%2520Coffee%26logoColor%3Dwhite" alt="Buy me a coffee"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>eleventy</category>
      <category>tutorial</category>
      <category>jamstack</category>
    </item>
    <item>
      <title>Google Search for Datasets</title>
      <dc:creator>Tom Anderson</dc:creator>
      <pubDate>Wed, 29 Jul 2020 20:01:20 +0000</pubDate>
      <link>https://dev.to/ndsn/google-search-for-datasets-484k</link>
      <guid>https://dev.to/ndsn/google-search-for-datasets-484k</guid>
      <description>&lt;h1&gt;
  
  
  🔧 There's a tool for everything nowadays
&lt;/h1&gt;

&lt;p&gt;A colleague of mine showed something to me today that I had never come across before and I was impressed 👍:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;&lt;a href="https://datasetsearch.research.google.com" rel="noopener noreferrer"&gt;Google Dataset Search&lt;/a&gt; 🔍&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;p&gt;A search engine (powered by Google, who aren't too bad at that search thing) that returns results back as a semi-curated list of &lt;strong&gt;datasets 📚&lt;/strong&gt; available on the web, regardless of where they are hosted!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(It's been around for &lt;a href="https://blog.google/products/search/discovering-millions-datasets-web/" rel="noopener noreferrer"&gt;quite a while&lt;/a&gt; now too!)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🤷‍♂️ So what?
&lt;/h2&gt;

&lt;p&gt;One of the biggest problems with both learning and understanding topics like machine learning and big data analytics is getting access to large datasets.&lt;/p&gt;

&lt;p&gt;Lots of sites (such as &lt;a href="https://kaggle.com" rel="noopener noreferrer"&gt;Kaggle&lt;/a&gt;) have made awesome inroads into making datasets more accessible but they can't possibly host everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And that's where properly indexing and search can help.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google has a good history in making popular search engines. But it's the approach behind dataset search that I'm more interested in: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Standardisation 📋&lt;/em&gt; - it's up to dataset owners to make their dataset indexable in a specific format, so it can be found more easily and more precisely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give me an example! 🧐
&lt;/h2&gt;

&lt;p&gt;Okay, try searching for "programming":&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://datasetsearch.research.google.com/search?query=Programming" rel="noopener noreferrer"&gt;https://datasetsearch.research.google.com/search?query=Programming&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5golqcyfithm4bwqm3j2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5golqcyfithm4bwqm3j2.png" alt="Search Results"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What do we see?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🗂️ Three different datasets.&lt;/li&gt;
&lt;li&gt;💡 Three potential project ideas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🌍 Three different data sources&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's that last one that works for me - I don't need to go through curated lists of data set sources or validate the security of a dataset found in a Reddit post. &lt;strong&gt;I can just search.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let me know what you think!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Have you used dataset search?&lt;/li&gt;
&lt;li&gt;Where do you get your datasets?&lt;/li&gt;
&lt;li&gt;What do you use public datasets for?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;🧡 Tom Anderson&lt;br&gt;
&lt;a href="https://www.thomas-anderson.net/?utm_source=devto" rel="noopener noreferrer"&gt;www.thomas-anderson.net&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Liked something I did and want to help me out?&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/ndsn" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FBuy%2520me%2520a%2520coffee-orange%3Flogo%3DBuy%2520Me%2520A%2520Coffee%26logoColor%3Dwhite" alt="Buy me a coffee"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>dataset</category>
      <category>todayilearned</category>
      <category>google</category>
    </item>
    <item>
      <title>Tips and Tricks for using Google Cloud Shell as a Cloud IDE</title>
      <dc:creator>Tom Anderson</dc:creator>
      <pubDate>Sun, 26 Jul 2020 17:16:58 +0000</pubDate>
      <link>https://dev.to/ndsn/tips-and-tricks-for-using-google-cloud-shell-as-a-cloud-ide-4cek</link>
      <guid>https://dev.to/ndsn/tips-and-tricks-for-using-google-cloud-shell-as-a-cloud-ide-4cek</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Already a fan of Google Cloud Shell? For just tips and tricks, without the introduction, click here.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Tips and Tricks

&lt;ul&gt;
&lt;li&gt;Shortcuts&lt;/li&gt;
&lt;li&gt;Customisation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Wrapping Up&lt;/li&gt;

&lt;/ul&gt;

&lt;h1&gt;
  
  
  Introduction &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;At the start of 2020, I made the decision to use a Chromebook as my primary device and move to SaaS/web-based tools permanently. If it's something you're considering - I'd &lt;em&gt;highly&lt;/em&gt; recommend it and there are tons of articles on the web outlining why you should and how you can make the transition.&lt;/p&gt;

&lt;p&gt;For me the reason was simple: &lt;strong&gt;The Browser &amp;gt; A Device&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But one thing that I really struggled with for a long-time was having a cloud-based replacement for my development environment. The problem can be addressed in a number of different ways though, and I would highly recommend reading the following for more in-depth views on the topics:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/better-programming/my-favorite-cloud-ides-e6afaa94d96b" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afill%3A88%3A88%2F2%2AxCAj_hHhMUomcf9RXcTG9Q.png" alt="David Kramer"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/better-programming/my-favorite-cloud-ides-e6afaa94d96b" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;My Favorite Cloud IDEs. Eliminate the hassle of managing… | by David Kramer | Better Programming&lt;/h2&gt;
      &lt;h3&gt;David Kramer ・ &lt;time&gt;Feb 19, 2021&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fmedium-f709f79cf29704f9f4c2a83f950b2964e95007a3e311b77f686915c71574fef2.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/mikenikles" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F249655%2Fcaa17aa9-9b30-43f0-974b-9cd1dc06f89f.png" alt="mikenikles"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/mikenikles/why-i-use-a-cloud-based-development-environment-and-how-you-can-too-4l8a" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Why I use a cloud-based development environment and how you can too&lt;/h2&gt;
      &lt;h3&gt;Mike ・ Mar 31 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ide&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#editor&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#vscode&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/svenefftinge" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F118823%2Ff46f3cbe-ec88-4ccf-be31-f06490aa1bc9.jpeg" alt="svenefftinge"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/svenefftinge/theia-1-0-finally-a-good-browser-ide-3ok0" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Theia 1.0 - Finally a Good Browser IDE&lt;/h2&gt;
      &lt;h3&gt;Sven Efftinge ・ Mar 31 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#vscode&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opensource&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;





&lt;p&gt;So what did I land on? &lt;strong&gt;&lt;a href="https://cloud.google.com/shell" rel="noopener noreferrer"&gt;Google Cloud Shell&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why? It's basically a &lt;strong&gt;free Linux development machine&lt;/strong&gt; accessed through the web browser or a mobile app.&lt;/p&gt;

&lt;p&gt;Is it perfect? Will it work for every developer? &lt;strong&gt;No.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While alternatives exist, I find the flexibility and accessibility of Google Cloud Shell to be superior for my workflows than the likes of &lt;a href="https://codesandbox.io" rel="noopener noreferrer"&gt;CodeSandbox&lt;/a&gt; or &lt;a href="https://gitpod.io" rel="noopener noreferrer"&gt;GitPod&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So let's move onto what Google Cloud Shell actually is, and what we get for our low, low price of £0 p/m.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Google Cloud Shell?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/shell" rel="noopener noreferrer"&gt;Google Cloud Shell&lt;/a&gt; is essentially a web-based interface to an ephemeral Linux virtual machine hosted in the Google Cloud Platform.&lt;/p&gt;

&lt;p&gt;More specifically, &lt;a href="https://cloud.google.com/shell/docs/how-cloud-shell-works" rel="noopener noreferrer"&gt;Google provides you&lt;/a&gt; with an &lt;a href="https://cloud.google.com/compute/docs/machine-types#e2_shared-core_machine_types" rel="noopener noreferrer"&gt;e2-small&lt;/a&gt; Linux virtual machine with 2 vCPU cores (limited to 25% &lt;a href="https://wikipedia.org/wiki/CPU_time" rel="noopener noreferrer"&gt;CPU Time&lt;/a&gt;, but burstable) and 2GB RAM and a 1Gbps (125MB/s download/upload) network connection.&lt;/p&gt;

&lt;p&gt;And if that's not enough for your workloads, you can &lt;em&gt;"boost"&lt;/em&gt; your Cloud Shell machine which will re-provision all sessions for the following 24 hours on an &lt;a href="https://cloud.google.com/compute/docs/machine-types#e2_shared-core_machine_types" rel="noopener noreferrer"&gt;e2-medium&lt;/a&gt; instance type instead. This boosts the 2 vCPU cores to 50% &lt;a href="https://wikipedia.org/wiki/CPU_time" rel="noopener noreferrer"&gt;CPU Time&lt;/a&gt; and doubles both the RAM (to 4GB) and the network connection (to 2Gbps/250MB/s). &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Use boost only when you need! You are subject to certain &lt;a href="https://cloud.google.com/shell/docs/limitations#usage_limits" rel="noopener noreferrer"&gt;"limits"&lt;/a&gt;.&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;Not bad! The catch?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;The VM only lasts for the life of the session and gets deleted an hour after you leave the session.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Okay fair enough, what about storage?&lt;/p&gt;

&lt;p&gt;That's where things get interesting, from the docs:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cloud Shell provisions 5 GB of free persistent disk storage mounted as your &lt;code&gt;$HOME&lt;/code&gt; directory on the virtual machine instance. This storage is on a per-user basis and is available across projects. &lt;strong&gt;All files you store in your home directory&lt;/strong&gt;, including installed software, scripts and user configuration files like .bashrc and .vimrc, &lt;strong&gt;persist between sessions&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So when the virtual machine gets terminated and discarded, your $HOME directory &lt;strong&gt;does not&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;This means that anything you configure, install or store in your $HOME directory can be used every time you load up Cloud Shell, but anything outside of that directory is wiped away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;This is very powerful if used correctly.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For instance, imagine you want to clone and work on your favourite GitHub repo: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone that repo into &lt;code&gt;/tmp/my-project&lt;/code&gt; and when the VM is discarded and deleted, those files will be gone. &lt;/li&gt;
&lt;li&gt;Clone it into &lt;code&gt;$HOME/my-project&lt;/code&gt; and you can access those files over and over again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Flexibility is a powerful thing! (Within the &lt;a href="https://cloud.google.com/shell/docs/limitations#usage_limits" rel="noopener noreferrer"&gt;limits&lt;/a&gt; of course!)&lt;/p&gt;

&lt;p&gt;So how do you access it? Through the web browser. &lt;/p&gt;

&lt;p&gt;But there are a few things you need to do beforehand:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign-up/Sign-in to a &lt;a href="https://accounts.google.com/SignUp" rel="noopener noreferrer"&gt;Google Account&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Access the &lt;a href="http://console.cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud Platform Console&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Click on the "Activate Cloud Shell" icon.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5pg8dgg6aefudebwmksh.png" alt="Activate Cloud Shell"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once it loads up you'll be presented with the two parts of Google Cloud Shell:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The terminal.&lt;/li&gt;
&lt;li&gt;The Theia-based Code Editor.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But that's not the only way to access it - there's also a &lt;a href="https://cloud.google.com/console-app" rel="noopener noreferrer"&gt;mobile application&lt;/a&gt; for iOS and Android. &lt;/p&gt;

&lt;p&gt;So you can access it from literally anywhere!&lt;/p&gt;

&lt;p&gt;And it's that flexibility and accessibility that has driven me to write these tips and tricks. You can do a &lt;em&gt;lot&lt;/em&gt; with Google Cloud Shell if you're willing to spend some time with it.&lt;/p&gt;

&lt;p&gt;So, onto my tips and tricks!&lt;/p&gt;




&lt;h1&gt;
  
  
  Tips and Tricks &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Shortcuts &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Accessing Cloud Shell through the Cloud console is not the only way you can get to it!&lt;/p&gt;




&lt;h3&gt;
  
  
  Open Cloud Shell Directly
&lt;/h3&gt;

&lt;p&gt;Here's a link to open Google Cloud Shell directly in its own tab:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

https://console.cloud.google.com/cloudshell/editor?cloudshell=true&amp;amp;shellonly=true


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: The '&amp;amp;shellonly=true' means 'Don't open the code editor'&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Open Cloud Shell Code Editor Directly
&lt;/h3&gt;

&lt;p&gt;If you want to open &lt;strong&gt;just&lt;/strong&gt; the code editor &lt;em&gt;without&lt;/em&gt; the terminal:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

https://ssh.cloud.google.com/devshell/proxy?authuser=0&amp;amp;port=970&amp;amp;cloudshell_retry=true&amp;amp;devshellProxyPath=%2F&amp;amp;environment_name=default&amp;amp;environment_id=default


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: If your Cloud Shell VM isn't active, this link won't work!&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Tip: Append &lt;code&gt;#/path/to/directory&lt;/code&gt; to the URL to open that directory in the editor!&lt;/em&gt; &lt;/p&gt;


&lt;h3&gt;
  
  
  Clone a GitHub Repo via its URL.
&lt;/h3&gt;

&lt;p&gt;Much like the way GitPod behaves, you can clone any GitHub or BitBucket repository automatically through visiting a specific URL:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

https://ssh.cloud.google.com/cloudshell/editor?shellonly=true&amp;amp;cloudshell_git_repo={URL LINK TO REPO}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: Cloud Shell will clone any repo into the &lt;code&gt;$HOME/cloudshell_open&lt;/code&gt; directory.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Hint: Other parameters for this URL can be found on &lt;a href="https://cloud.google.com/shell/docs/open-in-cloud-shell" rel="noopener noreferrer"&gt;this page&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Clone the GitHub Repo from the repo itself
&lt;/h3&gt;

&lt;p&gt;Or, if you add the following bookmark to your bookmarks bar, it will automatically take the URL of the page you are on and clone that.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nx"&gt;javascript&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://ssh.cloud.google.com/cloudshell/editor?shellonly=true&amp;amp;cloudshell_git_repo=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nf"&gt;encodeURIComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Add a 'Clone this in Cloud Shell' badge to your repo
&lt;/h3&gt;

&lt;p&gt;You can also embed a &lt;a href="https://shields.io" rel="noopener noreferrer"&gt;Shields.io&lt;/a&gt; badge to our repo's README to allow others to automatically clone the repo to their Cloud Shell.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/driminary/driminary.git&amp;amp;shellonly=true" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FGoogle%2520Cloud%2520Shell-Clone-5391FE%3Fstyle%3Dfor-the-badge%26logo%3Dgnu-bash%26logoColor%3Dwhite" alt="Open in Cloud Shell"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

[![Open in Cloud Shell](https://img.shields.io/badge/Google%20Cloud%20Shell-Clone-5391FE?style=for-the-badge&amp;amp;logo=gnu-bash&amp;amp;logoColor=white)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=***{REPO URL HERE}***&amp;amp;shellonly=true)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Customisation &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;For those who want to change the look and feel of Cloud Shell or want to really stretch the boundaries of what it can do, there are a few things we can change:&lt;/p&gt;


&lt;h3&gt;
  
  
  Custom Startup Script (.customize_environment)
&lt;/h3&gt;

&lt;p&gt;If you find yourself needing tools or packages that aren't included in the list of packages that Cloud Shell has pre-installed, create a file called &lt;code&gt;.customize_environment&lt;/code&gt; in your &lt;code&gt;$HOME&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;As described in the &lt;a href="https://cloud.google.com/shell/docs/configuring-cloud-shell#environment_customization" rel="noopener noreferrer"&gt;docs&lt;/a&gt;, this script is run as root when the VM &lt;strong&gt;is created&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You could install packages, make configuration changes or just remove some of the things Google bakes into the image.&lt;/p&gt;

&lt;p&gt;When the script completes, the file &lt;code&gt;/google/devshell/customize_environment_done&lt;/code&gt; is created. Log output is available at &lt;code&gt;/var/log/customize_environment&lt;/code&gt;.&lt;/p&gt;


&lt;h3&gt;
  
  
  Remove the Google sign-in message
&lt;/h3&gt;

&lt;p&gt;On every login to Cloud Shell, you will see the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Welcome to Cloud Shell. Type "help" to get started.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is part of the &lt;code&gt;init_help.sh&lt;/code&gt; script located at &lt;code&gt;/etc/profile.d/init_help.sh&lt;/code&gt; that runs on every login. &lt;/p&gt;

&lt;p&gt;Unfortunately, to stop this message appearing on every login we need to delete this file as part of our &lt;code&gt;.customize_environment&lt;/code&gt; script. (See below)&lt;/p&gt;


&lt;h3&gt;
  
  
  Stop README-cloudshell.txt being recreated
&lt;/h3&gt;

&lt;p&gt;If you delete the README-cloudshell.txt file from your $HOME directory, you will notice that Google helpfully recreates it the next time we log in.&lt;/p&gt;

&lt;p&gt;This is part of the &lt;code&gt;init_help.sh&lt;/code&gt; script located at &lt;code&gt;/etc/profile.d/init_help.sh&lt;/code&gt; that runs on every login. &lt;/p&gt;

&lt;p&gt;Unfortunately, to stop this message appearing on every login we need to delete this file as part of our &lt;code&gt;.customize_environment&lt;/code&gt; script. (See below)&lt;/p&gt;


&lt;h3&gt;
  
  
  Remove the init_help.sh script
&lt;/h3&gt;

&lt;p&gt;To remove the &lt;code&gt;/etc/profile.d/init_help.sh&lt;/code&gt; script and stop the above two behaviours, add the following to your &lt;code&gt;.customize_environment&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="c"&gt;# File to remove&lt;/span&gt;
&lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/etc/profile.d/init_help.sh"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="nv"&gt;$file&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nv"&gt;$file&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: Deleting this file will also delete the messages that tell you which GCP project you have selected. You can see how to add these back in with the "customise the login message" tip.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Note: This also removes the 'help' alias.&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Customise the login message
&lt;/h3&gt;

&lt;p&gt;To add a custom welcome message, you just need to copy in a bash script to &lt;code&gt;/etc/profile.d/&lt;/code&gt; that will get executed on login. &lt;/p&gt;

&lt;p&gt;However, when the script runs it does not have access to the &lt;code&gt;$HOME&lt;/code&gt; directory so any scripts will need to be hosted externally.&lt;/p&gt;

&lt;p&gt;Add code similar to this to your &lt;code&gt;.customize_environment&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Getting custom login message script...'&lt;/span&gt;
wget &lt;span class="nt"&gt;-P&lt;/span&gt; /etc/profile.d/ https://URL/path/to/your/init_welcome.sh
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x /etc/profile.d/init_welcome.sh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Note: Replace &lt;code&gt;URL/path/to/your/init_welcome.sh&lt;/code&gt; script with a publicly accessible bash script.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As an example, this is the bash script I use for my login:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Hint: Lines 8-13 will print out the current GCP project, exactly as in the original init_help.sh script.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This means my Cloud Shell login looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwg4psks0095bmvergbpr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwg4psks0095bmvergbpr.png" alt="My Cloud Shell Login"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Customise bash prompt (and keep GCP project functionality)
&lt;/h3&gt;

&lt;p&gt;As with any Linux environment, you can customise the Bash prompt to add any number of things by changing the PS1 variable. In Google Cloud Shell, the PS1 variable is set by the &lt;code&gt;/google/devshell/bashrc.google&lt;/code&gt; file on login, which is referenced by your &lt;code&gt;$HOME/.bashrc&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note: This file contains a number of Cloud Shell-specific settings so I wouldn't recommend removing this source from your .bashrc.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To replace the prompt format, set the PS1 variable &lt;strong&gt;after&lt;/strong&gt; the &lt;code&gt;source "/google/devshell/bashrc.google"&lt;/code&gt; block.&lt;/p&gt;

&lt;p&gt;If like me, you want to augment or modify the existing prompt, add the following to the end of your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PS1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'🌀 \e[1m\033[38;5;202m\]\u@ndsn-shell \e[0m\[\033[00m\]in \e[1m\[\033[1;34m\]\w\e[0m$([[ -n $DEVSHELL_PROJECT_ID ]] &amp;amp;&amp;amp; printf " \[\033[1;33m\](%s)" ${DEVSHELL_PROJECT_ID} )\[\033[00m\]'&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="nv"&gt;$TMUX&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;export &lt;/span&gt;PS1+&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'\[\033k$([[ -n $DEVSHELL_PROJECT_ID ]] &amp;amp;&amp;amp; printf "(%s)" ${DEVSHELL_PROJECT_ID} || printf "cloudshell")\033\\\]'&lt;/span&gt;
&lt;span class="k"&gt;fi
&lt;/span&gt;&lt;span class="nb"&gt;export &lt;/span&gt;PS1+&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\0&lt;/span&gt;&lt;span class="s2"&gt;33[38;5;2m&lt;/span&gt;&lt;span class="se"&gt;\]\$&lt;/span&gt;&lt;span class="s2"&gt;(__git_ps1 ' [⎇ %s]')&lt;/span&gt;&lt;span class="se"&gt;\[\0&lt;/span&gt;&lt;span class="s2"&gt;33[00m&lt;/span&gt;&lt;span class="se"&gt;\]&lt;/span&gt;&lt;span class="s2"&gt; ↣ "&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Which results in:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

🌀 me@ndsn-shell in /my/path (gcp-project-name) [⎇ master] ↣


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Screenshot:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fstumsn6vi20zkse0ne83.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fstumsn6vi20zkse0ne83.png" alt="My Cloud Shell Prompt"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Install Chromium dependencies (for headless browser testing)
&lt;/h3&gt;

&lt;p&gt;I like to use puppeteer for headless browser testing, but when it tries to download and use Chromium there are a lot of dependencies that aren't installed by default. Install them with:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Note: Source: &lt;a href="https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix" rel="noopener noreferrer"&gt;Puppeteer Troubleshooting&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Install code-server (Web-based VSCode)
&lt;/h3&gt;

&lt;p&gt;While the Theia-based code editor that comes with Cloud Shell is &lt;em&gt;okay&lt;/em&gt;, it doesn't support much modification. You can't add plugins for other languages and you don't have any nice git integration.&lt;/p&gt;

&lt;p&gt;A while ago, Christian Hees outlined in a &lt;a href="https://medium.com/google-cloud/how-to-run-visual-studio-code-in-google-cloud-shell-354d125d5748" rel="noopener noreferrer"&gt;Medium post&lt;/a&gt; how it was possible to install and run code-server (web-based VSCode) on Google Cloud Shell. This meant that we could extend our code editing capabilities within Cloud Shell and allowed us to extend the use-cases for which it was useful.&lt;/p&gt;

&lt;p&gt;His steps were simple and still work, but there is now an even quicker way to install and run code-server from the &lt;a href="https://github.com/cdr/code-server#quick-install" rel="noopener noreferrer"&gt;official docs&lt;/a&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://code-server.dev/install.sh | sh &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;standalone
&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.local/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Which installs to &lt;code&gt;$HOME/.local&lt;/code&gt;. Then to start the application you can just run &lt;code&gt;code-server --auth=none&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Having &lt;code&gt;code-server&lt;/code&gt; on your PATH may not persist across sessions, so you may need to periodically run &lt;code&gt;PATH="$HOME/.local/bin:$PATH"&lt;/code&gt; to get the &lt;code&gt;code-server&lt;/code&gt; command to work.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hint: While perfectly usable in normal mode, use Boost Mode (above) to get a snappier experience.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;I like to change the &lt;code&gt;~/.config/code-server/config.yml&lt;/code&gt; to the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;bind-addr&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;127.0.0.1:5000&lt;/span&gt;
&lt;span class="na"&gt;auth&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;none&lt;/span&gt;
&lt;span class="na"&gt;cert&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Which changes the port to 5000 and disables the authentication (since Cloud Shell handles this).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: There is an open issue with code-server at the moment that prevents GitHub sign-in. See &lt;a href="https://github.com/cdr/code-server/issues/1883" rel="noopener noreferrer"&gt;here&lt;/a&gt; for more details and a workaround.&lt;/em&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Wrapping Up &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;I hope that some of these tips and tricks will enable you to make Google Cloud Shell work for your particular workflow.&lt;/p&gt;

&lt;p&gt;While it may not be a suitable cloud development environment for all workloads, it is totally free and with a little customisation can be a powerful extension to your productivity toolset.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let me know what you think!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Did any these tips or tricks help?&lt;/li&gt;
&lt;li&gt;Any other tips or tricks that you have for Google Cloud Shell?&lt;/li&gt;
&lt;li&gt;What do you use for your Cloud Development Environment?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;🧡 Tom Anderson&lt;br&gt;
&lt;a href="https://www.thomas-anderson.net/?utm_source=devto" rel="noopener noreferrer"&gt;www.thomas-anderson.net&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Liked something I did and want to help me out?&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/ndsn" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FBuy%2520me%2520a%2520coffee-orange%3Flogo%3DBuy%2520Me%2520A%2520Coffee%26logoColor%3Dwhite" alt="Buy me a coffee"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>google</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why I love 11ty (and JAMstack) for building static sites...</title>
      <dc:creator>Tom Anderson</dc:creator>
      <pubDate>Thu, 23 Jul 2020 18:45:34 +0000</pubDate>
      <link>https://dev.to/ndsn/why-i-love-11ty-and-jamstack-for-building-static-sites-2o8f</link>
      <guid>https://dev.to/ndsn/why-i-love-11ty-and-jamstack-for-building-static-sites-2o8f</guid>
      <description>&lt;h2&gt;
  
  
  Web Development in 2020 is confusing...
&lt;/h2&gt;

&lt;p&gt;I'll be honest, it's been &lt;strong&gt;&lt;em&gt;really&lt;/em&gt;&lt;/strong&gt; hard to keep up with web development technologies over the past 10 years.&lt;/p&gt;

&lt;p&gt;For someone like me (someone who understands &lt;em&gt;basic&lt;/em&gt; HTML, CSS and JavaScript) the myriad of frameworks can be extremely daunting. I feel like the barrier to entry for a lot of them is so high and they all seem to be overkill for what I need.&lt;/p&gt;

&lt;p&gt;David Wickes seems to agree:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/gypsydave5" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F67380%2Fc0c013a8-7b5f-47d1-9e1b-3997106c7c81.jpeg" alt="gypsydave5"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/gypsydave5/why-you-shouldnt-use-a-web-framework-3g24" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Why You Shouldn't Use A Web Framework&lt;/h2&gt;
      &lt;h3&gt;David Wickes ・ Jul 26 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#framework&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#react&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;But now it seems like there's a new trend emerging that seems oddly familiar - &lt;a href="https://jamstack.org/" rel="noopener noreferrer"&gt;JAMstack&lt;/a&gt;. Rather than these highly reactive and fully-loaded websites, why don't we just generate static files and serve those! (How very 90's!)&lt;/p&gt;

&lt;h2&gt;
  
  
  Turn JAMstack up to 11ty
&lt;/h2&gt;

&lt;p&gt;Upon first glance at some of the &lt;a href="https://www.staticgen.com/" rel="noopener noreferrer"&gt;suggested tools&lt;/a&gt; to generate JAMstack sites, a lot of them still had &lt;strong&gt;way&lt;/strong&gt; too much bloat. When I came across &lt;a href="//11ty.dev"&gt;11ty&lt;/a&gt; (pronounced 'eleventy) though, it immediately appealed and was super easy to get to grips with.&lt;/p&gt;

&lt;p&gt;Rather than being a framework used at runtime or some server-side 'on-the-fly' site generator, 11ty runs as a &lt;strong&gt;compiler&lt;/strong&gt;. It takes inputs, glues them together (really quickly!) and outputs a static site. Simple. &lt;/p&gt;

&lt;p&gt;There are several great tutorials on the official 11ty site for beginners, but Omar Sinan does a great job here on Dev.to:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/oohsinan" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F865%2F69c6db1d-1438-4e37-bc24-84989acb3159.jpeg" alt="oohsinan"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/oohsinan/create-a-blog-in-less-than-20-lines-of-code-using-11ty-3oh0" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Create a Blog in Less Than 20 Lines of Code Using 11ty&lt;/h2&gt;
      &lt;h3&gt;Omar Sinan ・ Jan 10 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#11ty&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;For me, I'm a very visual person so I've tried to illustrate how 11ty works for my development needs in this diagram:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsgo9z7ui1rzn3r7snv8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsgo9z7ui1rzn3r7snv8p.png" alt="How 11ty works"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;(FYI, I do all my diagrams in &lt;a href="https://excalidraw.com" rel="noopener noreferrer"&gt;Excalidraw&lt;/a&gt; - read about why &lt;a href="https://medium.com/@ndsn/why-excalidraw-is-mightier-than-the-pen-and-the-sword-47ecea8e81" rel="noopener noreferrer"&gt;here&lt;/a&gt;!)&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Let's break it down
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Input Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest selling points for 11ty for me. One of the biggest issues I had with trying to build sites in pure HTML was that if I wanted to re-use a nav-bar or footer I had to literally copy and paste the code. &lt;/p&gt;

&lt;p&gt;11ty does away with this and lets us use a huge array of templating languages, most notably &lt;a href="https://shopify.github.io/liquid" rel="noopener noreferrer"&gt;Liquid&lt;/a&gt; and Markdown - and even lets us mix and match. Perfect! &lt;/p&gt;

&lt;p&gt;But we can also augment our input templates with data (either local or remote) and generate static files based on our layouts and data at compile time. This makes it &lt;a href="https://github.com/11ty/eleventy-base-blog" rel="noopener noreferrer"&gt;super easy to create blog sites&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have files that you don't want 11ty to modify, like CSS or images? Just pass them through in the config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;eleventyConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addPassthroughCopy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;**/*.jpg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;eleventyConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addPassthroughCopy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;path/to/css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And they'll just appear in the finished build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Static Site&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The output of 11ty's magic - it's just pure HTML, CSS (and JavaScript/Images if you have them).&lt;/p&gt;

&lt;p&gt;Which means that two things suddenly become a &lt;strong&gt;lot&lt;/strong&gt; easier:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deployment - &lt;em&gt;Host your site literally anywhere that accepts static files. Or go for JAMstack-specific hosting providers like Netlify and Vercel.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Testing - &lt;em&gt;Can be as simple as loading up the HTML file in your browser, or you can integrate automated testing with tools like Cypress or Jest/Puppeteer.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  But I want more!
&lt;/h2&gt;

&lt;p&gt;Sure - other static site generators might do more. &lt;/p&gt;

&lt;p&gt;And a fully-fledged framework might work better for project X or 'my-react-app25'. &lt;/p&gt;

&lt;p&gt;But for someone who just wants to re-use their Navbar and Footer across all pages of their personal website or create a blog that they can host anywhere, I couldn't recommend 11ty highly enough.&lt;/p&gt;

&lt;p&gt;I even rebuilt &lt;a href="https://github.com/Driminary/thomas-anderson.net" rel="noopener noreferrer"&gt;my own website&lt;/a&gt; using 11ty*!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(*Yes, I used TailwindCSS to style it. CSS is hard. 😉)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let me know what you think!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Have you used 11ty and/or do you prefer a different static site generator? &lt;/li&gt;
&lt;li&gt;Why?&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;🧡 Tom Anderson&lt;br&gt;
&lt;a href="https://www.thomas-anderson.net/?utm_source=devto" rel="noopener noreferrer"&gt;www.thomas-anderson.net&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Liked something I did and want to help me out?&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/ndsn" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FBuy%2520me%2520a%2520coffee-orange%3Flogo%3DBuy%2520Me%2520A%2520Coffee%26logoColor%3Dwhite" alt="Buy me a coffee"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>eleventy</category>
      <category>html</category>
      <category>jamstack</category>
    </item>
  </channel>
</rss>
