<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[etoxin]]></title><description><![CDATA[Music, Film, Web Stuff]]></description><link>https://etoxin.net/</link><image><url>https://etoxin.net/favicon.png</url><title>etoxin</title><link>https://etoxin.net/</link></image><generator>Ghost 3.41</generator><lastBuildDate>Sun, 12 Apr 2026 06:12:44 GMT</lastBuildDate><atom:link href="https://etoxin.net/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Type guard a filtered array with TS user-defined type guards.]]></title><description><![CDATA[<p></p><p>When you filter a mixed type array, the new typing is not passed to the new array. In the example below the returned type of the array is `<code>(string | number | boolean)[]</code></p><pre><code class="language-javascript">const arr = [123, true, "I'm a string"];

// Normal filter
const normal = arr.filter((pred) =&gt; typeof pred === 'number');
// normal</code></pre>]]></description><link>https://etoxin.net/a-nice-way-to-type-guard-an-array-with-filter-and-ts-user-defined-type-guards/</link><guid isPermaLink="false">6180dba9d2f36e11de7f20ba</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Tue, 02 Nov 2021 06:34:43 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/11/FCqyeupVQAM59tC-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/11/FCqyeupVQAM59tC-1.jpg" alt="Type guard a filtered array with TS user-defined type guards."><p></p><p>When you filter a mixed type array, the new typing is not passed to the new array. In the example below the returned type of the array is `<code>(string | number | boolean)[]</code></p><pre><code class="language-javascript">const arr = [123, true, "I'm a string"];

// Normal filter
const normal = arr.filter((pred) =&gt; typeof pred === 'number');
// normal is `(string | number | boolean)[]` </code></pre><p>With the User-Defined type guards (<code>pred is number</code> ) our filtered list is correctly typed to <code>number[]</code></p><pre><code class="language-JavaScript">// Filter using User-Defined Type Guards
const withTypes = arr.filter((pred): pred is number =&gt; typeof pred === 'number');
// withTypes is `number[]`</code></pre>]]></content:encoded></item><item><title><![CDATA[Mogwai - Ritchie Sacramento]]></title><description><![CDATA[<!--kg-card-begin: html--><iframe width="560" height="315" src="https://www.youtube.com/embed/VWjzlJEmmxM" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!--kg-card-end: html-->]]></description><link>https://etoxin.net/mogwai-ritchie-sacramento/</link><guid isPermaLink="false">603e2a31d2f36e11de7f20ad</guid><category><![CDATA[music]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Tue, 02 Mar 2021 12:08:17 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/03/wVPprz.gif" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: html--><iframe width="560" height="315" src="https://www.youtube.com/embed/VWjzlJEmmxM" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[High Tension - Ghost to Ghost]]></title><description><![CDATA[<!--kg-card-begin: html--><iframe width="560" height="315" src="https://www.youtube.com/embed/LMeo0e48vyU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!--kg-card-end: html--><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://www.hightension.com.au/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">High Tension</div><div class="kg-bookmark-description"></div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://images.squarespace-cdn.com/content/v1/59c1e642a9db092ebfa9ada7/1505915531680-774M4BV2LLKXCYEP3PQ3/ke17ZwdGBToddI8pDm48kP1fjCxdemSMFhHNUbRVWZpZw-zPPgdn4jUwVcJE1ZvWEtT5uBSRWt4vQZAgTJucoTqqXjS3CfNDSuuf31e0tVELlPmthUQI12KRGwHF1NjdhJXI9IoSgjOxwnsc8BJgdN1lH3P2bFZvTItROhWrBJ0/favicon.ico?format&#x3D;100w"><span class="kg-bookmark-author">High Tension</span></div></div><div class="kg-bookmark-thumbnail"><img src="http://static1.squarespace.com/static/59c1e642a9db092ebfa9ada7/t/5a950a138165f588f47ca968/1519716917289/High+Tension+Logo.png?format&#x3D;1500w"></div></a></figure>]]></description><link>https://etoxin.net/high-tension-ghost-to-ghost/</link><guid isPermaLink="false">603e21c9d2f36e11de7f2067</guid><category><![CDATA[music]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Tue, 02 Mar 2021 11:31:42 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/03/VA1OAB.gif" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: html--><iframe width="560" height="315" src="https://www.youtube.com/embed/LMeo0e48vyU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!--kg-card-end: html--><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://www.hightension.com.au/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">High Tension</div><div class="kg-bookmark-description"></div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://images.squarespace-cdn.com/content/v1/59c1e642a9db092ebfa9ada7/1505915531680-774M4BV2LLKXCYEP3PQ3/ke17ZwdGBToddI8pDm48kP1fjCxdemSMFhHNUbRVWZpZw-zPPgdn4jUwVcJE1ZvWEtT5uBSRWt4vQZAgTJucoTqqXjS3CfNDSuuf31e0tVELlPmthUQI12KRGwHF1NjdhJXI9IoSgjOxwnsc8BJgdN1lH3P2bFZvTItROhWrBJ0/favicon.ico?format&#x3D;100w" alt="High Tension - Ghost to Ghost"><span class="kg-bookmark-author">High Tension</span></div></div><div class="kg-bookmark-thumbnail"><img src="http://static1.squarespace.com/static/59c1e642a9db092ebfa9ada7/t/5a950a138165f588f47ca968/1519716917289/High+Tension+Logo.png?format&#x3D;1500w" alt="High Tension - Ghost to Ghost"></div></a></figure>]]></content:encoded></item><item><title><![CDATA[Carla Geneve - Dog Eared]]></title><description><![CDATA[<!--kg-card-begin: html--><iframe width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/949144903&color=%233d4144&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true"></iframe><!--kg-card-end: html-->]]></description><link>https://etoxin.net/carla-geneve-dog-eared/</link><guid isPermaLink="false">603e264bd2f36e11de7f2093</guid><category><![CDATA[music]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Mon, 15 Feb 2021 11:52:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/03/carla-geneve.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: html--><iframe width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/949144903&color=%233d4144&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true"></iframe><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Small Data Project]]></title><description><![CDATA[<p>For the last couple of months I've been creating a Wikipedia for data like website with an open API (Small Data Project). I've been hesitant to post about it but thought now is better than never. Below is a sample NSW COVID-19 Dataset &amp; API. <a href="https://smalldataproject.com/dataset/nsw-covid-19-cases">https://smalldataproject.com/dataset/nsw-covid-19-cases</a></p>]]></description><link>https://etoxin.net/small-data-project/</link><guid isPermaLink="false">60339a9fd2f36e11de7f200e</guid><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Tue, 17 Mar 2020 11:52:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/Screen-Shot-2021-02-22-at-10.53.14-pm.png" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/Screen-Shot-2021-02-22-at-10.53.14-pm.png" alt="Small Data Project"><p>For the last couple of months I've been creating a Wikipedia for data like website with an open API (Small Data Project). I've been hesitant to post about it but thought now is better than never. Below is a sample NSW COVID-19 Dataset &amp; API. <a href="https://smalldataproject.com/dataset/nsw-covid-19-cases">https://smalldataproject.com/dataset/nsw-covid-19-cases</a></p>]]></content:encoded></item><item><title><![CDATA[Sometimes I get bored and make stuff like this.]]></title><description><![CDATA[<p>Sometimes I get bored and make stuff like this. Run this in your browser console for a bit of fun.</p><!--kg-card-begin: html--><script src="https://gist.github.com/etoxin/4a76e1ebf8453f539b6ca646b5d8cd10.js"></script><!--kg-card-end: html-->]]></description><link>https://etoxin.net/sometimes-i-get-bored-and-make-stuff-like-this/</link><guid isPermaLink="false">603392f4d2f36e11de7f1fc7</guid><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Thu, 03 Oct 2019 12:19:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/carbon-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/carbon-1.png" alt="Sometimes I get bored and make stuff like this."><p>Sometimes I get bored and make stuff like this. Run this in your browser console for a bit of fun.</p><!--kg-card-begin: html--><script src="https://gist.github.com/etoxin/4a76e1ebf8453f539b6ca646b5d8cd10.js"></script><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[A Short Introduction to TensorFlow.JS]]></title><description><![CDATA[<p>So this is a quick introduction for machine learning with JavaScript.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnihMgUcAE9W28.png" class="kg-image" alt srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnihMgUcAE9W28.png 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnihMgUcAE9W28.png 1000w, https://etoxin.net/content/images/2021/02/EDnihMgUcAE9W28.png 1200w" sizes="(min-width: 720px) 720px"></figure><p>Above is a series of numbers. You can work out pretty easily that Y = 2X – 1. How you worked this out in your head is exactly how machine learning works.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnihpOU8AYV0qh.jpg" class="kg-image" alt srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnihpOU8AYV0qh.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnihpOU8AYV0qh.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnihpOU8AYV0qh.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>This is all the code you need to predict</p>]]></description><link>https://etoxin.net/a-short-introduction-to-tensorflow-js/</link><guid isPermaLink="false">60339251d2f36e11de7f1fc1</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Tue, 10 Sep 2019 12:31:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/EDnihpOU8AYV0qh-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/EDnihpOU8AYV0qh-1.jpg" alt="A Short Introduction to TensorFlow.JS"><p>So this is a quick introduction for machine learning with JavaScript.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnihMgUcAE9W28.png" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnihMgUcAE9W28.png 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnihMgUcAE9W28.png 1000w, https://etoxin.net/content/images/2021/02/EDnihMgUcAE9W28.png 1200w" sizes="(min-width: 720px) 720px"></figure><p>Above is a series of numbers. You can work out pretty easily that Y = 2X – 1. How you worked this out in your head is exactly how machine learning works.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnihpOU8AYV0qh.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnihpOU8AYV0qh.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnihpOU8AYV0qh.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnihpOU8AYV0qh.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>This is all the code you need to predict the pattern with machine learning and TensorFlow JS. Read on to learn what is happening here.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDniiQFVAAA0i8w.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDniiQFVAAA0i8w.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDniiQFVAAA0i8w.jpg 1000w, https://etoxin.net/content/images/2021/02/EDniiQFVAAA0i8w.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>First up you will need to create a model. A model is a trained neural network. This is a basic model with a single layer. Our layer here is the method `tf.layers.dense`</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnii8YVUAE62-P.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnii8YVUAE62-P.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnii8YVUAE62-P.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnii8YVUAE62-P.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>This layer has a single neuron which is represented by the property `units`. We are also feeding in a single value into the neural network represented by the property `inputShape`, which is our X value. Our neural network will try to predict the Y value.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnijn1UwAMZWFQ.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnijn1UwAMZWFQ.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnijn1UwAMZWFQ.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnijn1UwAMZWFQ.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>We need to compile our model. There are two main functions here. Loss and Optimizer. This is how our model learns. It will predict a number and the loss function will calculate how close it was. The Optimizer will predict the next guess and try to get closer to the right formula.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnikT4VAAUsPUD.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnikT4VAAUsPUD.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnikT4VAAUsPUD.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnikT4VAAUsPUD.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>This will happen many times increasing our accuracy. In our example it will happen 1000 times, represented by the `epochs` property. Each time it will enhance its guess, getting us closer to the correct formula.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnik9CUEAATzAm.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnik9CUEAATzAm.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnik9CUEAATzAm.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnik9CUEAATzAm.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>We have our two data sets represented as two arrays, `xs` and `xy`. We need to convert our data to tensors first using `tf.tensor`. This is just a holder for our data with type information.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnilnKVAAA_Mlv.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnilnKVAAA_Mlv.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnilnKVAAA_Mlv.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnilnKVAAA_Mlv.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>We match our two datasets to each other using the `model.fit` and passing in our two tensors (data). This method will take a while to complete, so we use `await` here.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/EDnimPpUcAAxThy.jpg" class="kg-image" alt="A Short Introduction to TensorFlow.JS" srcset="https://etoxin.net/content/images/size/w600/2021/02/EDnimPpUcAAxThy.jpg 600w, https://etoxin.net/content/images/size/w1000/2021/02/EDnimPpUcAAxThy.jpg 1000w, https://etoxin.net/content/images/2021/02/EDnimPpUcAAxThy.jpg 1200w" sizes="(min-width: 720px) 720px"></figure><p>Once the model is trained. We can now predict with our model using `model.predict`.</p><p>So we are predicting the Y value for 10. We already know it will be 19 (Y = 2X – 1). When we run the following code our model gives us 18.999. Success!</p><p>You are probably wondering about the .999, this is because we are only giving it a small dataset and it is accounting for that in its prediction.</p><p>Hoped you like this article.</p><p>Below is the complete code.</p><!--kg-card-begin: html--><script src="https://gist.github.com/etoxin/b9dc235aaab27eec89d3d53c427edcd5.js"></script><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[SynthWave '84 Theme]]></title><description><![CDATA[<p>I added <a href="https://twitter.com/Robb0wen">@robb0wen</a>'s SynthWave '84 theme to <a href="https://t.co/XT5PEMmlSk?amp=1" rel=" noopener noreferrer">https://carbon.now.sh</a>. Get it while it's hot.</p>]]></description><link>https://etoxin.net/synthwave-84-theme/</link><guid isPermaLink="false">60339bfed2f36e11de7f201f</guid><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Wed, 17 Jul 2019 12:57:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/D_orQ_-U4AACe1h.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/D_orQ_-U4AACe1h.jpg" alt="SynthWave '84 Theme"><p>I added <a href="https://twitter.com/Robb0wen">@robb0wen</a>'s SynthWave '84 theme to <a href="https://t.co/XT5PEMmlSk?amp=1" rel=" noopener noreferrer">https://carbon.now.sh</a>. Get it while it's hot.</p>]]></content:encoded></item><item><title><![CDATA[Cryptolist]]></title><description><![CDATA[<p>I hear Bitcoin is on the rise. I created this tool a while back. `npx cryptolist` Offers currency conversion `npx cryptolist -c aud`.</p><p>Get a list of the current prices of cryptocurrencies.</p><h2 id="installation">Installation</h2><pre><code>npm install -g cryptolist
</code></pre><p>To Upgrade run <code>npm upgrade -g cryptolist</code></p><h2 id="usage">Usage</h2><p>On your cli enter the</p>]]></description><link>https://etoxin.net/cryptolist/</link><guid isPermaLink="false">60339c9ed2f36e11de7f2028</guid><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Thu, 30 May 2019 13:00:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/preview.png" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/preview.png" alt="Cryptolist"><p>I hear Bitcoin is on the rise. I created this tool a while back. `npx cryptolist` Offers currency conversion `npx cryptolist -c aud`.</p><p>Get a list of the current prices of cryptocurrencies.</p><h2 id="installation">Installation</h2><pre><code>npm install -g cryptolist
</code></pre><p>To Upgrade run <code>npm upgrade -g cryptolist</code></p><h2 id="usage">Usage</h2><p>On your cli enter the following:</p><pre><code>crypto
</code></pre><pre><code>crypto --convert usd --size 5
</code></pre><pre><code>crypto -c aud -s 20
</code></pre><h2 id="options">Options</h2><h3 id="convert-to-currency">Convert to currency</h3><p>You can convert to other currencies with <code>--convert</code> or <code>-c</code></p><h3 id="show-prices-in-eth">Show prices in ETH</h3><pre><code>crypto --convert eth
</code></pre><h3 id="show-prices-in-aud">Show prices in AUD</h3><pre><code>crypto -c aud
</code></pre><h3 id="size">Size</h3><p>To show more currencies use the following option <code>--size</code> or <code>-s</code></p><pre><code>crypto -s 20
</code></pre><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://www.npmjs.com/package/cryptolist"><div class="kg-bookmark-content"><div class="kg-bookmark-title">cryptolist</div><div class="kg-bookmark-description">Lists the top ten Crypto currency prices.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://static.npmjs.com/1996fcfdf7ca81ea795f67f093d7f449.png" alt="Cryptolist"><span class="kg-bookmark-author">npm</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://static.npmjs.com/338e4905a2684ca96e08c7780fc68412.png" alt="Cryptolist"></div></a></figure>]]></content:encoded></item><item><title><![CDATA[Get the currently playing song on Triple J via the Command Line]]></title><description><![CDATA[<p>I made a tiny npm library that gets the currently playing song on the radio station Triple J. This tool works on the  command line. If you have <a href="https://web.archive.org/web/20200818131907/https://www.npmjs.com/package/npx">npx</a> installed, you can use it like so.</p><p><code>npx triplej</code></p><p>If you want to open the song in Spotify, you can use</p>]]></description><link>https://etoxin.net/get-the-currently-playing-song-on-triple-j-via-the-command-line/</link><guid isPermaLink="false">603390d4d2f36e11de7f1fa9</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Fri, 12 Apr 2019 12:12:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/screen-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/screen-1.png" alt="Get the currently playing song on Triple J via the Command Line"><p>I made a tiny npm library that gets the currently playing song on the radio station Triple J. This tool works on the  command line. If you have <a href="https://web.archive.org/web/20200818131907/https://www.npmjs.com/package/npx">npx</a> installed, you can use it like so.</p><p><code>npx triplej</code></p><p>If you want to open the song in Spotify, you can use this command:</p><p><code>npx triplej --spotify</code></p><p>See <a href="https://www.npmjs.com/package/triplej">https://www.npmjs.com/package/triplej</a> for details.</p><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/screen.png" class="kg-image" alt="Get the currently playing song on Triple J via the Command Line" srcset="https://etoxin.net/content/images/size/w600/2021/02/screen.png 600w, https://etoxin.net/content/images/2021/02/screen.png 994w" sizes="(min-width: 720px) 720px"></figure><p>A small feature that I’ve added to the library is a rarity system for the line separator.</p><p>I’ve also added a small feature that adds a rarity value to the song line separator. So every time you use the tool, you may get a rare line.</p><!--kg-card-begin: html--><script src="https://gist.github.com/etoxin/0ed108a7bde896725f016625c7d680b5.js"></script><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Slack Beer Bot]]></title><description><![CDATA[<p>I created a simple slack beer bot. It allows you to search for beer. In slack type <strong>/beer</strong> then any beer you want to look up. Here are a few examples:</p><p><code>/beer corona</code><br><code>/beer newtowner</code><br><code>/beer Hop Sauce</code><br><code>/beer Wayward Brewing</code><br><code>/beer westvleteren 12</code><br><code>/beer anything really</code></p><p>Visit <a href="https://slackbeer.herokuapp.com/">https://slackbeer.</a></p>]]></description><link>https://etoxin.net/slack-beer-bot/</link><guid isPermaLink="false">60338f65d2f36e11de7f1f9a</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Fri, 12 Apr 2019 12:03:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/screen_shot-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/screen_shot-1.png" alt="Slack Beer Bot"><p>I created a simple slack beer bot. It allows you to search for beer. In slack type <strong>/beer</strong> then any beer you want to look up. Here are a few examples:</p><p><code>/beer corona</code><br><code>/beer newtowner</code><br><code>/beer Hop Sauce</code><br><code>/beer Wayward Brewing</code><br><code>/beer westvleteren 12</code><br><code>/beer anything really</code></p><p>Visit <a href="https://slackbeer.herokuapp.com/">https://slackbeer.herokuapp.com/</a> for installation.</p><!--kg-card-begin: html--><div>
    <a href="https://slack.com/oauth/authorize?client_id=10107096720.544568354676&amp;scope=commands&amp;redirect_uri=https://slackbeer.herokuapp.com/auth">
        <img alt="Slack Beer Bot" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" width="139" height="40">
    </a>
</div><!--kg-card-end: html--><figure class="kg-card kg-image-card"><img src="https://etoxin.net/content/images/2021/02/screen_shot.png" class="kg-image" alt="Slack Beer Bot" srcset="https://etoxin.net/content/images/size/w600/2021/02/screen_shot.png 600w, https://etoxin.net/content/images/size/w1000/2021/02/screen_shot.png 1000w, https://etoxin.net/content/images/size/w1600/2021/02/screen_shot.png 1600w, https://etoxin.net/content/images/2021/02/screen_shot.png 1982w" sizes="(min-width: 720px) 720px"></figure><p>A part of the purpose of this build was to road test multiple server solutions. These were: AWS Lambda, Heroku, @vercel/now. A full write up and blog post will be coming soon.</p>]]></content:encoded></item><item><title><![CDATA[What would a Immediately Invoked Class Expression look like in JavaScript?]]></title><description><![CDATA[<p>What would a Immediately Invoked Class Expression in JavaScript look like. This is the question I asked myself. I couldn’t find anything online, so I created one.</p><p>Below we have a Immediately Invoked Class Expression. This could also be called a Self-Executing Anonymous Class.</p><pre><code class="language-javascript">void new class {
  constructor () {
    statements</code></pre>]]></description><link>https://etoxin.net/what-would-a-immediately-invoked-class-expression-look-like-in-javascript/</link><guid isPermaLink="false">60338b0ed2f36e11de7f1f4a</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Wed, 19 Dec 2018 10:46:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/carbon.png" medium="image"/><content:encoded><![CDATA[<img src="https://etoxin.net/content/images/2021/02/carbon.png" alt="What would a Immediately Invoked Class Expression look like in JavaScript?"><p>What would a Immediately Invoked Class Expression in JavaScript look like. This is the question I asked myself. I couldn’t find anything online, so I created one.</p><p>Below we have a Immediately Invoked Class Expression. This could also be called a Self-Executing Anonymous Class.</p><pre><code class="language-javascript">void new class {
  constructor () {
    statements
  }
}</code></pre><p>We have all heard of the Immediately Invoked Function Expression (IIFE) it is also known as a Self-Executing Anonymous Function. I was curious how this would look with Classes. There are two parts of a IIFE. The first is the anonymous function with lexical scope enclosed within the Grouping Operator (). This prevents accessing variables within the IIFE idiom as well as polluting the global scope. The second part creates the immediately executing function expression () through which the JavaScript engine will directly interpret the function.</p><p>To replicate this, our Immediately Invoked Class Expression would need at least these two features.</p><p>Above is what a Immediately Invoked Class Expression looks like. There are a few parts to this design pattern. Let me take you through them.</p><p>The <code>void</code> operator evaluates the given expression and then returns <code>undefined</code>. This will prevent our class polluting the global scope by always returning <code>undefined</code>.</p><p>The <code>new</code> operator interprets the defined anonymous class immediately. This then calls the classes <code>constructor</code> function as per the ECMAscript spec. So there you have it.</p>]]></content:encoded></item><item><title><![CDATA[NPM Module classList-helper version 1.1.2]]></title><description><![CDATA[<h3 id="classlist-update">classList update</h3><p>I’ve just updated the npm module <a href="https://web.archive.org/web/20200818131907/https://www.npmjs.com/package/classlist-helper">https://www.npmjs.com/package/classlist-helper </a> to 1.1.2 It now has full unit testing.</p><h3 id="introduction">Introduction</h3><p>A Element.classList method helper function that can be curried for functional programing.</p><h3 id="example">Example</h3><p><em>Task</em>: Add the class <code>active</code> to all list elements.</p><pre><code>&lt;</code></pre>]]></description><link>https://etoxin.net/npm-module-classlist-helper-version-1-1/</link><guid isPermaLink="false">60338c3cd2f36e11de7f1f63</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Wed, 15 Aug 2018 11:52:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/carbon-3.png" medium="image"/><content:encoded><![CDATA[<h3 id="classlist-update">classList update</h3><img src="https://etoxin.net/content/images/2021/02/carbon-3.png" alt="NPM Module classList-helper version 1.1.2"><p>I’ve just updated the npm module <a href="https://web.archive.org/web/20200818131907/https://www.npmjs.com/package/classlist-helper">https://www.npmjs.com/package/classlist-helper </a> to 1.1.2 It now has full unit testing.</p><h3 id="introduction">Introduction</h3><p>A Element.classList method helper function that can be curried for functional programing.</p><h3 id="example">Example</h3><p><em>Task</em>: Add the class <code>active</code> to all list elements.</p><pre><code>&lt;ul&gt;
  &lt;li class="item"&gt;item&lt;/li&gt;
  &lt;li class="item"&gt;item&lt;/li&gt;
  &lt;li class="item"&gt;item&lt;/li&gt;
  &lt;li class="item"&gt;item&lt;/li&gt;
&lt;/ul&gt;</code></pre><h3 id="setup">Setup</h3><pre><code>// import various libs
import { map, curry } from 'lodash';
let classListHelper = require('classlist-helper');

// Get the list of elements that you want to change
let nodeList = document.querySelectorAll('.item'); // 4 html elements</code></pre><h2 id="usage-">Usage:</h2><pre><code>// Create Active method with classListHelper.
let setActive = curry(classlistHelper)('active')('add');

// Set all elements to Active.
map(nodeList, setActive);</code></pre><p>After running this, the html will look like:</p><pre><code>&lt;ul&gt;
  &lt;li class="item active"&gt;item&lt;/li&gt;
  &lt;li class="item active"&gt;item&lt;/li&gt;
  &lt;li class="item active"&gt;item&lt;/li&gt;
  &lt;li class="item active"&gt;item&lt;/li&gt;
&lt;/ul&gt;</code></pre><h2 id="other-example-methods">Other example methods</h2><pre><code>// Remove a Class
let setInActive = curry(classlistHelper)('active')('remove');

// Add a Class
let setActive = curry(classlistHelper)('active')('add');

// Toggle a class 
let toggleActive = curry(classlistHelper)('active')('toggle');

// Add multiple classes / Pass an Array
let setMultiple = curry(classlistHelper)(['active','updated'])('add');

// Test all elements in an Array for a class
let anyActive = curry(classlistHelper)('active')('contains');

// Replace a class with another.
let setInactive = curry(classlistHelper)(['active', 'inactive'])('replace');</code></pre><p><em>Note:</em> For more examples please check the unit tests.</p>]]></content:encoded></item><item><title><![CDATA[npm browser-classes]]></title><description><![CDATA[<!--kg-card-begin: html-->
			<p>I’ve just released version 1.0.1 of a new npm module browser-classes.</p>
<p><a title="https://npmjs.com/package/browser-classes" href="https://web.archive.org/web/20200818131907/https://npmjs.com/package/browser-classes" target="_blank">https://npmjs.com/package/browser-classes</a></p>
<h1><a id="browserclasses_0"></a>browser-classes</h1>
<p>Adds browser classes to document body. For better cross-browser SCSS styling.</p>
<p>This library adds the current browser and version to the <code>&lt;body&gt;</code> tag as a class to the</p>]]></description><link>https://etoxin.net/npm-browser-classes/</link><guid isPermaLink="false">60338ec6d2f36e11de7f1f8e</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Thu, 26 Jul 2018 12:00:00 GMT</pubDate><media:content url="https://etoxin.net/content/images/2021/02/carbon-4.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: html-->
			<img src="https://etoxin.net/content/images/2021/02/carbon-4.png" alt="npm browser-classes"><p>I’ve just released version 1.0.1 of a new npm module browser-classes.</p>
<p><a title="https://npmjs.com/package/browser-classes" href="https://web.archive.org/web/20200818131907/https://npmjs.com/package/browser-classes" target="_blank">https://npmjs.com/package/browser-classes</a></p>
<h1><a id="browserclasses_0"></a>browser-classes</h1>
<p>Adds browser classes to document body. For better cross-browser SCSS styling.</p>
<p>This library adds the current browser and version to the <code>&lt;body&gt;</code> tag as a class to the site.</p>
<p>Once you run the class, your <code>&lt;body&gt;</code> tag will have the following class added.</p>
<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-title">body</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">"browser-firefox-65"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">body</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">"browser-ie-10"</span>&gt;</span>
</code></pre>
<h2><a id="Installation_13"></a>Installation</h2>
<pre><code>npm i --save browser-classes
</code></pre>
<h2><a id="Usage_19"></a>Usage</h2>
<pre><code class="language-js"><span class="hljs-keyword">import</span> BrowserClasses <span class="hljs-keyword">from</span> <span class="hljs-string">'browser-classes'</span>;
<span class="hljs-keyword">new</span> BrowserClasses();
</code></pre>
<h2><a id="SCSS_Usage_26"></a>SCSS Usage</h2>
<p>Use the <code>@at-root</code> method when using with SCSS</p>
<pre><code class="language-scss"><span class="hljs-class">.myClass</span> {
    <span class="hljs-attribute">color</span><span class="hljs-value">: red;</span>
    <span class="hljs-at_rule">@at-root<span class="hljs-preprocessor"> .browser-ie-10</span> {</span>
        <span class="hljs-attribute">color</span><span class="hljs-value">: blue
    }
}
</span></code></pre>
<p>This will target Internet Explorer 10 with <code>browser-ie-10</code> added to the body tag.</p>
<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-title">body</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">"browser-ie-10"</span>&gt;</span>
</code></pre>
<h2><a id="Javascript_usage_45"></a>Javascript usage</h2>
<p>The below method can test for Internet Explorer 9</p>
<pre><code class="language-js"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">document</span>.body.classList.contains(<span class="hljs-string">'browser-ie-9'</span>)) {
    <span class="hljs-comment">// fix</span>
}
</code></pre>
<h2><a id="Browser_only_targeting_55"></a>Browser only targeting</h2>
<p>To target only a certain browser not by version use the following syntax.</p>
<h5><a id="CSS_59"></a>CSS</h5>
<pre><code class="language-css"><span class="hljs-tag">body</span><span class="hljs-attr_selector">[class^="browser-firefox"]</span> <span class="hljs-rules">{
    <span class="hljs-rule"><span class="hljs-attribute">color</span>:<span class="hljs-value"> red</span></span>;
}</span>
</code></pre>
<h2><a id="Browser_Support_67"></a>Browser Support</h2>
<p>Currently, this library identifies the following browsers:</p>
<ul>
<li>Chrome</li>
<li>Internet Explorer</li>
<li>Edge</li>
<li>Safari</li>
<li>Firefox</li>
</ul>
<h2><a id="Example_class_names_for_browsers_76"></a>Example class names for browsers</h2>
<p>Below are some examples of the classes that will be generated for the browsers.</p>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Browser</th>
<th>Class</th>
</tr>
</thead>
<tbody>
<tr>
<td>Internet Explorer 10</td>
<td><code>&lt;body class="browser-ie-10"&gt;</code></td>
</tr>
<tr>
<td>Edge 12</td>
<td><code>&lt;body class="browser-edge-12"&gt;</code></td>
</tr>
<tr>
<td>Google Chrome 50</td>
<td><code>&lt;body class="browser-chrome-50"&gt;</code></td>
</tr>
<tr>
<td>Firefox 60</td>
<td><code>&lt;body class="browser-firefox-60"&gt;</code></td>
</tr>
<tr>
<td>Safari 11</td>
<td><code>&lt;body class="browser-safari-1"&gt;</code></td>
</tr>
</tbody>
</table>
					<!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[GIT Cheat Sheet]]></title><description><![CDATA[<p>As a front end developer tools like source tree and Webstorm’s GIT GUI are life savers. But sometimes you need to open up the terminal to work with your GIT repo. Over the years I’ve saved a few commands that I use frequently. There are a few commands</p>]]></description><link>https://etoxin.net/git-cheat-sheet/</link><guid isPermaLink="false">60338d61d2f36e11de7f1f82</guid><category><![CDATA[code]]></category><dc:creator><![CDATA[Adam Lusted]]></dc:creator><pubDate>Tue, 04 Apr 2017 11:54:00 GMT</pubDate><content:encoded><![CDATA[<p>As a front end developer tools like source tree and Webstorm’s GIT GUI are life savers. But sometimes you need to open up the terminal to work with your GIT repo. Over the years I’ve saved a few commands that I use frequently. There are a few commands that will save your bacon on the odd occasion. Below is the GIST that I use and update.</p><!--kg-card-begin: markdown--><h3 id="searchregex">search (regex)</h3>
<pre><code>git grep &quot;regex&quot;
</code></pre>
<h3 id="listallbranches">list all branches</h3>
<pre><code>git branch -a
</code></pre>
<h3 id="listremotebranches">list remote branches</h3>
<pre><code>git branch -r
</code></pre>
<h3 id="checkoutabranchonremote">checkout a branch on remote</h3>
<p>make sure you don't use <code>origin</code></p>
<pre><code>git fetch
git checkout branchName
</code></pre>
<h3 id="createanewbranch">Create a new branch</h3>
<p>first create a branch</p>
<pre><code>git checkout -b &lt;branchName&gt;
</code></pre>
<p>Create a new branch from an existing branch</p>
<pre><code>git checkout origin/branchName -b newBranchName
</code></pre>
<p>Then push your new branch to the repo</p>
<pre><code>git push origin &lt;branchName&gt;
</code></pre>
<h3 id="createabranchfromacommit">Create a branch from a commit</h3>
<p>AKA Recover a deleted branch</p>
<pre><code>git checkout -b &lt;branch&gt; &lt;sha&gt;
</code></pre>
<h3 id="revertallchangesinabranchremovesstagedandworkingdirectorychanges">revert all changes in a branch. Removes staged and working directory changes.</h3>
<pre><code>git reset --hard
</code></pre>
<h3 id="resetsindextoformercommitreplace56e05fcedwithyourcommitcodeyoucanusegitlogtogetcommitcode">Resets index to former commit; replace <code>56e05fced</code> with your commit code. You can use git log to get commit code</h3>
<pre><code>git reset 56e05fced
</code></pre>
<h3 id="revertafiletothemostrecentcommit">revert a file to the most recent commit</h3>
<pre><code>git checkout HEAD -- /somePath/file.txt
</code></pre>
<h3 id="todiscardchangesinworkingdirectory">to discard changes in working directory</h3>
<pre><code>git checkout -- &lt;file&gt;
</code></pre>
<h3 id="checkoutafilefromanotherbranch">Checkout a file from another branch</h3>
<pre><code>git checkout origin/branchName  -- fileName.txt
</code></pre>
<h3 id="undothelastcommitblowitoutofthewater">undo the last commit. Blow it out of the water.</h3>
<pre><code>git reset --hard HEAD~1
</code></pre>
<h3 id="undoyourlastcommitbutleavethefilesfromthatcommitstaged">undo your last commit but leave the files from that commit staged.</h3>
<pre><code>git reset --soft HEAD~1
</code></pre>
<h3 id="deletelocaluntrackedfiles">delete local (untracked) files</h3>
<pre><code>git clean -f
</code></pre>
<h3 id="ifyouwanttoalsoremovedirectoriesrun">If you want to also remove directories, run</h3>
<pre><code>git clean -f -d
</code></pre>
<h3 id="cleanafolder">clean a folder</h3>
<pre><code>git clean -fxd {dir_path}
</code></pre>
<h3 id="commitafolderfilewithoutstagingit">commit a folder/file without staging it.</h3>
<pre><code>git commit /folderToCommit -m 'commit msg'
</code></pre>
<h3 id="listallbranchesremotelocalremoteonly">list all branches (remote &amp; local/remote only)</h3>
<pre><code>git branch -a
git branch -r
</code></pre>
<h3 id="findoutallbranchesacommitison">Find out all branches a commit is on</h3>
<pre><code>git branch --contains &lt;commit&gt;
</code></pre>
<h3 id="displaylogwithtree">display log with Tree</h3>
<pre><code>git log --pretty=format:&quot;%h - %cr (%an) %s&quot; --graph
</code></pre>
<h3 id="mergemasterintoyourlocalbranch">Merge Master into your local branch</h3>
<pre><code>git fetch
git merge origin/master
</code></pre>
<p>a shortcut to this is. They are both the same</p>
<pre><code>git pull origin master
</code></pre>
<p>or, if it's a busy repo.</p>
<pre><code>git pull --rebase &lt;remote name&gt; &lt;branch name&gt;
</code></pre>
<h3 id="listconflicts">list conflicts</h3>
<pre><code>git diff --name-only --diff-filter=U
grep -lr '&lt;&lt;&lt;&lt;&lt;&lt;&lt;' .
</code></pre>
<h3 id="diffaconflict">Diff a conflict</h3>
<pre><code>git mergetool -t opendiff
</code></pre>
<h3 id="pullabranchmergeifconflicteduseremote">pull a branch , merge if conflicted use remote.</h3>
<pre><code>git pull -s recursive -X theirs origin ra
</code></pre>
<h3 id="showlogwithmergedfiles">show log with merged files</h3>
<pre><code>git log -m -1 --name-only
</code></pre>
<h3 id="showthechangesbetweentwobranches">Show the changes between two branches.</h3>
<pre><code>git diff --name-status master..branchName &gt; changelog.txt
</code></pre>
<h3 id="recoveradeletedbranch">Recover a deleted branch</h3>
<p>Get the SHA of the last commit on the branch.</p>
<pre><code>git checkout -b newbranchname 56e05fced
</code></pre>
<h2 id="stashes">Stashes</h2>
<h3 id="saveastash">save a stash</h3>
<pre><code>git stash save &quot;My changes.&quot;
</code></pre>
<h3 id="listyoursavedstashes">list your saved stashes</h3>
<pre><code>git stash list
</code></pre>
<h3 id="applyastashwherestash1isthestashyouwanttoapply">apply a stash (Where stash@{1} is the stash you want to apply.)</h3>
<pre><code>git stash apply stash@{1}
</code></pre>
<h3 id="deleteabranchonorigin">delete a branch on origin</h3>
<pre><code>git push origin --delete &lt;branchName&gt;
</code></pre>
<h3 id="deleteabranchlocally">delete a branch locally</h3>
<pre><code>git branch -d &lt;branchName&gt;
</code></pre>
<h3 id="getallcommitsfromabranchforareleaselogchangelogetc">Get all commits from a branch. For a release log, changelog etc.</h3>
<pre><code>git cherry -v develop mybranch
</code></pre>
<h3 id="revertacommitthatisoriginremote">Revert a commit that is origin/remote</h3>
<p>This reverts the commit with a new commit.</p>
<p>First get the commit sha.</p>
<pre><code>git revert -m 1 &lt;commit-hash&gt; 
git commit -m &quot;Reverting the last commit which messed the repo.&quot;
git push -u origin master
</code></pre>
<h1 id="utilities">Utilities</h1>
<h3 id="getthestatusonallreposinafolder">Get the status on all repos in a folder</h3>
<pre><code>find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} &amp;&amp; cd {} &amp;&amp; git status -s &amp;&amp; echo)' \;
</code></pre>
<p>Save the results to a file.</p>
<pre><code>find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} &amp;&amp; cd {} &amp;&amp; git status -s &amp;&amp; echo)' \; &gt; gitreport.txt
</code></pre>
<h3 id="deletealllocalbranchesthatdontexistonorigin">Delete all local branches that don't exist on <code>origin</code></h3>
<p>run <code>git fetch -p</code> this removes the remote references.</p>
<p>run <code>git branch -vv</code></p>
<p>then run the following script</p>
<pre><code>git fetch -p &amp;&amp; for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
</code></pre>
<p>keywords: prune</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>