<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Edgardo Avilés-López on Medium]]></title>
        <description><![CDATA[Stories by Edgardo Avilés-López on Medium]]></description>
        <link>https://medium.com/@eavl?source=rss-6a80921d9d60------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MdvWTYH24G2XP6FY_9i0WA.png</url>
            <title>Stories by Edgardo Avilés-López on Medium</title>
            <link>https://medium.com/@eavl?source=rss-6a80921d9d60------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 12:14:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eavl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to get custom icons in Safari’s favorites when on the Start Page]]></title>
            <link>https://eavl.medium.com/how-to-get-custom-icons-in-safaris-favorites-when-on-the-start-page-f9807a239aaa?source=rss-6a80921d9d60------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9807a239aaa</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[customization]]></category>
            <category><![CDATA[safari]]></category>
            <category><![CDATA[bookmarks]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Edgardo Avilés-López]]></dc:creator>
            <pubDate>Sat, 24 Oct 2020 06:05:04 GMT</pubDate>
            <atom:updated>2020-10-24T07:46:48.256Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>a.k.a. “fixing that non-existing Gmail icon that is keeping you awake”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJ49sctNDIUytLd_zEA76g.png" /><figcaption>Hat tip to <a href="https://medium.com/u/e8d7e5560302">David Lanham</a>’s for his amazing <a href="https://dlanham.com/">wallpapers</a></figcaption></figure><p>I just got a new Mac and I’ve been spending a ridiculous amount of hours setting everything up just in the way I think things should look and be. To my surprise, some of Google’s sites (Gmail in particular) don’t have any <a href="https://webhint.io/docs/user-guide/hints/hint-apple-touch-icons/">touch icons</a> so they will appear as gray boxes in Safari’s Start Page.</p><p>Searching around I found <a href="https://apple.stackexchange.com/questions/294606/how-to-get-icons-in-safari-favorites-aka-favicons-to-display-correctly">this post</a> explaining the issue and how to fix it. The post also contains a script that you can download and run to automatically fix all the icons but, for some reason it wasn’t working for me. So, taking that script as a guide, here is how I managed to do it.</p><p>First, identity the Favorites item that doesn’t have an icon (or the one you want to customize). I changed my “Gmail” favorite address to this:</p><pre>https://mail.google.com</pre><p>Now, here’s the technical part. Use your terminal and go to the ~/Library/Safari/Touch Icons Cache/ folder then open the icons cache database by running this command:</p><pre>sqlite3 TouchIconCacheSettings.db</pre><p>Now, let’s look at all the entries in that database by running:</p><pre>SELECT * FROM cache_settings;</pre><p>You will see a lot of entries that look similar to these lines:</p><pre>60|mail.google.com|625208650.292902|1|2|0|1||0|<br>61|github.com|625206977.849832|0|1|1|1||1|<br>62|www.instagram.com|625208128.354436|0|1|1|1||1|</pre><p>The one entry we are interested is “mail.google.com” (in my case). Now, next to the decimal number there are columns with numbers. The 3rd number is “0” in this example, we need to change it to “1” so Safari thinks the file was downloaded (if you are trying to replace an existing icon then it should be set to 1 already). To change that number from 0 to 1 run this:</p><pre>UPDATE cache_settings SET icon_is_in_cache=1 WHERE host=&#39;mail.google.com&#39; LIMIT 1;</pre><p>Make sure to change the string next to “host” for the one entry that you are trying to update. To exit the SQLite prompt write .exit then press Enter. Now let’s take care of the actual icon. The downloaded icons are stored in the ~/Library/Safari/Touch Icons Cache/Images/ folder. The name of the file is an MD5 hash of the host part of the favorite’s address (only the host part, without “https” and the rest of the URL) plus the “.png” extension. To calculate the MD5 of the host (or any string) use this command:</p><pre>md5 -q -s &#39;mail.google.com&#39; | tr a-f A-F</pre><p>The PNG file needs to have at least 144×144 pixels (don’t forget to include the “.png” extension in the icon filename). I used Photoshop to make one then stored it with the filename BE5CAB0695415D9363D18AD1345C73EB.png (which is the corresponding MD5 hash for my Gmail bookmark).</p><p>To wrap up, just restart Safari and your custom icon should show up and then you can finally go to bed in peace.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9807a239aaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s Talk About Sets]]></title>
            <link>https://medium.com/lifion-engineering/lets-talk-about-sets-813dfeb2185?source=rss-6a80921d9d60------2</link>
            <guid isPermaLink="false">https://medium.com/p/813dfeb2185</guid>
            <category><![CDATA[tc39]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[set]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Edgardo Avilés-López]]></dc:creator>
            <pubDate>Fri, 01 Mar 2019 22:29:11 GMT</pubDate>
            <atom:updated>2019-03-01T22:29:11.077Z</atom:updated>
            <content:encoded><![CDATA[<h4>A re-introduction to JavaScript Sets and the new Set methods</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uaQQ1c1a4k3_HmMbQCwrcQ.png" /></figure><p>Let’s talk about you and me and how we used to find unique items before ES6. We really only had two ways to do it (if you had another one let me know). On the first one, we would create a new emtpy object, iterate through the items we wanted to deduplicate, we would create a new property using the item as the key and something like “true” as the value, then we would get the list of keys of that new object and we were done. In the second way, we would create a new empty array, iterate through the items, and for each item, check if the item existed in the array, if it was already there, continue, if not, add it. By the end the array would contain all the unique items.</p><p>ES6 introduced Sets, a new data structure with a very simple API to handle unique items that is not just convenient but <a href="https://github.com/anvaka/set-vs-object">also very fast</a>. The intention of this article is to introduce you to some new methods coming to Sets soon that will make them even more useful, but before, let’s remember the basics.</p><blockquote>Here in Lifion we are big users of JavaScript, about 90% of our platform services are Node.js-based. If you are interested to see some examples of how Sets are used in our codebase, check our open source projects in <a href="https://github.com/lifion">Lifion’s GitHub profile</a>.</blockquote><h3>The basics of Sets</h3><p>To create a new set we only need to use the constructor. We can optionally pass any iterator, such as an array or a string, and the iterated items will become elements of the new set (repeated items will be ignored).</p><pre>const emptySet = new Set();<br>const prefilledSet = new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;, &#39;🍎&#39;]);</pre><p>Once created, you can use add, delete, and has to deal with the elements.</p><pre>const set = new Set();<br>set.add(&#39;🍊&#39;);<br>set.add(&#39;🍋&#39;).add(&#39;🍉&#39;);<br>set.delete(&#39;🍋&#39;);<br>set.has(&#39;🍉&#39;) // true<br>set.has(&#39;🍋&#39;) // false</pre><p>Sets have a size property that tells you the number of elements in a set and a clear method to remove them all. Sets are iterable so you can use them in for…of loops or just take advantage of the forEach method. To convert a set to an array, you can use the spread operator.</p><pre>const set = new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]);<br>const array = [...set];</pre><h3>New Set methods</h3><p>Sets are about to get better. TC39, the committee that evolves JavaScript, is working on finishing a <a href="https://github.com/tc39/proposal-set-methods">proposal to add new methods to Sets</a> that will make them even more useful. It’s currently in Stage 2 which means that a first version of what will be the specification is ready and that the feature will eventually be part of the standard.</p><p>Why the new methods? Mostly, to reduce boilerplate. Many common use case scenarios for Sets seem to be currently implemented using almost the same code again and again. Conveniently, the are a couple of NPM modules (<a href="https://facebook.github.io/immutable-js/docs/#/Set">immutable</a> and <a href="https://www.npmjs.com/package/collections">collections</a>) that have been offering APIs for these common scenarios for a while. As with anything that proves to be useful and common enough, they become part of the standard and this is just that.</p><blockquote>The <a href="http://exploringjs.com/impatient-js/ch_sets.html">JavaScript for Impatient Programmers</a> book by <a href="https://medium.com/u/7fab51e62203">Axel Rauschmayer</a> has an entire chapter on Sets. It includes a really good description of the current API and code samples for common usage scenarios.</blockquote><h4>Union</h4><p>A very common operation with sets is the need to combine two sets into one. The newly proposed union method will return a new set that contains the elements of both this and the iterable passed as argument.</p><pre>const a = new Set([&#39;🍏&#39;, &#39;🍎&#39;]);<br>const b = new Set([&#39;🍐&#39;, &#39;🍏&#39;]);<br>a.union(b); // Set {&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;}</pre><p>If you wanted to do the same right now, you would have to do something like:</p><pre>new Set([...a, ...b]);</pre><h4>Intersection</h4><p>The new intersection method returns a new set that contains only the elements that are both present in this and in the given iterable.</p><pre>const a = new Set([&#39;🍏&#39;, &#39;🍎&#39;]);<br>const b = new Set([&#39;🍐&#39;, &#39;🍏&#39;]);<br>a.intersection(b); // Set {&#39;🍏&#39;}</pre><p>To achieve the same without the new method:</p><pre>new Set([...a].filter(i =&gt; b.has(i)));</pre><h4>Difference</h4><p>The difference method returns a new set that contains the elements on this that are not present in the given iterable.</p><pre>const a = new Set([&#39;🍏&#39;, &#39;🍎&#39;]);<br>const b = new Set([&#39;🍐&#39;, &#39;🍏&#39;]);<br>a.difference(b); // Set {&#39;🍎&#39;}</pre><p>Without the newly proposed method:</p><pre>new Set([...a].filter(i =&gt; !b.has(i)));</pre><h4>Symmetric Difference</h4><p>The symmetricDifference returns a new set that contains elements on this and elements on the given iterable that are not in the intersection of both.</p><pre>const a = new Set([&#39;🍏&#39;, &#39;🍎&#39;]);<br>const b = new Set([&#39;🍐&#39;, &#39;🍏&#39;]);<br>a.symmetricDifference(b); // Set {&#39;🍎&#39;, &#39;🍐&#39;}</pre><p>Achieving the same, without the method, requires a bit more of code:</p><pre>[...b].reduce((c, i) =&gt; !c.delete(i) ? c.add(i) : c, new Set(a))</pre><p>The above 4 methods are easier to understand with a graphical representation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2w1XH4mSFzYQ1VpXEC_teQ.png" /></figure><h4>Is Subset Of</h4><p>The new isSubsetOf method returns true if the given iterator includes every element on this, false otherwise.</p><pre>const a = new Set([&#39;🍏&#39;, &#39;🍎&#39;]);<br>const b = new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]);<br>const c = new Set([&#39;🍊&#39;, &#39;🍋&#39;]);<br>a.isSubsetOf(b) // true<br>a.isSubsetOf(c) // false</pre><p>The new method conveniently replaces something that would look like the following function:</p><pre>function isSubsetOf(a, b) {<br>  for (let i of a) {<br>    if (!b.has(i)) return false;<br>  }<br>  return true;<br>}</pre><h4>Is Superset Of</h4><p>The isSupersetOf method returns true if this includes every element in the given iterator, false otherwise.</p><pre>const a = new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]);<br>const b = new Set([&#39;🍏&#39;, &#39;🍐&#39;]);<br>const c = new Set([&#39;🍊&#39;, &#39;🍎&#39;]);<br>a.isSupersetOf(b) // true<br>a.isSupersetOf(c) // false</pre><p>The method could be implemented with the following:</p><pre>function isSupersetOf(a, b) {<br>  for (let i of b) {<br>    if (!a.has(i)) return false;<br>  }<br>  return true;<br>}</pre><h4>Is Disjoint From</h4><p>The isDisjointFrom method will return true if the given iterator has no elements in common with this, false otherwise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhMw96_m71Vv5xNrCpyJHA.png" /></figure><pre>const a = new Set([&#39;🍏&#39;, &#39;🍎&#39;]);<br>const b = new Set([&#39;🍐&#39;, &#39;🍊&#39;]);<br>const c = new Set([&#39;🍏&#39;, &#39;🍐&#39;]);<br>a.isDisjointFrom(b) // true<br>a.isDisjointFrom(c) // false</pre><p>Without the newly proposed method:</p><pre>function isDisjointFrom(a, b) {<br>  for (let i of a) {<br>    if (b.has(i)) return false;<br>  }<br>  return true;<br>}</pre><h3>Using the new methods now</h3><p>If you are interested in using these new methods right now you can do it by taking advantage of the <a href="https://github.com/zloirock/core-js">core-js module</a>. First, make sure to install version 3 on the beta distribution tag as the new set methods are only available there.</p><pre>npm install core-js@beta</pre><p>Then, to use the new Set methods, require the proper polyfills:</p><pre>require(&#39;core-js/proposals/set-methods&#39;);</pre><pre>new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]).union([&#39;🍐&#39;, &#39;🍊&#39;, &#39;🍋&#39;]);<br>new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]).intersection([&#39;🍐&#39;, &#39;🍊&#39;, &#39;🍋&#39;]);<br>new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]).difference([&#39;🍐&#39;, &#39;🍊&#39;, &#39;🍋&#39;]);<br>new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]).symmetricDifference([&#39;🍐&#39;, &#39;🍊&#39;]);</pre><pre>new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]).isDisjointFrom([&#39;🍊&#39;, &#39;🍋&#39;, &#39;🍉&#39;]);<br>new Set([&#39;🍏&#39;, &#39;🍎&#39;, &#39;🍐&#39;]).isSubsetOf([&#39;🍋&#39;, &#39;🍊&#39;, &#39;🍐&#39;, &#39;🍎&#39;]);<br>new Set([&#39;🍋&#39;, &#39;🍊&#39;, &#39;🍐&#39;, &#39;🍎&#39;, &#39;🍏&#39;]).isSupersetOf([&#39;🍏&#39;, &#39;🍎&#39;]);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=813dfeb2185" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lifion-engineering/lets-talk-about-sets-813dfeb2185">Let’s Talk About Sets</a> was originally published in <a href="https://medium.com/lifion-engineering">Lifion Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Lifion-Kinesis]]></title>
            <link>https://medium.com/lifion-engineering/introducing-lifion-kinesis-eecb3133221e?source=rss-6a80921d9d60------2</link>
            <guid isPermaLink="false">https://medium.com/p/eecb3133221e</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[kinesis]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Edgardo Avilés-López]]></dc:creator>
            <pubDate>Fri, 07 Dec 2018 20:26:04 GMT</pubDate>
            <atom:updated>2018-12-07T21:08:13.912Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>A Node.js native Kinesis client with Enhanced Fan-Out</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqxNJna4Rm6QxoFRc9lqYw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/bUhzlj3gGso?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Andreas Kind</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In relation to <a href="https://youtu.be/jTkrKJZ13-w">our cloud transformation journey</a>, we’re excited to announce <a href="https://github.com/lifion/lifion-kinesis">lifion-kinesis</a>, a native Node.js client for Amazon Kinesis Data Streams. This supports the new enhanced fan-out feature of Kinesis, and to the best of our knowledge this is the first open-source pure JavaScript implementation with this feature. Read on to understand our rationale and why this matters.</p><p>At Lifion, we’ve been using <a href="https://aws.amazon.com/kinesis/data-streams/">Kinesis Data Streams</a> for different use cases as a part of our cloud transformation initiative. Most commonly, whenever an event is generated or an important data item changes in our platform, we broadcast the change through Kinesis streams. Services in our platform can then act upon those changes by triggering the corresponding behavior. Kinesis streams consist of shards, where messages sent to a stream are read from one of the shards. Each micro-service in our platform has multiple instances running at the same time so shards need to be assigned to different service instances to avoid consuming repeated messages.</p><p>We also have a special broadcasting use case where all of the instances of the same service need to receive all the messages in a stream. That is, every instance reads from all the shards in a stream. Shards are limited on the number of read operations per second so the more service instances we have, the more we need to wait before sending requests for messages. Thankfully, Kinesis Data Streams have a <a href="https://aws.amazon.com/blogs/aws/kds-enhanced-fanout/">new enhanced fan-out feature</a> where consumers of a stream can subscribe to messages and then the AWS Service can push new messages to them, thus solving the message delivery delay.</p><h3>Why a new library?</h3><p>About 90% of our platform micro-services are Node.js codebases. It wasn’t possible for us to use the Amazon-provided <a href="https://github.com/awslabs/amazon-kinesis-client-nodejs">Kinesis Client Library (KCL) for Node.js</a> as it’s a wrapper of the multi-language daemon of the KCL in Java. The Node.js KCL uses standard output to communicate with the daemon but we already use standard output for our logging framework. That, along with the fact that each micro-service would have to also run a JVM process made us unable to adopt it. More importantly, the enhanced-fanout feature is currently only available in the Java KCL and not in the Node.js version.</p><p>We developed a native Node.js module for Kinesis to work around our standard output conflict by using the <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Kinesis.html">AWS SDK</a>. We have been using it for about 6 months in production, and now that the enhanced fan-out feature is out, we realized the community would find it useful too. So, as part of <a href="https://github.com/lifion">Lifion’s open-source</a>, we are pleased to announce <a href="http://github.com/lifion/lifion-kinesis">lifion-kinesis</a>, a native Node.js Kinesis client with support for enhanced fan-out. Right now, it only features an enhanced fan-out client but will soon have support for sending messages and a polling-mode with automatic checkpoints.</p><p>Your can learn more about the project on GitHub:<br><a href="https://github.com/lifion/lifion-kinesis">https://github.com/lifion/lifion-kinesis</a></p><h3>Getting started</h3><p>The module requires Node.js 10 as it takes advantage of the latest API for Node.js streams. To install it, just run npm install lifion-kinesis in your project. Then, in your code, create an instance of the exported Kinesis class. In addition to the <a href="https://github.com/lifion/lifion-kinesis#new-kinesisoptions">client-specific initialization options</a>, the constructor also accepts any of the options for <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Kinesis.html#constructor-property">Kinesis in the AWS SDK</a>.</p><pre>const Kinesis = require(&#39;lifion-kinesis&#39;);</pre><pre>const client = new Kinesis({<br>   consumerName: &#39;sample-consumer&#39;,<br>   streamName: &#39;sample-stream&#39;,<br>   /* other initialization options */<br>});</pre><p>Instances of the client are standard Node.js streams so messages can be consumed through data callbacks:</p><pre>client.on(&#39;data&#39;, chunk =&gt; {<br>  console.log(&#39;Incoming data:&#39;, chunk);<br>});</pre><p>Messages can also be piped to other streams:</p><pre>const Kinesis = require(&#39;lifion-kinesis&#39;);<br>const { pipeline } = require(&#39;stream&#39;);<br><br>pipeline([<br>  new Kinesis(/* options */),<br>  new Writable({<br>    objectMode: true,<br>    write(data, encoding, callback) {<br>      console.log(&#39;Incoming data:&#39;, data);<br>      callback();<br>    }<br>  })<br>]);</pre><h3>AWS re:Invent 2018</h3><p>To learn more about Lifion and our cloud transformation journey, <a href="https://youtu.be/jTkrKJZ13-w">watch our AWS re:Invent 2018 session</a> where we talked about how we have been taking advantage of the AWS services, the challenges we have found and how we have been solving them.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjTkrKJZ13-w%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjTkrKJZ13-w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjTkrKJZ13-w%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/be01ca6ae56a5312fb15142ae70f7d56/href">https://medium.com/media/be01ca6ae56a5312fb15142ae70f7d56/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eecb3133221e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lifion-engineering/introducing-lifion-kinesis-eecb3133221e">Introducing Lifion-Kinesis</a> was originally published in <a href="https://medium.com/lifion-engineering">Lifion Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My recommended Atom Editor setup]]></title>
            <link>https://medium.com/lifion-engineering/my-recommended-atom-editor-setup-bb13f9cc4329?source=rss-6a80921d9d60------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb13f9cc4329</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[text-editor]]></category>
            <category><![CDATA[atom]]></category>
            <dc:creator><![CDATA[Edgardo Avilés-López]]></dc:creator>
            <pubDate>Tue, 22 Aug 2017 01:14:33 GMT</pubDate>
            <atom:updated>2018-04-19T14:23:42.583Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>A list of good packages for ES6 and React development.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEbJvltnslRrdEzjWQ7Img.jpeg" /><figcaption>Atom Editor screenshot by <a href="http://unsplash.com/@lucabravo?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge">Luca Bravo</a></figcaption></figure><p>Let me begin by telling you I love Atom as much as I love JavaScript — and I really, really love JavaScript. I still remember that time when I saved around 2 months worth of pesos from my first paid projects to buy what I thought was a book on how to finally learn to build dynamic websites. My only experience so far was with plain HTML 4 and my dream was to code some of those alert dialogs with “Hi <em>{first name}</em>!”. I didn’t have Internet at home (Google and Stack Overflow were still not around anyway) so I had to get a book. The book ended up being a compilation of the API documentation of JavaScript, VBScript, HTML, CSS, and some other old languages. But hey, I did find the documentation and a sample for “alert” so I was really happy. Flash-forward 20 years and who would believe we would have entire platforms, drones, firmware, and much other stuff written in JavaScript. And code editors! Who would believe it? Anyway… Atom has many good qualities, and one of them is its flexibility. There are a lot of really great packages out there, but sometimes it can be difficult to test and find the ones that could make you more productive (and happier!). Some co-workers at <a href="https://medium.com/u/3a05c9d351fc">Lifion</a> have asked me about what packages I use in Atom and what’s my setup. I’ve also been postponing writing something in Medium so I told myself why not doing both things at the same time? So, without further ado, here’s a zero pesos, gratis, compilation of good Atom packages.</p><p><strong>Update on March 28, 2018</strong>: I just added <strong>prettier-atom</strong> to the list, also fixed those typos 🙈 (thanks <a href="https://medium.com/u/44565ebad347">meena</a>!)</p><h3><a href="https://atom.io/packages/api-blueprint-preview">api-blueprint-preview</a></h3><p>If your project has a Web API you may want to document it. <a href="https://apiblueprint.org/">API Blueprint</a> is a description language for Web APIs that is as easy to learn and use as <a href="https://daringfireball.net/projects/markdown/syntax">Markdown</a> but still very powerful. This package will open a panel next to the editor with a preview of how <a href="https://github.com/danielgtaylor/aglio">Aglio</a> (one of the many API Blueprint rendering tools) would render your in-progress documentation. Make sure to install Aglio before installing the package in Atom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0CHcZPnZUyOKgD7OYrFZEA.png" /><figcaption><a href="https://atom.io/packages/api-blueprint-preview">api-blueprint-preview</a></figcaption></figure><h3><a href="https://atom.io/packages/atom-beautify">atom-beautify</a></h3><p>This package will “beautify” the entire code you currently have in the editor or just the selected text. It supports a very long list of languages including HTML, JavaScript, CSS, PHP, Python, and others. As a sample:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74yYwt2rIF1wf9tcNHA3SQ.png" /><figcaption><a href="https://atom.io/packages/atom-beautify">atom-beautify</a></figcaption></figure><h3><a href="https://atom.io/packages/atom-jest-snippets">atom-jest-snippets</a></h3><p>This package will add a collection of snippets for the <a href="https://facebook.github.io/jest/">Jest</a> testing framework. This means that if you write “ebe” and press tab, “ebe” will be replaced with “expect(<em>x</em>).toBe(<em>y</em>)” and the text cursor will be moved to where <em>x</em> is. Press tab again and the cursor will now move to where <em>y</em> is. Check the <a href="https://atom.io/packages/atom-jest-snippets">project page</a> for the full list of available snippets. Also, make sure to checkout Jest if you haven’t yet!</p><h3><a href="https://atom.io/packages/atom-ternjs">atom-tern</a></h3><p>Atom is not like a traditional IDE such as <a href="https://eclipse.org/ide/">Eclipse</a> or <a href="https://www.jetbrains.com/webstorm/">WebStorm</a>. Atom is meant to be flexible and hackable. This package adds IDE-like capabilities to the editor by leveraging the <a href="http://ternjs.net/">Tern</a> code-analysis engine. Once installed, Atom will be able to offer auto-completion in your code base, find references, you will be able to click on any item in editor and navigate directly to file and position, show documentation of a function or class, find a definition, and rename variables. Please note that to enable navigation you will also need the <a href="https://atom.io/packages/hyperclick">hyperclick</a> package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*JsHKZ-Qla_UpN7CmUt8qww.png" /><figcaption><a href="https://atom.io/packages/atom-ternjs">atom-tern</a></figcaption></figure><h3><a href="https://atom.io/packages/autocomplete-js-import">autocomplete-js-import</a></h3><p>Atom comes with the <a href="https://github.com/atom/autocomplete-plus">autocomplete-plus</a> package pre-installed. It’s the engine that powers the code suggestions. This package adds auto-complete support for ES6 import statements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*56TiSJ8h0aij2_CjH5d_Cw.gif" /><figcaption><a href="https://atom.io/packages/autocomplete-js-import">autocomplete-js-import</a></figcaption></figure><h3><a href="https://atom.io/packages/autocomplete-modules">autocomplete-modules</a></h3><p>Do you find yourself trying to figure out if you should use “..” or “../..”? Have you backwards counted folders trying to come up with a path? This package is for you. It will auto-complete require or import statements and help you find that problematic module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*_CfglFPIDEkdoKB-JufMVw.gif" /><figcaption><a href="https://atom.io/packages/autocomplete-modules">autocomplete-modules</a></figcaption></figure><h3><a href="https://atom.io/packages/docblockr">docblockr</a> &amp; <a href="https://esdoc.org/">esdoc</a></h3><p>I know, I know, documenting code is kind of strange but do you have special magical helper functions? You know… one of those tricks you keep around but don’t remember how to use them? Is your team larger than 1 person? In my experience, if you have a function complex enough that you cannot really understand what it’s doing just by looking at the name you should probably document it. The docblockr package helps you do it faster by giving you automatic templates as you write. Documentation is described using <a href="http://usejsdoc.org/">JSDoc</a> syntax and I definitively recommend ESDoc to generate HTML out of your documentation to publish it somewhere later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*iLMrkP-j-QwG-aMRTBbCgw.gif" /><figcaption><a href="https://atom.io/packages/docblockr">docblockr</a></figcaption></figure><h3><a href="https://atom.io/packages/file-icons">file-icons</a></h3><p>If you have a large project sometimes finding the file you are looking for is difficult. This package will add icons to your files using the file extension to identify them. It’s been very useful for visual scanning a code base. I do recommend using the monochrome setting though.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yluoE38SMcFftpWtcI7GLg.png" /><figcaption><a href="https://atom.io/packages/file-icons">file-icons</a></figcaption></figure><h3><a href="https://atom.io/packages/highlight-selected">highlight-selected</a></h3><p>Before using Atom as my primary code editor I was using <a href="https://www.sublimetext.com/">Sublime Text</a>. While I still like Sublime I was a little bit frustrated at some of the limitations when trying to extend it. One of Sublime’s features I missed the most was double clicking a word in the editor and having the same work highlighted in the rest of the document. This package brings that functionality to Atom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*XjiD7_ZafEAH8N2UCnlMpg.gif" /><figcaption><a href="https://atom.io/packages/highlight-selected">highlight-selected</a></figcaption></figure><h3><a href="https://atom.io/packages/hyperclick">hyperclick</a> &amp; <a href="https://atom.io/packages/js-hyperclick">js-hyperclick</a></h3><p>Hyperclick is an engine for Atom that lets you click on a word to navigate to either code definitions or other links such as a webpage. The js-hyperclick package provides JavaScript-specific definitions to hyperclick engine. These packages are very helpful. One feature I like the most is that it would let you navigate inside NPM modules just by clicking on a function you are using.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bbLQ4GcJ4oVHoX05bA32Q.png" /><figcaption><a href="https://atom.io/packages/js-hyperclick">js-hyperclick</a></figcaption></figure><h3><a href="https://atom.io/packages/import-sf-mono">import-sf-mono</a></h3><p>This package allows you to use Apple’s San Francisco Monospace font in Atom (which by the way is beautiful). To do so, install the package, then set “SF Mono” as your font in Atom’s Editor preferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jk5M-L9G5rVVvYvQbj4P3Q.png" /><figcaption><a href="https://www.reddit.com/r/apple/comments/4o23fm/new_san_francisco_monospaced_font_is_gorgeous/">“New San Francisco Monospaced font is gorgeous!”</a></figcaption></figure><h3>language-*</h3><p>These packages add syntax highlighting to Atom. There’s one for almost any language. The ones I find myself installing all the time are <a href="https://atom.io/packages/language-api-blueprint">language-api-blueprint</a>, <a href="https://atom.io/packages/language-babel">language-babel</a>, <a href="https://atom.io/packages/language-docker">language-docker</a>, and <a href="https://atom.io/packages/language-nginx">language-nginx</a>. Already already comes with syntax highlighting for the most common Web languages.</p><h3><a href="https://atom.io/packages/linter">linter</a></h3><p>This package is an engine that enables Atom to lint your code. You will need to install providers since the linter package by itself won’t do anything to your code. Two linter providers I use are <a href="https://atom.io/packages/linter-eslint">linter-eslint</a> and <a href="https://atom.io/packages/linter-api-blueprint">linter-api-blueprint</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5TsyJnfv4n5iu__w1RnkQw.gif" /><figcaption><a href="https://atom.io/packages/linter">linter</a></figcaption></figure><h3><a href="https://atom.io/packages/pigments">pigments</a></h3><p>If you have ever work with CSS you will know sometimes finding “blue” is difficult. If you haven’t yet achieve Matrix-level capabilities to transform hex into colors this package will help you. It adds color hints to CSS color values so it’s easier to identify those blues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*D3BE0JeYJGEuuk-sJTASww.gif" /><figcaption><a href="https://atom.io/packages/pigments">pigments</a></figcaption></figure><h3><a href="https://atom.io/themes/pure-syntax">pure-syntax</a></h3><p>This is my favorite Atom color theme as of now. There’s a lot of them and I try to switch from time to time. What I like about pure-syntax is that it’s colorful but not too much. I do recommend giving it a try.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*6fOj5xGpesMu8GhsCMRGdg.png" /><figcaption><a href="https://github.com/polymoon/pure-syntax">pure-syntax</a></figcaption></figure><h3><a href="https://atom.io/packages/react-es7-snippets">react-es7-snippets</a></h3><p>This package will add some ES7-specific snippets.</p><h3><a href="https://atom.io/packages/remember-folds">remember-folds</a></h3><p>Another of the Sublime features I missed in Atom was that I could fold all my code by levels to help manage navigation. With this package Atom will remember the code you folded in the opened file and will keep it folded in the way you left it the next time you come back.</p><h3><a href="https://atom.io/packages/sort-lines">sort-lines</a></h3><p>Make your inner-OCD person happy by installing and using this package. This will let you select some lines and sort them by natural or alphabetical order, remove duplicated lines, and other very useful features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szc9Hf6mV6jlaDd59RaTJQ.gif" /><figcaption><a href="https://atom.io/packages/sort-lines">sort-lines</a></figcaption></figure><h3><a href="https://ide.atom.io/">Atom IDE</a></h3><p>As I was writing this Atom IDE was released. It comes with some of the above packages and the intention is to make Atom act more like a traditional IDE. If you install it make sure to disable the linter package as it will duplicate its output (it will actually remind you if you haven’t).</p><h3><a href="https://atom.io/packages/prettier-atom">Prettier for Atom</a></h3><p>I’m not a fan of auto-formatters but for the past week or so I’ve been giving prettier a chance. I have to admit, it’s kind of liberating not having to click here and there and press enter or tab. Yes, it is a very opinionated format but it’s been working for me so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*6yxBL0PhAUc-pezVeo26oQ.png" /><figcaption><a href="https://atom.io/packages/prettier-atom">prettier-atom</a></figcaption></figure><h3>And finally…</h3><p>This guide was inspired by <a href="https://medium.com/productivity-freak/my-atom-editor-setup-for-js-react-9726cd69ad20">The Ultimate Atom Editor Setup</a>, it made me realize the large amount of available packages and how easy it to miss the ones that you could take advantage of. I will try to keep this article updated as I continue using Atom. If you have any suggestions to add here please feel welcome to leave it in the comments or letting me know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb13f9cc4329" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lifion-engineering/my-recommended-atom-editor-setup-bb13f9cc4329">My recommended Atom Editor setup</a> was originally published in <a href="https://medium.com/lifion-engineering">Lifion Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>