<?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 Adriaan Knapen on Medium]]></title>
        <description><![CDATA[Stories by Adriaan Knapen on Medium]]></description>
        <link>https://medium.com/@addono?source=rss-60287d27186b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zMvo5CwkG0nrHyi-1IiJ8w.png</url>
            <title>Stories by Adriaan Knapen on Medium</title>
            <link>https://medium.com/@addono?source=rss-60287d27186b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 15:17:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@addono/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[Global declarative Cronjobs in Nest.js with Bull]]></title>
            <link>https://addono.medium.com/global-declarative-cronjobs-in-nest-js-with-bull-8e35be55f81d?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e35be55f81d</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[message-queue]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Sun, 05 Feb 2023 12:39:25 GMT</pubDate>
            <atom:updated>2023-02-05T12:39:25.023Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a couple of ways on how to schedule repeatable jobs in Nest.js. @nestjs/schedule is what the <a href="https://docs.nestjs.com/techniques/task-scheduling">official documentation</a> guides you towards. It&#39;s an elegant CRON-based API, which should be familiar to most developers.</p><p>Look at how elegant this declarative API is:</p><pre>@Injectable() <br>export class MyService { <br>  @Cron(&quot;* * * * * *&quot;) <br>  handleCron() { <br>    console.log(&quot;CRON is triggered&quot;); <br>  }<br>}</pre><p>With one line, we now have a method which will trigger whenever our heart desired. Pretty neat.</p><p>However, one downside of @nestjs/schedule is that it creates one Cronjob for every instance of your application you&#39;re running. This is fine if your entire app runs only once, however for scaling and redundancy reasons you probably want to start horizontally scaling your application. Now, the same task will run multiple times.</p><p>At best, this is just wasteful, e.g. cleaning multiple processes to try to clean something up in your database at the same time. Other times, it will actually cause problems, e.g. it would be bad to send a daily digest email to all your users multiple times.</p><h3>Global jobs</h3><p><a href="https://github.com/OptimalBits/bull">Bull</a> is a <a href="https://docs.nestjs.com/techniques/queues">job queue with direct support by Nest.js</a>. Besides queuing jobs, you can also use it to schedule repeatable jobs. Those jobs are persisted in Redis as its data store.</p><p>This Redis data store is shared by all the instances of your application. Now, whenever a repeatable job is ready to be scheduled, one of your instances will pick it up. Now Bull is responsible for tracking whether the job successfully completes, and we can configure it to retry jobs. Bonus points for resiliency.</p><p>Using Bull for repeatable jobs has one downside though: There’s no declarative API available to automatically create these jobs. So, either you need to do it manually — 🤮 — or have your application manage it.</p><p>Luckily, it turns out to be quite easy to let your application manage it. Take a look at the following example. It consists of one service and a job processor class. The interesting bit here is that the service has a onModuleInit-method, which is responsible for scheduling our static jobs.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e425a3db01d6bf62952770d03302a164/href">https://medium.com/media/e425a3db01d6bf62952770d03302a164/href</a></iframe><p>Now, every time our application starts, it will delete all existing scheduled jobs and schedule the jobs we need. This way, if we release a newer version of our app with jobs with a different configuration, the application will reconfigure the jobs.</p><p><em>Originally published at </em><a href="https://www.aknapen.nl/blog/20230205-declarative-static-bull-jobs-in-nestjs/"><em>https://www.aknapen.nl</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e35be55f81d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rendering Azure Log Analytics make-series in Grafana]]></title>
            <link>https://addono.medium.com/rendering-azure-log-analytics-make-series-in-grafana-62498fbc9943?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/62498fbc9943</guid>
            <category><![CDATA[visualisation]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[azure-log-analytics]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Sun, 18 Sep 2022 05:59:18 GMT</pubDate>
            <atom:updated>2022-09-18T05:59:18.931Z</atom:updated>
            <content:encoded><![CDATA[<p>Not to long ago I got into building a metrics dashboard for our resources in Azure. Specifically, we’re running our applications in Azure Kubernetes Services and want to have a dashboard to track how everything is doing. Since we already have our logs emitted to Azure Log Analytics we could use that to build our metrics.</p><p>Writing the queries to fetch our data from Log Analytics is rather straight forward. However, the graphs it produces aren’t as interactive as we would like it to be.</p><p>Also, in the future we would like to be able to easily ingest data from other sources as well. Therefore, we started evaluating the use of Grafana to render the graphs.</p><p>We would still write our queries in Kusto — Azure Log Analytic’s query language — but after that let Grafana render this data in a dashboard.</p><p>One issue we quickly ran into is that the Grafana plugin for Log Analytics doesn’t support render the data you would get with make-series straight out of the box.</p><h3>An example of make-series</h3><p>For reference, here’s a small query using make-series and how it’s rendered in the Azure Portal:</p><pre>ContainerLog<br>| make-series Count=count() on TimeGenerated from ago(1d) to now() step 5m</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W_WXAt1yuon2AI_Y.png" /></figure><h3>Transforming make-series data</h3><p>Lucklily, we can use our Kusto-foo to transform the data from make-series to be in a format Grafana can handle.</p><p>The trick is to “expand” the make-series data - similar as to how zip works in Python - to go from the lists of measurements we received from make-series back into individual rows.</p><p>We can do that by adding the following the lines to our query.</p><pre>// Expand all data into individual rows<br>| mv-expand Series, TimeGenerated<br>// Map each column from the &quot;dynamic&quot; type back into the type we expect<br>| extend Series=todecimal(Series), TimeGenerated=todatetime(TimeGenerated)</pre><p>The resulting query, including the Grafana specific magical placeholders, would be:</p><pre>ContainerLog<br>| make-series Series=count() on TimeGenerated from $__timeFrom() to $__timeTo() step $__interval<br>| mv-expand Series, TimeGenerated<br>| extend Series=todecimal(Series), TimeGenerated=todatetime(TimeGenerated)</pre><p>Now, Grafana can render our data just fine as time-series 🎉 .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7EN1IZmv9jgHYWQ3.png" /></figure><p><em>This post was originally first published on my </em><a href="https://www.aknapen.nl/blog/20220916-render-azure-log-analytics-make-series-in-grafana/"><em>personal blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62498fbc9943" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collect Emails from NextJS Form in HubSpot]]></title>
            <link>https://addono.medium.com/collect-emails-from-nextjs-form-in-hubspot-27f76c70f3fe?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/27f76c70f3fe</guid>
            <category><![CDATA[landing-pages]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[hubspot]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Thu, 27 May 2021 19:38:09 GMT</pubDate>
            <atom:updated>2021-05-27T19:38:09.066Z</atom:updated>
            <content:encoded><![CDATA[<p>HubSpot is an awesome platform to centrally track all the contacts your company is doing business with. At <a href="https://claimr.tools/">ClaimR</a> we have been using HubSpot with great success, as it allows all our team members to have a single source of truth.</p><p>During the last few weeks I have been working on our renewed website. NextJS is a no-brainer at this point, as it is an amazing framework which spits out static HTML wherever it can — perfect for fast loading landing pages — while also giving you the flexibility to mix in some dynamic content and other server side logic. All in one simple framework, pretty neat right?</p><p>For this new website we wanted to have a simple form where our users can leave their email in case they are interested in hearing more of us. In this post I will show you how we in the end implemented this form, such that the form submission is directly stored in HubSpot, such that our single-source of truth stays the single source.</p><h3>Create the Form</h3><p>First, we create our form component. For this, we will be using plain React and the axios-hooks library to send the content of our form with. In case you haven’t installed it yet, first run:</p><pre># For npm<br>npm install axios axios-hooks<br><br># For Yarn<br>yarn add axios axios-hooks</pre><p>Then the component is just a simple form to which we supply a callback to Axios to make the webrequest with the form’s data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ad91a9f5ff44ba1c89b5117b717b84f/href">https://medium.com/media/3ad91a9f5ff44ba1c89b5117b717b84f/href</a></iframe><h3>Creating our API Endpoint</h3><p>You might have noticed by now that our EmailSignupComponent tries to send the content of the form to the /api/emailSignup endpoint. Our next step is to create this endpoint and create a truly functional form.</p><p>First, go to HubSpot and create a new form in the UI with just one field for the email. Make sure to remove any Captchas or other required fields, as they will interfere with submitting our form later on. In the address bar you can find the portal ID and form GUID, note these down as you will need to add them later.</p><p>We will be using the <a href="https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication">HubSpot Form AP</a> to directly submit our form entries to HubSpot. Yes, HubSpot advocates for alternative approaches, such as their “Non-HubSpot Forms”, but in this way we stay in control of the form styling ourselves without needing to add the HubSpot tracking code to our website.</p><p>The following class is the complete serverless function which will forward the data to HubSpot. Alternatively, you can also use the unauthenticated API and directly sent the form submissions there, with the downside that the GUID of the form becomes public and you might have to filter out a lot of spam. The upside would be that this eliminates the need for you managing any backend logic, allowing your static site to be truly static.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d02a21c9aa27a2bf2fd1f3384decdd9/href">https://medium.com/media/1d02a21c9aa27a2bf2fd1f3384decdd9/href</a></iframe><p><em>Note that the HubSpot API key is set as an environment variable </em><em>HUBSPOT_API_KEY. So make sure that that is available in the environment running this function.</em></p><p>This is pretty much all there’s to it. In the end, we have a quite simple solution which still allows us to style the form however we want. I left my specific styling out, but when the new website is live I will add link to show off the purty end-result.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27f76c70f3fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Plugin for Docusaurus]]></title>
            <link>https://javascript.plainenglish.io/how-to-build-a-plugin-for-docusaurus-v2-dd54d627a94e?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd54d627a94e</guid>
            <category><![CDATA[plugins]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[docusaurus]]></category>
            <category><![CDATA[documentation]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Mon, 12 Oct 2020 14:07:37 GMT</pubDate>
            <atom:updated>2020-10-14T19:59:47.531Z</atom:updated>
            <content:encoded><![CDATA[<h4>FROM ZERO TO PLUGIN</h4><h4>A brief guide on how to build and release your own plugins for Docusaurus v2</h4><p>At <a href="https://claimr.tools/">ClaimR</a> we have been using <a href="https://v2.docusaurus.io/">Docusaurus v2</a> for our <a href="https://developer.claimr.tools/">developer and documentation website</a> for a while now. After a couple of months of using it we can confidently say that we’re very happy with our choice.</p><p>Docusaurus comes batteries-included, so you immediately get a lot of value, while it is flexible enough to tailor it to your needs if there’s something you like differently. Also, their documentation is superb, as you would expect from a framework who owes its existence to its ability to create documentation websites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jn2w4Z-8EVMDdWTMH4_CKQ.png" /></figure><h3>Docu-what?</h3><p>For anyone unfamiliar to Docusaurus, Docusaurus an open-source framework created by Facebook for making documentation websites for all their open-source tools. If you have been working on some NodeJS projects, then you have likely used <a href="https://docusaurus.io/en/users">documentation generated by Docusaurus</a>, just to name some examples: <a href="https://jestjs.io/">Jest</a>, <a href="https://facebook.github.io/create-react-app/">Create React App</a>, and <a href="https://redux.js.org/">Redux</a>.</p><p>Now Facebook is working on the next iteration for Docusaurus, called Docusaurus v2. Which makes it a performant static site generator to quickly create all sorts of websites. Support for documentation is still a first-class citizen, but now you are free to use it to create whatever your heart desires. Officially it’s still in alpha, but to our experience it’s already very stable and <a href="https://v2.docusaurus.io/docs/#disclaimer">new projects are encouraged</a> by Facebook to adopt Docusaurus v2.</p><h3>Why Would I Need Plugins?</h3><p>The main reason why plugins exist in the Docusaurus ecosystem is reusability. There are plenty of bits of code which have a generic purpose, with plugins you can share these bits of code between these projects. Docusaurus uses plugins to separate the logic for creating blogs or documentation pages from core Docusaurus. Plugins can also be used for adding functionalities which aren’t directly user facing, e.g. there are official plugins for optimizing images, adding Google Analytics or creating sitemaps.</p><p>The official plugins are very useful, but it might be that your use-case is not satisfied by them. In our case at ClaimR we are using a different analytics provider than Google Analytics. Plugins are very useful here, as you can use them to inject the tracking code in every generated page.</p><h3>The Process</h3><p>Let’s first go over the process of creating your own plugin, later we will go over them step-by-step to dive into each of them more in-depth. For context, we will follow our process of adding GoatCounter analytics to our documentation, which now lives in <strong>docusaurus-plugin-goatcounter</strong> at <a href="https://www.npmjs.com/package/docusaurus-plugin-goatcounter">npm</a>. It can be helpful to check out the <a href="https://github.com/facebook/docusaurus/tree/master/packages">source code</a> of the official plugins as inspiration on how to implement a plugin fitting your use-case. We used the ‘@docusaurus/plugin-google-analytics’ as our starting point.</p><ol><li><strong>Prototype Locally</strong> Docusaurus allows you to create a plugin in the same source-code as your current project. This allows you to experiment and very quickly get results.</li><li><strong>Move Plugin to Separate Codebase</strong> Bootstrap a new project where the codebase of your Docusaurus plugin will live.</li><li><strong>Publish Your Plugin</strong> Lastly, we will publish your plugin to NPM, such that you can now include it in all your projects.</li></ol><h3>1. Prototyping Locally</h3><p>The <a href="https://v2.docusaurus.io/docs/using-plugins#creating-plugins">documentation</a> of Docusaurus v2 briefly covers how to create plugins. Those instructions target creating a new plugin directly in your current project. We found that this greatly lowers the barrier of entry and allows quick experimentation. If you’re building a large plugin, then you might want to skip this step and start building from a separate code-base, since that will also give you type hinting as we will add TypeScript.</p><p><a href="https://github.com/ClaimR/developer-website/commit/28becd61873c3dc77566b5699e61b3289bbf38cd">This</a> is the full commit adding our initial version for GoatCounter analytics to our project. Here we will use a slightly simplified version, such that we can focus on the core functionality. For anyone unfamiliar with GoatCounter, we need the plugin to add the following HTML to every page:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3d0a4ca811dcbe4ccb93d254ddaa477/href">https://medium.com/media/a3d0a4ca811dcbe4ccb93d254ddaa477/href</a></iframe><p>First create plugins/goatcounter/index.js and add the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e079bfd1a0c7629d2bf985f22dde47d1/href">https://medium.com/media/e079bfd1a0c7629d2bf985f22dde47d1/href</a></iframe><p>Now, in docusaurus.config.js add your plugin:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39097d1f268a7f1072df09be8dd2cc6d/href">https://medium.com/media/39097d1f268a7f1072df09be8dd2cc6d/href</a></iframe><p>Restart Docusaurus and now every page should have your analytics included in the HTML 🎉 .</p><h3>2. Creating a Standalone Plugin</h3><p>Having the plugin in the same code-base as your Docusaurus website might be easy for prototyping. However, it doesn’t allow reusing this piece of logic. Also, your Docusaurus website might not be using TypeScript, which we can add to our plugin project to have type hinting for our plugin.</p><p>To bootstrap our project we are going to use <a href="https://tsdx.io/">TSDX</a>, it sets up a complete TypeScript development package for us.</p><pre>npx tsdx create docusaurus-plugin-goatcounter</pre><p>Then add Docusaurus’ types. We explicitly define the desired function, as the ‘latest’-tag is not kept up-to-date. See <a href="https://www.npmjs.com/package/@docusaurus/types">npm</a> for the latest version.</p><pre>yarn add --dev @docusaurus/types@2.0.0-alpha.65</pre><p>Now you can copy the content of plugins/goatcounter/index.js and place it in src/index.ts of your new project.</p><p>Since we are migrating from plain JS to TypeScript do we need some minor modifications. Replace this from plugins/goatcounter/index.js:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e23fbbf0bd5f73b639a71b5ef309995/href">https://medium.com/media/2e23fbbf0bd5f73b639a71b5ef309995/href</a></iframe><p>With this in src/index.ts:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e38f38d0ad12761a16fc48d26597f13b/href">https://medium.com/media/e38f38d0ad12761a16fc48d26597f13b/href</a></iframe><p>To test your plugin, run yarn build &amp;&amp; yarn link in the directory of your newly created plugin. Then in your Docusaurus project, run yarn link docusaurus-plugin-goatcounter and modify docusaurus.config.js to import the plugin as a package, instead of the file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/343b14f42ce0a834bd997df3f4fe7f56/href">https://medium.com/media/343b14f42ce0a834bd997df3f4fe7f56/href</a></iframe><h3>3. Publish Your Plugin</h3><p>Publishing your plugin is as simple as running npm publish and following the steps it gives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQdLpREaLxcNPtsCe8v67g.png" /></figure><p>If you previously linked your plugin to your Docusaurus project, then you first need to run yarn unlink docusaurus-plugin-goatcounter in your Docusaurus project. Then you can add your dependency from npm:</p><pre>yarn add docusaurus-plugin-goatcounter</pre><p>Restart Docusaurus and now you’re using your freshly made standalone Docusaurus plugin 🥳 .</p><h3>Troubleshooting</h3><p>Something unclear? Checkout the source code of the <a href="https://github.com/Addono/docusaurus-plugin-goatcounter">plugin</a> and a <a href="https://github.com/ClaimR/developer-website">Docusaurus project</a> using the plugin. Also, feel free to send <a href="/service/mailto:hi@aknapen.nl">email me</a>!</p><p>Enjoyed this article? If so, get more similar content by <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>subscribing to Decoded, our YouTube channel</strong></a><strong>!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd54d627a94e" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/how-to-build-a-plugin-for-docusaurus-v2-dd54d627a94e">How to Build a Plugin for Docusaurus</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Always-Free Managed Postgres Databases Reviewed]]></title>
            <link>https://addono.medium.com/always-free-managed-postgres-databases-reviewed-9379388901d?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9379388901d</guid>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[free]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Tue, 25 Aug 2020 12:36:40 GMT</pubDate>
            <atom:updated>2020-08-25T12:36:40.056Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m a big proponent for serverless, especially for small but long-running projects. Such project needs to be as simple as possible to get started and require no maintenance. Many of the serverless providers offer a generous free-tier, which often suffices until the project gains traction.</p><p>Serverless compute resources are quite easy to come by, for example <a href="https://vercel.com/">Vercel</a>, <a href="https://www.netlify.com/">Netlify</a> or <a href="https://aws.amazon.com/lambda/">AWS Lambda</a> allow for a vast amount of serverless function executions in their free-tier. If you don’t like serverless functions and rather go for containers, then there’s <a href="https://heroku.com/">Heroku</a> or <a href="https://fly.io/">Fly</a>. Free databases are on the other hand harder to come by and often a lot more constrained in their free tier.</p><p>When building one of my simple and personal projects on top of Postgres I switched a couple of times between several free tiers. As it happens, the performance of these databases vary greatly, which is something they do not advertise on their sign up page.</p><p>Next I will cover Heroku Postgres, ElephantSQL and AlwaysData. These services all have an always free tier on their managed Postgres. All major cloud providers also have free tiers or free trial credits for their managed Postgres services, however here they will be omitted as this won’t be a solution for a project which you want to keep running for more than a year without pulling out your wallet or migrating the database.</p><p>For each of the database offerings I cover there’s also a demo deployment of a simple web-app. Feel free to play around with it and judge the performance of each of the providers by yourself. You can use your browser inspection mode to get better insight in the timing or cause of errors. Note that all deployments might need some warm up time, as resources will get unprovisioned when they are not accessed for a while.</p><h3>Heroku Postgres</h3><p>If you’re able to host your project on Heroku, then I would recommend them wholeheartedly. They have amazing performance, are easy to integrate with into your project and have a pleasant UI.</p><p>✅ Automatically exposes the database connection string as an environment variable to your application</p><p>✅ Intuitive UI which clearly shows how much of the resources in your tier you are consuming</p><p>✅ Daily backups for the last 7 days</p><p>✅ Superb performance (&lt;100ms for complete requests, both read and write)</p><p>✅ Recent version of Postgres (12.3 whilst latest as of writing is 12.4)</p><p>❌ Requires hosting your application on a Heroku Dyno, as they regularly automatically the database password</p><p>❌ Automated backup can only be configured using their CLI</p><p>Limits: 10,000 rows; 20 concurrent database connections; 1 GB database.</p><p>Demo: <a href="https://heroku-postgres-addon.herokuapp.com/">https://heroku-postgres-addon.herokuapp.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/0*rrYt3jUaFq_xPexP.png" /></figure><h3>ElephantSQL</h3><p>Searching for free a free managed Postgres database probably lets you end up at <a href="https://www.elephantsql.com/">ElephantSQL</a>. Won’t recommend them at all, the performance is terrible, they run an outdated version of Postgres and have a very limited free tier.</p><p>✅ Static database connection url allows hosting your application on a different application provider</p><p>✅ Allows you to choose the underlying cloud-provider</p><p>❌ Simple queries taking 2 seconds is quite common</p><p>❌ Runs an outdated version of Postgres (11.5)</p><p>❌ 5 concurrent connections easily exhausted when old deployments keep connections open (regularly newly deployed serverless functions were unavailable, as older deployments exhausted the connection pool)</p><p>Limits: 5 concurrent database connections; 20 MB database</p><p>Demo: <a href="https://elephantsql.vercel.app/">https://elephantsql.vercel.app</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/0*IbqpOvzx4SPdcP-R.png" /></figure><h3>AlwaysData</h3><p>If Heroku isn’t an option and you still want to have slightly better performance than ElephantSQL, then <a href="https://www.alwaysdata.com/">AlwaysData</a> could be an option. Their UI is decent looking and powerful, however getting simple things done takes some exploring before you get what you were looking for.</p><p>✅ Powerfull role-based access control to limit access rights for each user by database</p><p>✅ Insight and possibility to terminate individual connections</p><p>❌ Simple read queries take around 500ms whilst write can go up to 2 seconds</p><p>❌ UI takes some getting used to</p><p>❌ Only using databases whilst on their free tier is against their ToS</p><p>❌ Their deployment model dates from before containers (think along the lines of assuming your deployment process consists of uploading PHP files over FTP), so you’re out of luck if your Node application requires npm install or is container based</p><p>Limits: 50 concurrent database connections; 100 MB database (both shared globally on your account)</p><p>Demo: <a href="https://alwaysdata.vercel.app/">https://alwaysdata.vercel.app</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0nyv0S3UlR6XXYn1.png" /></figure><h3>Conclusion</h3><p>None of these options are perfect and what you get seems a lot more restrictive and limited compared to serverless compute options. ElephantSQL and AlwaysData seem like relics from the PHP days whose DBaaS service might still be useful in the cloud era. However, both services seem heavily under provisioned, hence performance wise they seem unsuitable for applications where the user needs to wait for database queries. Heroku on the other hand offers a crisp UI and their deployment models is truly cloud native.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9379388901d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prod++[3]: Leaner Search Using DuckDuckGo !Bangs]]></title>
            <link>https://addono.medium.com/prod-plus-plus-3-leaner-search-using-duckduckgo-bangs-8c7bc3474747?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c7bc3474747</guid>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[duckduckgo]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[search]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Fri, 21 Aug 2020 08:40:00 GMT</pubDate>
            <atom:updated>2020-08-21T08:40:00.406Z</atom:updated>
            <content:encoded><![CDATA[<h3>Prod++[3]: Leaner Search Using DuckDuckGo !Bangs</h3><p><em>In this mini-series I will walk you through some habits I replaced in recent times, which have shown to pay off and make me a more productive programmer/power-user of my computer. All these changes should be easy to gradually adopt, so I would highly recommend checking them out. If you’ve any suggestions ☝️ or improvements ✍️, then email me at </em><a href="/service/mailto:hi@aknapen.nl"><em>hi@aknapen.nl</em></a><em> or reach out using any of the social media listed </em><a href="https://aknapen.nl/"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fuklq9gmAF6Zs99P" /></figure><p><a href="https://start.duckduckgo.com/">DuckDuckGo</a> is often advocated as the privacy preserving alternative for Google. Besides protecting your privacy it also has a really cool feature called Bangs, which acts as a shortcut to query some commonly used websites.</p><p>Bangs work by prefixing your search query with a ! followed by a short code to identify which website you would like to query. To give some examples:</p><ul><li>!w turing opens the <a href="https://en.wikipedia.org/wiki/Alan_Turing">Wikipedia page of Alan Turing</a>.</li><li>!wa derivative of x^3 query <a href="https://www.wolframalpha.com/input/?i=derivative+of+x%5E3">Wolfram Alpha for the derivative of x cubed</a>.</li><li>!enes time translates <a href="https://translate.google.com/#en/es/time">“time” from English to Spanish using Google Translate</a>.</li><li>!so python try-catch searches <a href="https://stackoverflow.com/search?q=python%20try%2Dcatch">StackOverflow for “python try-catch”</a>.</li><li>!g meaning of life query <a href="https://www.google.com/search?hl=en&amp;q=meaning%20of%20life">Google search for the meaning of life</a></li><li>!i flower get <a href="https://duckduckgo.com/?q=flower&amp;ia=images&amp;iax=images">images of flowers</a>.</li></ul><p>I hope these examples give you a feel on how you can simplify querying specific services to find what you need faster.</p><p>You can find more about Bangs, including a list of all available Bangs, on <a href="https://duckduckgo.com/bang">DuckDuckGo’s website</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c7bc3474747" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Server Sided GraphQL with Apollo Client]]></title>
            <link>https://medium.com/swlh/server-sided-graphql-with-apollo-client-cf072a27145f?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf072a27145f</guid>
            <category><![CDATA[server-side]]></category>
            <category><![CDATA[apollo-client]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Tue, 30 Jun 2020 10:29:49 GMT</pubDate>
            <atom:updated>2020-07-02T20:34:24.063Z</atom:updated>
            <content:encoded><![CDATA[<p>During development of the <a href="https://dashboard.claimr.tools/">dashboard</a> I’m making for <a href="https://claimr.tools/">ClaimR</a> I found myself in the position where I wanted to query a GraphQL endpoint from my backend. (It’s a <a href="https://nextjs.org/">NextJS</a> powered project, hence the server sided logic is written in Node.) So, I started looking for GraphQL clients but with little success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_N4OEXMPtFa6w38H_rxUSg.png" /></figure><p><a href="https://github.com/prisma-labs/graphql-request">graphql-request</a> seemed like a match, with what looked like a recent release earlier this year. However, on closer inspection it’s pretty clear that it has been abandoned. In other words, not a proper foundation to build my new product upon. I came close to resorting to making plain HTTP requests myself, until I stumbled upon Apollo Client’s feature allowing you to make queries yourself!</p><p><a href="https://www.apollographql.com/docs/react/">Apollo Client</a> advocates in their documentation that it’s primarily for React, thus strongly pushing everyone to use their hook based architecture. Recently I have been using Apollo Client frequently for consuming GraphQL in frontend projects. However, this new project required consuming GraphQL on the server, therefore the React use-case didn’t apply.</p><p><strong>Behold</strong>, we can actually use the Apollo Client on server side. The documentation doesn’t mention this anywhere, and the client is actually branded as “Client (React)”. However, on the <a href="https://www.apollographql.com/docs/react/get-started/">Getting Started</a> page of the documentation, they start by using client.query(...) before they introduce hook and component based requests.</p><p>The options from client.query(...) and client.mutate(...) are very similar to the useQuery and useMutation we know from React. Both return a promise, which include the response, error and the like. Here&#39;s a little example to show roughly what it looks like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef19703c90b2226263e0fc8962d00541/href">https://medium.com/media/ef19703c90b2226263e0fc8962d00541/href</a></iframe><p>Note that in the snippet the defaultOptions of the client is configured to disable the cache. This is completely optional, however the default caching policy is reasonable for usage on the frontend. However, this default caching policy in the backend results in multiple issues in the backend.</p><p>For starters, your backend will start working with stale data. So in all likeliness, it will also start <strong>returning stale data</strong>. To make matters worse, during development hot-reloading will purge the cache every time you make a change to your backend or deploy a new version. Thus, at first glance it could all look fine, only to become an issue when you start working on something else.</p><p>I burned my fingers by having (unintentionally) client side and server side caching enabled — both are using Apollo Client. Figuring out where the stale data originated from was tedious, as you need to manually inspect the query responses. In addition, it’s very easy for another developer to not be aware of this server-side caching behavior, which will surely drive them mad when debugging.</p><p>Here and there I overwrote the fetchPolicy for individual queries to use caching, if I was certain that the response wouldn’t change. For example, there’s one query on one write-only field which can safely be cached. I’m still not too thrilled about it, but works for now and improves both performance and resource efficiency. However, violation of the implicit assumption about the query results being write only will cause incorrect behavior.</p><p>So the rule of thumb on enabling caching is simple, when in doubt, don&#39;t. Instead, focus on client-side caching wherever possible.</p><blockquote>Enable caching? When in doubt, don’t.</blockquote><p>Another issue that emerged as I deployed my backend as a serverless function, was data <strong>inconsistency</strong>. Each instance deployed by my serverless provider had its own cache, hence different instances would cache different data for the same query. To the user, this caused the data to flicker, as requests were routed to an instance at random, causing responses from different instances to contain different results.</p><p>Also, expect <strong>increased memory usage</strong>, as all responses are stored in the cache by default. This could quickly become an issue if you deploy your backend onto many small instances, as this cache will start to take up quite a bit of memory fast.</p><p>Lastly, this form of local caching will see <strong>degraded effectiveness</strong> when a lot of instances are used or instances are purged often — as would be the case in serverless environments. More instances mean having more individual caches, thus the chance of having a cache miss increases with more instances. In the end, the same data needs to be cached multiple times in order to get many cache hits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*xdVGlEH7f9cRVaR-" /><figcaption>Apollo, the maker of Apollo Client and Apollo Server.</figcaption></figure><p>To conclude, be mindful about caching. It can help a bit, but the default Apollo Client caching implementation is in memory and consequentially not as effective as it is on the client side. Maybe in the future we will see a Redis client, as <a href="https://www.npmjs.com/package/apollo-server-cache-redis">exists</a> for Apollo Server, but until then, we will have to make due with what we have.</p><p><em>Originally posted on my personal blog </em><a href="https://aknapen.nl/blog/server-sided-graphql-with-apollo-client/"><em>here</em></a><em>.</em></p><p><em>Thank you </em><a href="https://ksoutar.com/"><em>Keira Nicole Soutar</em></a><em> for taking the time to review this post.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf072a27145f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/server-sided-graphql-with-apollo-client-cf072a27145f">Server Sided GraphQL with Apollo Client</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prod++[2]: Managing Kubernetes Context Files]]></title>
            <link>https://addono.medium.com/prod-2-managing-kubernetes-context-files-c84c2da4c920?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c84c2da4c920</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[context]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Fri, 29 May 2020 05:26:00 GMT</pubDate>
            <atom:updated>2020-05-29T05:26:00.863Z</atom:updated>
            <content:encoded><![CDATA[<p>In this mini-series I will walk you through some habits I replaced in recent times, which have shown to pay off and make me a more productive programmer/power-user of my computer. All these changes should be easy to gradually adopt, so I would highly recommend checking them out. If you’ve any suggestions ☝️ or improvements ✍️, then email me at <a href="/service/mailto:hi@aknapen.nl">hi@aknapen.nl</a> or reach out using any of the social media listed <a href="https://aknapen.nl/">here</a>.</p><h3>Prod++[2]: Managing Kubernetes Context Files</h3><p>For anyone who ever worked a bit with Kubernetes, kubectx is probably quite familiar. Nothing painful there when you’re just running a local <a href="https://minikube.sigs.k8s.io/">Minikube</a> cluster, which auto-magically seems to add and update its configuration. In practice it’s updating the ~/.kube/config file every time you create or remove a cluster.</p><p>This kind of magic is all fine when you’re getting started, but soon enough you will find that Minikube is merely one of the sources of Kubernetes contexts. You might also be running <a href="https://kind.sigs.k8s.io/">kind</a>, spin up some clusters in the cloud, or have your colleague share some with you. Soon the amount of different context credentials starts ramping up. kubectl doesn’t come with an elegant solution out of the box.</p><p>You might end up trying <a href="https://stackoverflow.com/a/46184649/7500339">this</a> config flattening solution suggested at StackOverflow. Great, now whenever you want to remove a context from your configuration you have to manually sift through this configuration file and delete all references — spoiler alert: this requires editing the space in two or more places. Also, assuming you were successful and didn’t overwrite the previous config, you now duplicated your configuration file.</p><p>So what are you going to do with this old configuration file? If you let it hang around, then you will slowly start collecting all these files, soon enough you will lose track which files are already merged and which are not. A mess is imminent if you do not delete them, but the flip side is that removing these files could be irrecoverable.</p><h3>The Official Way</h3><p>Luckily the official documentation has a <a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable">suggestion</a> on how to solve this issue: Append the new configuration file to the list of configuration files stored in the KUBECONFIGenvironment variable. Manually adding and removing paths to this environment variable remembered me of all the fun times with managing the PATH in Windows, which would never get even close to fit on my screen, let alone the small text field they reserved for it.</p><p>Don’t despair, here’s the real solution. Add it to your ~/.bashrc or ~/.zshrc and no need to ever touch KUBECONFIG manually again:</p><pre># Set the location of the Kubernetes configs<br>export KUBECONFIG=$(find ~/.kube/config ~/.kube/configs -type f 2&gt;/dev/null | paste -s -d : -)</pre><p>Now, every time you start your shell it will join all paths to ~/.kube/config or ~/.kube/configs and set them as your KUBECONFIG. Both can be either files or directories. I kept config as the default file, which Minikube and kind can use for their auto-magic. configs is a directory which contains all the context files. Now, adding or removing a file is as easy as respectively copying and deleting a file in ~/.kube/configs - don’t forget to restart the shell to take effect - which made managing all my configs so much easier.</p><p>To briefly touch upon how this piece of Bash works, find is used to list all file paths. Then paste merely joins all these file paths with a colon and violà, we got our KUBECONFIG.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c84c2da4c920" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prod++[1]: Master Git]]></title>
            <link>https://addono.medium.com/prod-1-master-git-bf7e1348af7b?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf7e1348af7b</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[improvement]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Thu, 28 May 2020 20:19:00 GMT</pubDate>
            <atom:updated>2020-05-28T20:19:00.536Z</atom:updated>
            <content:encoded><![CDATA[<p>In this mini-series I will walk you through some habits I replaced in recent times, which have shown to pay off and make me a more productive programmer/power-user of my computer. All these changes should be easy to gradually adopt, so I would highly recommend checking them out. If you’ve any suggestions ☝️ or improvements ✍️, then email me at <a href="/service/mailto:hi@aknapen.nl">hi@aknapen.nl</a> or reach out using any of the social media listed <a href="https://aknapen.nl/">here</a>.</p><h3>Prod++[1]: Master Git</h3><p>Yes, this assumes you’re using Git, which might be everyone’s version control system (VCS) of choice. However, this does not change any of the underlying reasons why you should spend time on becoming effective at using your VCS. So whenever I say Git, please replace it with whichever VCS you are using.</p><h3>The Why</h3><p>Many developers I get to work with are not too comfortable around Git. This is definitely more noticeable with more junior and less “hardskills” focused engineers. The latter referencing to for example UI or UX designers. This makes them more reluctant to using Git for their own personal projects and makes them less effective when needing to combine work.</p><p>Using Git for your own projects might seem like an unnecessary overhead to many. However once you get more proficient at it both reduces the time spend on setting everything up and at the same time better at leveraging its strengths. Some reasons on how you can benefit from using Git in your own projects:</p><ul><li><strong>Time-machine</strong> If you commit frequently you can easily go back to previous versions as to find older implementations, trace bugs to their root and show how your project evolved over time.</li><li><strong>Self-review</strong> Using Git for your personal projects is a great enabler to become more aware of the changes you are making. Remember those console.logs you added all over your code while trying to get this new feature to work? Well, git diff does.</li><li><strong>Backup</strong> Ever had a friend who lost a few weeks of work when their laptop suddenly gave up? If you regularly push your changes to an external Git repository, then you won’t suffer the same loss.</li><li><strong>Ease isolated development environment setup</strong> Having the source-code checked into Git allows you to easily setup a new development environment if one is broken or delete everything which is not checked in to clean up.</li><li><strong>Automation</strong> There are many tools out there to aid your development by hooking into Git. Whether it’s <a href="https://prettier.io/">Prettier</a> automatically formatting your code locally or <a href="https://github.com/features/actions">Github Actions</a> to automatically deploy your website.</li><li><strong>Sharing Code</strong> Having your code base stored in Git makes it easier to share your code, if you ever manage to get someone interested in giving it a look.</li></ul><h3>The How</h3><h3>Use Aliases</h3><p>There are some great collections of Git aliases available to significantly shorten your commands and easy using back practices (e.g. making git push --force-with-lease the default rather than git push --force). I personally use the <a href="https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git">git</a> plugin from <a href="https://ohmyz.sh/">Oh My ZSH</a>, although <a href="https://github.com/gitalias/gitalias">gitalias/gitalias</a> also offers a great collection. Don’t be afraid to look them regularly look them up, either online or using the which command to expand the alias. Also, adding your own aliases is always an option if you still find that you’re repeating yourself.</p><p>As to give an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMQD-6tVberaebTn09N-XQ.png" /></figure><h3>Fix Your Own Mess</h3><p>When starting with Git it can be tempting to just delete the entire repository when there didn’t seem to be an easy way out, for example when merge-conflicts arose or your have commits you want to get rid of. Short term this might very well be the quickest solution, however these issues often stem from a lack of understanding how Git works. Spending a bit of time researching to understand how you got into this situation is a great way of getting to know Git and the principles behind it. Without properly grasping the fundamentals of Git, it is impossible to ever reach a more advanced level.</p><h3>Inspect the Log</h3><p>Git can visualise history in a great way. This allows you to easily see what changed between versions, what commits are shared between your feature and master branch and which commits are not yet pushed to the remote. I will leave you with the following screenshot, there’s already a lot going on and it might take some time to get comfortable reading it. But it’s a great tool to have in your toolbox, as it allows you to quickly figure out what the current state of your repository is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMQD-6tVberaebTn09N-XQ.png" /></figure><p>There are many ways on how to render the graph, for this I would refer back to the aliases mentioned earlier. Although you can quickly get started with a basic command such as git log --graph --all.</p><h3>Read the Changelog</h3><p>Okay, this might sound very boring at start. Luckily Github has really nice way of covering Git’s changelog. As of writing, version <a href="https://github.blog/2020-03-22-highlights-from-git-2-26/">2.26</a> is the latest release. When I first ran into these posts, I found it easiest to read the log of the current version and navigate to the previous one by following the link at the top. What I especially like about Github’s changelog is that there’s a strong focus on how it benefits you, rather than merely covering what changed as the <a href="https://github.com/git/git/tree/master/Documentation/RelNotes">official</a> Git changelog does.</p><p>Even small changes of for example new flags or under the hood performance improvements show you what is actively worked on, which parts are getting deprecated and how Git is being used. Slowly your Git knowledge will get stale, so keeping up with the changes allows you to stay ahead of the curve.</p><h3>Don’t be Scared to (Re)Write History</h3><p>At first, rebasing, soft/hard resetting, amending and force-pushing might sound scary, because these tools are just a subsection of the tools available to rewrite or delete history. When getting started, be cautious and make sure that until you properly understand what you’re doing before you try it in an environment where you can cause serious harm. It’s not rocket science, but a mistake is easily made.</p><p>If you’re comfortable to remove, reorder and overwrite commits, you can more freely add commits when you’re working. Leaving cleaning up to something only done last before you push to master or you create a pull request. Frequently adding commits while you’re working allows you to understand what you tried and more easily revert part of your changes. But maybe the most important benefit is that it makes it significantly harder to lose progress once it’s committed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf7e1348af7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prod++: A Mini-Series on How to be More Productive]]></title>
            <link>https://addono.medium.com/prod-a-mini-series-on-how-to-be-more-productive-b1fc6b038321?source=rss-60287d27186b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1fc6b038321</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Adriaan Knapen]]></dc:creator>
            <pubDate>Thu, 28 May 2020 20:14:35 GMT</pubDate>
            <atom:updated>2020-05-28T20:14:35.895Z</atom:updated>
            <content:encoded><![CDATA[<p>In this mini-series I will walk you through some habits I replaced in recent times, which have shown to pay off and make me a more productive programmer/power-user of my computer. All these changes should be easy to gradually adopt, so I would highly recommend checking them out. If you’ve any suggestions ☝️ or improvements ✍️, then email me at <a href="/service/mailto:hi@aknapen.nl">hi@aknapen.nl</a> or reach out using any of the social media listed <a href="https://aknapen.nl/">here</a>.</p><h3>The Need for Refactoring Your Habits</h3><p>It is often said that the best thing one can spend their time on is learning <a href="http://localhost:1313/blog/prod-plus-plus-a-mini-series-on-how-to-be-more-productive/#references">[1][2][3]</a>. I agree. However, learning can take various forms, one I find being particularly under appreciated is improving. Here I am not talking about increasing your knowledge in a field you already have a profound basis in. Instead, I want to focus on replacing previously acquired knowledge — or habits — with more effective and valuable alternatives.</p><p>This type of learning is in no way better or more important than other types of learning. However, it’s easy to focus on learning new things and taking everything prior for granted. This is a shame, as the benefits of improving one’s habits can pay off big time in the long run. When developing an application it is common to talk about technical debt, knowing that at times we need to go back to maintain and refactor as to improve and adapt to changes in the environment. Why are we not taking time to refactor our own habits into more productive ones?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/0*Jy9VlTckzIZPUkpu.png" /></figure><p><em>As always, there’s an XKCD for that. Source: </em><a href="https://xkcd.com/1205/"><em>XKCD</em></a></p><h3>Exploration</h3><p>The remainder of this post will dive into the methods which have led me to adopt new improved habits. Most of them will probably seem trivial, although being mindful about them makes it easier to reserve time for improving them.</p><h3>Be Curious and Critical</h3><p>If you ever wonder “Why haven’t I automated this yet”, then you’re probably already too late. Being critical on your own routines and curious about improving them is foundational to refactoring your own habits. Digging into how to do something more effectively is something you should actively strive for. Having a natural curiosity to do so will make it a lot easier, just quickly searching online if there’s a ready-made solution takes less than a minute and already teaches you something. If you find something, then the process of applying this</p><h3>Search for Change</h3><p>Over time, habits will slowly become routines. Routines you do not look back to, nor consider improving. Regularly, radically changing your environment is a great opportunity. For one, this change of context forces you to adapt your old habits to unfamiliar applications. These unfamiliar environments often solve the same goal, however different underlying ideologies made them to make different choices. Such a switch is a great opportunity to experience the best of both worlds and become more flexible at using different environments.</p><p>Concrete examples of switches I regularly try to make:</p><ul><li>Operating System: Over the past few years I have used Windows, MacOS and Linux based systems as my daily driver.</li><li>IDE: I’m a huge proponent for JetBrains and their amazing IDEs. However, being flexible is advantageous, as you won’t always have the luxury to wait a minute until it has booted up or work on a machine with your desired version installed. Many other IDEs exist, all with their own use-case at which they excel, some more lightweight alternatives I am recently using frequently are Visual Studio Code and Vim.</li><li>Machine: If you have the opportunity, then pair programming on the machine of a colleague can be a great way of experiencing their way of working. Try to ask them on how they would do something if there’s something which you can do a lot easier on your own machine. Either they show you another method of achieving the same, or you can learn them something.</li></ul><h3>References</h3><p>[1]. <a href="https://writingcooperative.com/write-what-you-know-and-then-keep-learning-7c7896665d11">Jane Harkness, The writing Cooperative, Write What You Know — and Then Keep Learning</a></p><p>[2]. <a href="https://medium.com/hackernoon/active-learner-how-developers-keep-learning-1309b91f1ae6">Dennis Nerush, hackernoon.com, Active Learner — How Developers Keep Learning</a></p><p>[3]. <a href="https://medium.com/free-code-camp/five-great-tactics-for-becoming-a-better-coder-5c6da86ab0d0">Kevin Gardner, freecodecamp.org, How to Keep Learning and Become a Better Coder</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1fc6b038321" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>