<?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"><channel><title><![CDATA[LiFL Developer Blog]]></title><description><![CDATA[LiFl space devblog dedicated to app development, programming problems and solutions.]]></description><link>https://dev.lifl.space</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 23:42:42 GMT</lastBuildDate><atom:link href="https://dev.lifl.space/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[OCI (Oracle Cloud Infrastructure) review]]></title><description><![CDATA[Interesting AWS alternative or provider you should not trust? Small startup POV.]]></description><link>https://dev.lifl.space/oci-oracle-cloud-infrastructure-review</link><guid isPermaLink="true">https://dev.lifl.space/oci-oracle-cloud-infrastructure-review</guid><category><![CDATA[Cloud]]></category><category><![CDATA[Oracle]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Kubernetes]]></category><dc:creator><![CDATA[Serhii Ostapchuk]]></dc:creator><pubDate>Thu, 02 Dec 2021 14:51:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1638454505753/z_YcBbBgL.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-why-oci-might-be-interesting">Why OCI might be interesting</h1>
<p>When choosing a cloud provider for your project / startup you might consider many factors, from which we point out:</p>
<ol>
<li>Completeness of its cloud stack to fit your needs</li>
<li>Technology (maturity, stability, ease to use)</li>
<li>Relations with customers, support</li>
<li>Pricing</li>
<li>Startup discounts / credits (if applicable for you)</li>
</ol>
<p>So what about OCI?</p>
<ul>
<li>According to their features supported, OCI is something in between stating cloud providers like Vultr, Linode, Scaleway and tech giants like AWS, Azure, GCP.</li>
<li>Their website is stating significant costs savings compared to AWS.</li>
<li>Their free tier is pretty generous</li>
</ul>
<p>But it's not as shiny as it seems, lets describe everything step by step</p>
<h1 id="heading-oci-review">OCI Review</h1>
<h2 id="heading-cloud-stack-features">Cloud stack (features)</h2>
<p>We can take a look at Gartner's report chart "Ability to execute" to understand OCI features completeness compare to other cloud providers (the report itself is <a target="_blank" href="https://www.gartner.com/doc/reprints?id=1-271OE4VR&amp;ct=210802&amp;st=sb">here</a>):
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1638436934776/xydS-fqt2.png" alt="image.png" />
The total list of features is visible from the official <a target="_blank" href="https://www.oracle.com/cloud/price-list.html">pricing </a> page (however it's hard to estimate until you use every single one of them)
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1638437623332/ucmcPEWTV.png" alt="image.png" />
If we talk about starting a new project, most likely we would be interested in OpenSource databases managed hosting and compute / serverless resources.
So here is the shortlist:</p>
<ol>
<li>Oracle provides managed Kubernetes service with ARM / x86 support and free control pane. On ARM you can even host a server of 4CPU + 24RAM for free according to the "always free resources" (but read the article to the end before you run creating an account there).</li>
<li>Oracle provides MySQL (enterprise edition) managed database hosting apart from Oracle databases - no managed cache or MongoDB.</li>
<li>Oracle functions - based on Fn Project have pretty standard pricing, but are capable only of running containers (you can't write code and deploy it from oracle)</li>
<li>Compute consists of various shapes, that can be fully customized by CPU + RAM, you create instances as you see fit, you can buy additional performance for your block storage. </li>
<li>Same goes for load balancer - it's completely flexible in shape, and can dynamically change it</li>
<li>Integrated web shell</li>
<li>Resource manager using terraform configuration files</li>
<li>There are spot instances but with much more limitations and lesser discount</li>
<li>There are burstable instances with pricing only for base CPU fraction</li>
</ol>
<p>Sidenote: Oracle databases lack support in tooling across languages and frameworks - only the most basic are present. Their Dynamodb analog seems more generous but there is no "pay as you go" option so you have to specify the maximum reserved capacity and pay for it.</p>
<h2 id="heading-technology-maturity-stability-ease-to-use">Technology (maturity, stability, ease to use)</h2>
<h3 id="heading-website">Website</h3>
<p>There are multiple web apps to face when working with OCI.
The main one, and the most pretty of them all, OCI web interface:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1638445067883/3_9ExJrIz.png" alt="image.png" />
It is basic, contains all the basic functions one would expect and that's it.
But also there are other web apps like for support, oracle account management that looks <strong>very outdated</strong>. Some functionality is shared across them and is confusing especially support.
One of support portal apps:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1638445634645/T-Jh_TnUy.png" alt="image.png" /></p>
<p>When it comes to billing - there is only general overview, for the rest you should look into downloadable csv files, which are detailed but are hard to understand. </p>
<h3 id="heading-infrastructure">Infrastructure</h3>
<p>During my testing which lasted a few weeks, I faced 2 issues:</p>
<ol>
<li>I was trying to use only free resources at the end of free trial. Billing information was reporting some billing, then it stopped, then started again. Support wasn't able to help me with identifying what I was billed for. I imagine what it can be for real big workloads.</li>
<li>I scaled down my cluster and couldn't resize it back :) ARM capacity went out of stock and upscaling wasn't available for <strong>several days</strong></li>
</ol>
<p>Also when you subscribe to a free trial you have to wait up to several days for its activation (guess it's done manually). This is the first cloud provider with such a complicated sign-up procedure.</p>
<p>Some users on  <a target="_blank" href="https://www.reddit.com/r/oraclecloud/">reddit </a> complain about inefficient Network layer as well so in some regions network traffic would do unnecessary roundtrips.</p>
<p>This should give some picture about infrastructure maturity</p>
<h2 id="heading-relations-with-customers-support">Relations with customers, support</h2>
<h3 id="heading-support">Support</h3>
<p>First of all, there are so many channels to ask for support in - popups,  <a target="_blank" href="https://support.oracle.com/">support.oracle.com</a>, cloud support service directly from OCI console, sales chat, <a target="_blank" href="https://www.oracle.com/support/contact.html">https://www.oracle.com/support/contact.html</a> and more. Sometimes they are named differently but are the same. Mostly as per my experience and other reviews that can be found on reddit - it won't help you or take ages to help. They will respond promptly but without impact.</p>
<h3 id="heading-relations-with-customers-and-accounts-blocking">Relations with customers and accounts blocking</h3>
<p>Here I will just post my case that is partially related to support as well.</p>
<p>I was using a free trial and eventually, it got expired. I could still use always free services and access console, just couldn't use any paid ones.</p>
<p>So then I decided to give OCI a chance and upgrade to paid account - it gave me an 
"error". I contacted one channel for support, then another one, then local support in my country - in total discussions cost me 5+ days. </p>
<p>At last, I received an email like this: "Your account was being suspended for violating Terms of Use. You can raise an issue again if you think it's an error". So I raised again and the response was "Your account is suspended. Decision is final". I rechecked Terms, found nothing, and asked what exactly I violated - silence in response.
And support agent that called me politely before - are just ignoring</p>
<p>My guess here is that their system uses some "dirty" rules for marking users as "violators" that's why they just don't want to share it. And I saw that I`m not the only one.</p>
<p>The worst thing is that they do everything manually and involve card issuer info checking to try to prevent a person from <strong>ever</strong> mimicking another one to create a second account. Meaning once they suspend your account - you will be forbidden to use their services ever. (unless you do use completely different name and corresponding card)</p>
<p>Upgrading to Pay-As-You-Go at once might lower your chances of being suspended but still won't give you confidence, as the billing system might have bugs.</p>
<p>For another completely described cases refer to  <a target="_blank" href="https://www.reddit.com/r/oraclecloud/comments/qrar68/another_amazing_day_with_oracle_cloud/">this Reddit thread</a>.</p>
<h2 id="heading-pricing">Pricing</h2>
<p>Oracle claims that its pricing is better than on AWS. And it is. Almost. It works for pay as you go prices and egress.</p>
<ol>
<li>If we compare spot instances - they offer far less discount (strictly 50%) and I likely less availability of those.</li>
<li>When you check Oracle pricing page - you will find that they compare to pay as you go pricing on AWS. However, AWS has reserved instances that provide discounts up to 70% and become better than Oracle offerings.</li>
<li>Oracle has its own "reservation" analog - credits system. It's pre-paid money that expire in 1 year. But I failed to get any information about what amount of money you need to put in to get any discount. Its closed information compared to what Azure and AWS offers</li>
</ol>
<h1 id="heading-conclusion">Conclusion</h1>
<p>Before the situation with my account, I would recommend trying out Oracle due to their generous free tier and good pay-per-hour prices. 
But now I would recommend trying out OCI only in 2 cases:</p>
<ol>
<li>You are a big customer, then you should talk your case through sales and I guess you will be paid more attention to, probably you will get good discounts on credits. But considering not enough infrastructure maturity - this is not for all customers.</li>
<li>You just want to host a pet project and don't mind being locked out. Two pieces of advice in this case:
a) do an upgrade to paid account at once - this will reduce your chances for being locked out soon
b) keep backups somewhere else and be ready to migrate</li>
</ol>
<p><strong>FINAL ADVICE</strong>: when signing up for a free trial, not all bank cards will be accepted and they don't provide options like Paypal, if you have several cards - try them all.</p>
]]></content:encoded></item><item><title><![CDATA[How to change Windows 10 theme automatically?]]></title><description><![CDATA[How to make windows go dark at night and light in the morning. Monitor brightness and theme automation apps. Theme change with Powershell.]]></description><link>https://dev.lifl.space/windows-theme-auto-change-with-time</link><guid isPermaLink="true">https://dev.lifl.space/windows-theme-auto-change-with-time</guid><category><![CDATA[Powershell]]></category><category><![CDATA[2Articles1Week]]></category><category><![CDATA[General Advice]]></category><category><![CDATA[Windows]]></category><category><![CDATA[automation]]></category><dc:creator><![CDATA[Serhii Ostapchuk]]></dc:creator><pubDate>Thu, 25 Mar 2021 10:19:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1616667088744/npbVwvQT7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Never thought I was going to need this, but recently my worktime span across the whole day and I always found myself struggling with white in dark and with dark during the day.</p>
<p> I set up all apps to "Use system theme" - the only thing I was missing - is actually an automatic switcher for Windows. Sure, I can just go to the settings and adjust the theme every time, but I decided to get acquainted with Powershell and automate this in 1 simple script to get some new knowledge.</p>
<p>Navigate the table of contents to setup Windows 10 theme auto change or learn how it was built:</p>
<ul>
<li><a class="post-section-overview" href="#building-a-script">Building a script</a><ul>
<li><a class="post-section-overview" href="#how-to-switch-dark---light-themes-in-windows-">How to switch dark / light themes in Windows?</a></li>
<li><a class="post-section-overview" href="#how-to-detect-and-react-on-current-time-">How to detect and react on current time?</a></li>
<li><a class="post-section-overview" href="#how-to-create-a-scheduled-task-">How to create a scheduled task?</a></li>
<li><a class="post-section-overview" href="#how-do-we-install-the-script-">How do we install the script?</a></li>
</ul>
</li>
<li><a class="post-section-overview" href="#final-solution">Final solution</a></li>
<li><a class="post-section-overview" href="#apps-to-use">Apps to use</a><ul>
<li><a class="post-section-overview" href="#dark-reader-extension">Dark Reader Extension</a></li>
<li><a class="post-section-overview" href="#auto-dark-mode">Auto Dark Mode</a></li>
<li><a class="post-section-overview" href="#monitorian">Monitorian</a></li>
</ul>
</li>
</ul>
<h2 id="building-a-script">Building a script</h2>
<p>When automating something to happen at logon or certain time on Windows, it makes sense to use scheduler. And if you open it (just put <code>scheduler</code> in win search) - you will see many apps already using it a lot for their chores.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1616662020343/KWZrZxYKD.png" alt="image.png" /></p>
<p>What we need is to create tasks firing in these cases:</p>
<ol>
<li>Evening time</li>
<li>Morning time</li>
<li>User logon</li>
</ol>
<p>These can be 3 separate tasks but to ease the management, let's go with 1 script called in each of those cases.<br />Script will follow this logic when called:</p>
<ol>
<li>Check current time -&gt; enable corresponding theme</li>
<li>Copy itself into specified folder (I picked User folder) </li>
<li>Register scheduler task to call this script from that folder</li>
</ol>
<h3 id="how-to-switch-dark-light-themes-in-windows">How to switch dark / light themes in Windows?</h3>
<p>First of all we need to know how to actually switch the themes. Luckily for us its just a matter of 2 variables in registry: <code>AppsUseLightTheme</code>  and <code>SystemUsesLightTheme</code>, their names are self-explanatory. We are going to set this variables in registry from 1 to 0 and vise versa so we save commands to variables (of course you can do it yourself manually as well)</p>
<pre><code>$enable_light_apps = <span class="hljs-string">'reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 1 /f'</span>
$enable_light_system  = <span class="hljs-string">'reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v SystemUsesLightTheme /t REG_DWORD /d 1 /f'</span>
$enable_dark_apps = <span class="hljs-string">'reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 0 /f'</span>
$enable_dark_system  = <span class="hljs-string">'reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v SystemUsesLightTheme /t REG_DWORD /d 0 /f'</span>
</code></pre><h3 id="how-to-detect-and-react-on-current-time">How to detect and react on current time?</h3>
<p>For our simple purposes we will edit the script directly before launch, setting up the time. In this implementation only hours are supported. We convert received time to <code>[int]</code>, compare and invoke our "switcher" functions specified before.</p>
<pre><code>[<span class="hljs-keyword">int</span>]$lighttime = <span class="hljs-number">7</span>
[<span class="hljs-keyword">int</span>]$nighttime = <span class="hljs-number">19</span>

[<span class="hljs-keyword">int</span>]$hrs = Get-Date -Format HH

Write-host <span class="hljs-string">"Day boundaries: $lighttime - $nighttime"</span>

<span class="hljs-keyword">if</span> ($hrs -ge $lighttime -<span class="hljs-keyword">and</span> $hrs -<span class="hljs-keyword">lt</span> $nighttime) {
  Write-Host <span class="hljs-string">"Its a day time!"</span>
  Invoke-Expression $enable_light_apps
  Invoke-Expression $enable_light_system
} <span class="hljs-keyword">else</span> {
  Write-Host <span class="hljs-string">"Its a night time!"</span>
  Invoke-Expression $enable_dark_apps
  Invoke-Expression $enable_dark_system
}
</code></pre><h3 id="how-to-create-a-scheduled-task">How to create a scheduled task?</h3>
<p>There are easy ways using <code>SCHTASKS</code>:</p>
<pre><code><span class="hljs-attribute">SCHTASKS</span> /CREATE /SC DAILY /TN <span class="hljs-string">"Switch To Dark Theme"</span> /TR <span class="hljs-string">"reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 0 /f"</span> /ST <span class="hljs-number">19</span>:<span class="hljs-number">00</span> /F
</code></pre><p>But it allows only 1 trigger and 1 action specified. Otherwise, you have to use a separate XML file for that. That's why we will go with a more flexible option -  PowerShell itself.</p>
<p>In <code>SCHTASKS</code> example we specified /F key meaning we want to overwrite any task that is already created. That's needed to quickly update the task if we want to change time, etc. To do the same in PowerShell we need to handle this separately:</p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Delete</span>-<span class="hljs-title">ScheduledTask</span>(<span class="hljs-params">[<span class="hljs-keyword">string</span>] $taskName</span>)
</span>{
    Write-Host <span class="hljs-string">"Delete schedule task for <span class="hljs-subst">$taskName</span>"</span>
    Unregister-ScheduledTask -TaskName $taskName -Confirm:$false
}


<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">DeleteIfExists</span>-<span class="hljs-title">ScheduledTask</span>(<span class="hljs-params">[<span class="hljs-keyword">string</span>] $taskName</span>)
</span>{
    $exists = Get-ScheduledTask | Where-<span class="hljs-keyword">Object</span> {$_.TaskName -like $taskName}
    <span class="hljs-keyword">if</span>($exists)
    {
        Delete-ScheduledTask $taskName
    }
}
</code></pre><p>Then we create triggers we need (note usage of <code>user_name</code> - we can omit it so the task runs for ALL users, but in that case, it will require elevation:</p>
<pre><code>$user_name = [environment]::username

$trigger = @(
    $(<span class="hljs-keyword">New</span>-ScheduledTaskTrigger -At <span class="hljs-string">"$([string]<span class="hljs-subst">$lighttime</span>):00"</span> -Daily),
    $(<span class="hljs-keyword">New</span>-ScheduledTaskTrigger -At <span class="hljs-string">"$([string]<span class="hljs-subst">$nighttime</span>):00"</span> -Daily)
    $(<span class="hljs-keyword">New</span>-ScheduledTaskTrigger -AtLogOn -User $user_name)
)
</code></pre><p>Last thing is to define the task name and action, and register (owerwrite) the task:</p>
<pre><code>$task_name = <span class="hljs-string">"Theme Switcher"</span>
DeleteIfExists-ScheduledTask($task_name)

$action = <span class="hljs-keyword">New</span>-ScheduledTaskAction -Execute <span class="hljs-string">"PowerShell.exe"</span> -Argument <span class="hljs-string">"-ExecutionPolicy Bypass -File <span class="hljs-subst">$script_destination_file</span>"</span>
Register-ScheduledTask -TaskName $task_name -Trigger $trigger -Action
</code></pre><h3 id="how-do-we-install-the-script">How do we install the script?</h3>
<p>Well, you could copy the script manually, but to speed things up - we just self-copy it to the desired location if it called not from there:</p>
<pre><code>[<span class="hljs-keyword">string</span>]$user_folder = $env:USERPROFILE
<span class="hljs-keyword">if</span> ($PSScriptRoot -ne $user_folder) {
    $MyInvocation.MyCommand.ScriptContents | Out-File $script_destination_file
}
</code></pre><h2 id="final-solution">Final solution</h2>
<p>Just download and save with <code>.ps1</code> extension and run from command line or right click - "Run with powershell".
In case running scripts is disabled use this form:</p>
<pre><code><span class="hljs-selector-tag">powershell</span> <span class="hljs-selector-tag">-ExecutionPolicy</span> <span class="hljs-selector-tag">Bypass</span> <span class="hljs-selector-tag">-File</span> <span class="hljs-selector-tag">C</span>:\<span class="hljs-selector-tag">Users</span>\<span class="hljs-selector-tag">lflse</span>\<span class="hljs-selector-tag">Desktop</span>\<span class="hljs-selector-tag">script</span><span class="hljs-selector-class">.ps1</span>
</code></pre><p>Here is raw link as Hasnode seems buggy 😢
<a target="_blank" href="https://gist.githubusercontent.com/liflovs/2dc08367b69868ea4590ef8e716029b9/raw/45e64e80a6b517fa3dc0a480ea3d12ede8ff62aa/themeswitcher.ps1">Raw download</a></p>
<div class="gist-block embed-wrapper" data-gist-show-loading="false" data-id="2dc08367b69868ea4590ef8e716029b9"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a href="https://gist.github.com/liflovs/2dc08367b69868ea4590ef8e716029b9" class="embed-card">https://gist.github.com/liflovs/2dc08367b69868ea4590ef8e716029b9</a></div><h2 id="apps-to-use">Apps to use</h2>
<h3 id="dark-reader-extension">Dark Reader extension</h3>
<p>Its highly configurable extension to make all websites go dark. It can listen to system theme change if configured (<a target="_blank" href="https://chrome.google.com/webstore/detail/dark-mode/dmghijelimhndkbmpgbldicpogfkceaj?hl=en">Download</a>):
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1617951896246/OFDYYiUqs.png" alt="image.png" /></p>
<h3 id="auto-dark-mode">Auto Dark Mode</h3>
<p>After I developed this I found other solution to the problem with nice GUI and more options - in case you are okay with having more apps on PC:
<a target="_blank" href="https://github.com/Armin2208/Windows-Auto-Night-Mode">Auto Dark Mode</a></p>
<p>App is following same principles - just instead of triggering script it triggers itself and registers more tasks instead of 1 with 3 triggers.:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1616666380224/Y-oMAWzvY.png" alt="image.png" /></p>
<h3 id="monitorian">Monitorian</h3>
<p>Another app to look at - in case you have multiple screens you can control their brightness with ease and windows-style UI: <a target="_blank" href="https://github.com/emoacht/Monitorian">Monitorian</a></p>
<hr />
<p>Thanks for reading! My articles are constantly revised and updated, so bookmark if you want to be up-to-date on a topic 🍺</p>
]]></content:encoded></item><item><title><![CDATA[Dev Blog SEO. How to rank my blog? Should I cross-post?]]></title><description><![CDATA[Must-have SEO techniques to rank on google, bing, and drive traffic to your blog. Advantages and pitfalls of cross-posting. Hashnode examples.]]></description><link>https://dev.lifl.space/blog-seo-how-to-rank-my-blog-should-i-cross-post</link><guid isPermaLink="true">https://dev.lifl.space/blog-seo-how-to-rank-my-blog-should-i-cross-post</guid><category><![CDATA[General Advice]]></category><category><![CDATA[Blogging]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[2Articles1Week]]></category><category><![CDATA[Hashnode]]></category><dc:creator><![CDATA[Serhii Ostapchuk]]></dc:creator><pubDate>Thu, 18 Mar 2021 09:41:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1616428537237/6AeDonHI6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I started blogging quite recently. For me, it's connected to a bigger project ongoing so I keep doing thorough research on the topic. In the previous article I shared my analysis on <a target="_blank" href="/cloudflare-pages-vs-netlify-vs-vercel-hosting-2021">Which hosting provider to choose</a>. Here I will share my SEO discoveries illustrated with Hashnode examples. Most of the information is relative to the websites in general and search engines in general, specifics will be added as well. Let's go!</p>
<h2 id="basics">Basics</h2>
<p>How does the search work? Crawlers get info from internet pages and search for the links in them, follow links, discover new websites, get their page data, and index it for keywords. When you search - the search engine looks up the index -&gt; done.</p>
<p>To get any website searchable asap:</p>
<ul>
<li>Owner (you or your blog hosting provider) should give the crawler a hint to fetch the page</li>
<li>Crawler processes the page, determines if it's worth indexing (is it duplicate? is it mobile friendly? is it redirect? etc)</li>
<li>Crawler indexes page for keywords and determines its rank (how much user can trust a website? is it well-known?)</li>
</ul>
<p>In simple terms that's it - all the work goes around these stages. So how do we get most of our blog?</p>
<h2 id="1-pick-the-right-topics-keywords-tags">1. Pick the right topics / keywords / tags</h2>
<h3 id="topics">Topics</h3>
<p>It's quite obvious that the internet is full of information and to be searchable and popular you have such options:</p>
<ul>
<li>Target unique/new topics: more audience percentage from the probably smaller audience, can target a more specific group of people</li>
<li>Target the most popular topics: get less percentage from a bigger and broader audience</li>
</ul>
<p>You can use  <a target="_blank" href="https://trends.google.com/">https://trends.google.com/</a> to help you with that:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615969833911/Z4isi44HE.png" alt="image.png" /></p>
<p>If your blog is not related to any product you can relax and pick whatever topic you are more comfortable with, as the quality of content matters as well. If it`s related to some specific product, you can target a related audience that might be interested in it.</p>
<h3 id="keywords">Keywords</h3>
<p>People search for the same topic differently. You can try the search yourself and see how relevant results are for you in that case</p>
<p>In the same Google Trends tool you have a dedicated panel to investigate:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615970829134/L1WSeMip6.png" alt="image.png" /></p>
<p>As well as Google Search suggestions:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615970884295/Dd_jw97b6.png" alt="image.png" /></p>
<p>To get even more information, you can use Keyword Planner from Google. It gives better information on how much users search typically for some keyword, as well as other insights.</p>
<p><a target="_blank" href="https://ads.google.com/home/tools/keyword-planner/">https://ads.google.com/home/tools/keyword-planner/</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615985179169/4t3YAC5rE.png" alt="image.png" /></p>
<h3 id="tags">Tags</h3>
<p>Tags can be used on your personal domain/website but here we'll look at them as tools that help you rank inside the blogging platform. </p>
<p>If you are posting on some blogging platform - investigate the tags and their impact. The tags should be:</p>
<ul>
<li>Relative to your material</li>
<li>Popular</li>
</ul>
<p>On dev.to you cannot see the number of subscribers to a tag, but you can estimate how much relative attention posts get and see the number of how many posts are in general. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615972462916/sJWDJswvE.png" alt="image.png" /></p>
<p>On Hashnode you have more information allowing you to estimate attention to your post as <code>number of users / number of posts</code>:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615972534806/TLg-1-CEn.png" alt="image.png" /></p>
<p>Not all tags are visible on UI - check them using URLs specific to platform, for example:</p>
<ul>
<li>hashnode.com/n//{tag} - for Hashnode</li>
<li>dev.to/t//{tag} - for Devto</li>
</ul>
<h2 id="2-ensure-your-meta-tags-are-optimal">2. Ensure your meta tags are optimal</h2>
<p>Whenever using your own solution or blogging platform, take a look what are the meta tags on the resulting blog page. They look like this in browser's developer tools</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615980877500/cGpdANPYv.png" alt="image.png" /></p>
<p>I will mention only the 3 most popular ones as they are usually controllable on most blog platforms:</p>
<ul>
<li><strong>title</strong> - title of the page in search, should be &lt; 60 chars. </li>
<li><strong>description</strong> - description of the page in search, should be &lt; 160 chars</li>
<li><strong>canonical</strong> - links another page as <strong>original</strong> version (used in cross-posting), can be ignored by crawler in some cases, for example when the page is too different.</li>
</ul>
<blockquote>
<p>On Hashnode canonical is controlled in the post's settings. The other 2 are the post <strong>title</strong> and <strong>the first paragraph</strong> after it. It can be a subtitle, if there is no subtitle - the first paragraph of your post.</p>
</blockquote>
<p>Those 2 are important as they will be indexed by google and shown in search results.</p>
<blockquote>
<p>If you are just making posts on some blog platform under their own domain - you can skip to the  <a class="post-section-overview" href="#should-i-cross-post"><strong>Should I cross-post?</strong></a> .
If you are hosting your own blog or using a platform allowing custom domain, read next.</p>
</blockquote>
<h2 id="3-use-google-search-console-bing-webmasters-own-domain">3. Use google search console, bing webmasters (own domain)</h2>
<p>In case you have your own domain - you get abilities to see how the website appears on the search and impact that. In another case, you have to rely on a blogging platform to provide you with similar info.</p>
<p>So, to control how your website appears in search go visit:</p>
<ul>
<li><a target="_blank" href="https://search.google.com/search-console">https://search.google.com/search-console</a> for google</li>
<li><a target="_blank" href="https://www.bing.com/webmasters">https://www.bing.com/webmasters</a> for bing</li>
</ul>
<h3 id="google-search-console">Google Search Console</h3>
<p>After visiting the tool you will be provided with several ways of confirming ownership, either for the whole domain or subdomains. <strong>I recommend registering here first as Bing has an import tool to get ownership info from Google, so you proceed faster</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615996855864/R87Gw9l3Q.png" alt="image.png" />
This is how the menu will look like. When you just start most of the parts will have no data, some sections lag 1-2 days usually to be accumulated. I won't dive deep into that tool, will just make a short overview of the most important parts:</p>
<ul>
<li><strong>Inspect URL</strong> - this is your tool to get the freshest information (from day 0) on any URL in your domain, you can see if it was crawled, if it was indexed, what were the issues with that, request indexing, see if the page was treated as a duplicate.</li>
<li><strong>Performance</strong> - accumulated info on all your pages, see which appear on search, which is not. Also the search terms, clicks, etc. Lags 2 days</li>
<li><strong>Coverage</strong> - accumulated info on how many pages are there in the index and how many are excluded. Lags 2 days</li>
<li><strong>Sitemap </strong>- though, google can detect sitemap itself, better inject here sitemap if you have one. (Hashnode is providing you with a link)</li>
<li><strong>Links </strong>- should show who is referring to your page, internal/external links. Lags a lot.</li>
</ul>
<h3 id="bing-webmasters">Bing webmasters</h3>
<p>The tool is quite similar to google's - I won't take your time describing it. After importing info from google console you can do similar actions there, but there are some differences:</p>
<ol>
<li>Bing (unlike Google) is mostly ignoring javascript, so any dynamic javascript content that's on the page won't be indexed, you might need Server Side Rendering or making a page fully static to get indexed.</li>
<li>Bing enforces more SEO tips into rules for a page to get indexed. The page might get indexed, but the more issues it has - the less is the chance.</li>
</ol>
<p>For example:</p>
<ul>
<li>too short / long header</li>
<li>too short / long description</li>
<li>multiple h1 tags</li>
</ul>
<blockquote>
<p><em>Bing is not accepting my Hashnode blog. For now, the last reason is 3rd one, which I cannot control. Hope Hashnode devs will fix that soon.</em></p>
</blockquote>
<h2 id="4-use-analytics">4. Use analytics</h2>
<p>Where does the traffic come from? How long users stay on the site? What they do? You can answer these questions with analytics.
The default choice would be Google Analytics, as it's free and works great. It has troubles with EU GDPR and is trying to fix the situation. When going big - you will need to properly handle cookie consent, ensure you comply with the government's law, etc. But that's the next level of the problem. Think of it when the time comes.
In the very beginning, analytics will be super useful to understand how you can improve.</p>
<p>Depending on the solution you are using you can inject it into the site manually, or via Cloudflare App if you are proxying a website with it <a target="_blank" href="https://www.cloudflare.com/apps/google-analytics">https://www.cloudflare.com/apps/google-analytics</a>. </p>
<blockquote>
<p>Hashnode is not proxiable through Cloudflare, it has its own CDN - but provides integration with Google Analytics.
NOTE: currently Hashnode supports only Universal Analytics, while current version is GA4. Be sure to create this kind of property - it will be buried into advanced settings on property creation. Hope the devs will migrate to GA4 properties soon.</p>
</blockquote>
<h2 id="5-growing-domain-trust">5. Growing domain trust</h2>
<p>New domains need time to get noticed and rise. Multiple factors are impacting this like:</p>
<ul>
<li>Quantity of links to the domain, trust/quality of links to the domain</li>
<li>Keywords, content quantity/relevance</li>
<li>Offline usage of brand/domain name, mentions of brand/domain in news/media/press</li>
<li>Social sites shares</li>
<li>Performance, mobile-friendliness</li>
<li>Web traffic</li>
</ul>
<p>You can try <a target="_blank" href="https://chrome.google.com/webstore/detail/ubersuggest-seo-and-keywo/nmpgaoofmjlimabncmnmnopjabbflegf?hl=en">Ubersuggest extension</a> to get a feel of that</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615985675775/gAL-0ekCN.png" alt="image.png" /></p>
<p>Still, my domain comes up 4th with domain authority 1 - that's something to be happy about :)</p>
<p>So surely what you can do - is to share a link to your blog on social media, on other resources. That will help. Also, this gives a chance to focus on different keywords (for example using the title on the reddit post) and drive traffic from more search queries.</p>
<p>And this leads us to the next question - what about cross-posting?</p>
<h2 id="6-should-i-cross-post">6. Should I cross-post?</h2>
<p>This question is debatable. I would appreciate everyone reading this section to share their experience and engage in the discussion.</p>
<p>First of all, when cross-posting, you should be aware that the same posts on different platforms will get different traction. As a content creator, you naturally want to distribute content to a broader audience.
But like was already mentioned previously, new domains need time to earn trust. Thus
when posting some new content on the fresh domain you risk being invisible to google. The same applies if you are using a blogging platform that is not so popular and you want to engage a bigger audience.</p>
<h3 id="should-i-let-my-post-on-another-platform-dominate">Should I let my post on another platform dominate?</h3>
<p>Let's put arguments into the table (assuming your main platform is your own domain):</p>
<table>
<thead>
<tr>
<td>Own domain for post</td><td>Popular dev platform for post</td></tr>
</thead>
<tbody>
<tr>
<td>Result appear lower</td><td>Result might get higher position</td></tr>
<tr>
<td>Traffic from search is directed to your domain</td><td>Traffic from search partially directed to your domain via links</td></tr>
<tr>
<td>Traffic from platform partially directed to your domain (On Hashnode - fully)</td><td>Traffic from platform partially directed to your domain via links</td></tr>
<tr>
<td>Traffic sources visible from analytics and search console giving an opportunity to tune up the blog</td><td>No direct means to see analytics and optimize visibility of blog post</td></tr>
</tbody>
</table>
<p>As you might guess either approach might be better, you have to experiment. For unique topics where you have chances to get high in search, you should definitely focus on your own domain. If your post is buried deep and you cannot get it higher, another platform might do it better due to its domain trust and traffic.</p>
<p>&gt;
As I am investigating and due to Hashnode unique benefits I am sticking to my own domain. I want users to see my blog in search, and additionally corresponding posts on each platform via the platform's own means.</p>
<h3 id="i-want-to-focus-on-my-blog-can-i-post-the-same-content-somewhere-and-not-break-seo">I want to focus on my blog. Can I post the same content somewhere and not break SEO?</h3>
<p>Here comes the <code>canonical</code> link meta tag. This functionality is present on most blogging platforms: hashnode, medium, devto, devdojo, etc.
For example, in medium it is buried in "Advanced" settings:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615989432539/O5ziuj3TS.png" alt="image.png" /></p>
<p>It basically tells the crawler which page should be treated as original and be displayed. If canonical is not set - then the oldest / most trusted page wins.
You will see the result during the inspection in Google Search Console:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615993484832/8AaBALlen.png" alt="image.png" />
  If two pages are different and you set canonical to one of them - they most likely will arrive both to the search.</p>
<p>If you don't set <code>canonical</code> meta tag google most probably will exclude your own blog post from search. Consequences were described in <a class="post-section-overview" href="#should-i-let-my-post-on-another-platform-dominate">Should I let my post on another platform dominate?</a> </p>
<p>Unfortunately <code>canonical</code> is not guaranteed to protect your page. Recheck search results after your actions.</p>
<p>Here's what I tried and results (using <code>canonical</code> in each case):</p>
<table>
<thead>
<tr>
<td>Blogging platform used for repost</td><td><code>canonical</code> helped?</td></tr>
</thead>
<tbody>
<tr>
<td>Devto</td><td>No 👎(<a target="_blank" href="https://github.com/forem/forem/issues/9509">Issues on Github</a>)</td></tr>
<tr>
<td>Devdojo</td><td>Yes 👍</td></tr>
<tr>
<td>Medium</td><td>Yes 👍</td></tr>
</tbody>
</table>
<p><strong>As of now (04.2021) I don't recommend reposting on devto</strong></p>
<h3 id="does-reposting-give-your-website-additional-value">Does reposting give your website additional value?</h3>
<p>Does <code>canonical</code> link give additional trust to your page? I haven't found guaranteed information on the internet, theoretically, should not. But linkining to your page - does.</p>
<p>For some reason (I guess because of some google algorithm or implementation) on blog platforms only their "tag" pages are giving links. Meaning - they won't last long, as the post will go down on those pages with time.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1616589582326/TwTf4Q3Cf.png" alt="image.png" /></p>
<h2 id="afterword-additions">Afterword additions</h2>
<h3 id="be-careful-with-changing-titles-of-blog-posts-on-blogging-platforms">Be careful with changing titles of blog posts on blogging platforms</h3>
<p>Ensure the URL slug stays the same. One time I made some changes to the Hashnode blog title and the slug changed - meaning I got 2 pages indexed. Old one - not existing anymore, a new one - not having canonical links set to it. So I renamed the slug back once noticed that in Google Analytics</p>
<h3 id="how-to-remove-a-non-existing-page-from-google-index">How to remove a non-existing page from google index?</h3>
<p>Use  <a target="_blank" href="https://search.google.com/search-console/remove-outdated-content">Google Remove Outdated Content</a>  tool</p>
<h3 id="should-i-enable-amp-on-hashnode">Should I enable AMP on Hashnode?</h3>
<p>AMP provides a "reduced" version of your website. So it might miss some crucial elements of branding and links that are not related to the post itself. So It depends on your use case. From my personal feeling - I will more likely visit a page with a "thunder" icon - so I enabled it for now and will watch how it goes.</p>
<hr />
<p>Thanks for reading - it is a complicated topic, so I'm would gladly consider any additions or corrections! 🍺</p>
]]></content:encoded></item><item><title><![CDATA[Cloudflare Pages vs Netlify vs Vercel. Which free hosting to choose in 2021?]]></title><description><![CDATA[Apart from Cloudflare Pages, Netlify, Vercel there are more free services: Firebase Hosting, Gitlab Pages, Github Pages. Which one to choose? This is the…]]></description><link>https://dev.lifl.space/cloudflare-pages-vs-netlify-vs-vercel-hosting-2021</link><guid isPermaLink="true">https://dev.lifl.space/cloudflare-pages-vs-netlify-vs-vercel-hosting-2021</guid><category><![CDATA[hosting]]></category><category><![CDATA[Web Hosting]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Blogging]]></category><category><![CDATA[2Articles1Week]]></category><dc:creator><![CDATA[Serhii Ostapchuk]]></dc:creator><pubDate>Fri, 12 Mar 2021 18:49:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1616428089815/zCLooRplg.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Apart from Cloudflare Pages, Netlify, Vercel there are more free services: Firebase Hosting, Gitlab Pages, Github Pages. Which one to choose? This is the question i faced when thinking about this question to decide how (currently in-development) <a target="_blank" href="https://lifl.space">LiFl Space</a> should be hosted. </p>
<p>Let's assume we started from buying a fresh domain somewhere.</p>
<p><strong>1. Do you want a hosting to manage DNS?</strong></p>
<p>Then it's <strong>Cloudflare</strong> or Netlify, Vercel (when the whole site resides on those services).
When building a multi-service website with different providers on subdomains, Netlify and Vercel won`t be as flexible.</p>
<p><strong>2. Do you expect a high load? Do you want a hosting to provide CDN ?</strong></p>
<p><strong>Cloudflare</strong>, Netlify, Vercel, Firebase Hosting can provide a CDN.
If you want to use Cloudflare CDN over other services providing it, usually it is not recommended cause of not directly controllable cache and integration benefits of services. However, you can use it with Pages.
Worth mentioning Cloudflare and Gitlab Pages do not have a bandwidth limit when other services set it at 100GB.</p>
<p>Firebase Hosting has the lowest bandwidth 360Mb per day on a free plan.</p>
<p><strong>3. Do you expect to deploy frequently?</strong></p>
<p><strong>All, but Netlify and Cloudflare seem coming last</strong>
Vercel shines here allowing 100 builds per day and Github pages come with 10 builds/hour limit, Gitlab. Also, Netlify, Vercel, Firebase allow direct uploading of the build so the build minutes are not consumed. When building from repo Netlify gives 300 build minutes.</p>
<p>Cloudflare comes last - 500 builds a month and is 100% bound to GitHub right now, that's why it`s quite limited. While being not bad for big websites with long builds. But things might change in the future.</p>
<p><strong>4. Is your website large?</strong></p>
<p><strong>Netlify - 100GB, Vercel / Cloudflare - 10/20K files</strong>, Firebase/Gitlab - 10Gb, Github - 1GB</p>
<p><strong>5. Do you want to expand it with cloud functions?</strong></p>
<p><strong>Vercel, Firebase</strong>, Netlify, Cloudflare have cloud functions functionality. Vercel even has response caching for them. Firebase - has a great service stack around them. For Cloudflare - Workers functionality is limited right now (like 10ms execution time), but worth mentioning that Workers Unbound are coming soon.</p>
<p><strong>6. Customizability</strong></p>
<p><strong>Netlify, Vercel, and Firebase</strong> are quite good here, providing different options about how to serve your site.
Cloudflare - is simple and opinionated. You just deploy. A bit buggy maybe. For example, when I deployed the website to Cloudflare - it served my index.html contents as robots.txt - had to add it to build.</p>
<p><strong>7. Do you have some other special needs?</strong></p>
<p>Each service has its benefits overall - Netlify has lots of different paid functionalities, Firebase Hosting is on the same platform with other Firebase stack, has delta deployments, etc. Vercel comes from the Next.js team - so it's your best choice if using that framework. Cloudflare - is a worldwide CDN leader, with other cool features to integrate.</p>
<p><strong>Conclusion</strong></p>
<p>These might be not all the points, but they show how complicated the choice is.</p>
<p>What about me? Well, I am uniting different hostings under one wing so went with Cloudflare DNS and CDN for services not providing it. As I don't need much Netlify functionality and some of the websites are going to be simple and static - I will host them on Cloudflare Pages to stay with one provider if possible. Application websites will depend on the technology used, might be still Cloudflare Pages for SPA, or maybe Vercel / Firebase hosting if some application is more complicated and using other services they provide.</p>
]]></content:encoded></item><item><title><![CDATA[Repl.it code auto-format for C++ and Go]]></title><description><![CDATA[Repl.it is a cloud IDE supporting numerous languages. It lacks one thing though - code auto formatting for some of them. Here's how to fix that.]]></description><link>https://dev.lifl.space/code-auto-format-on-replit-for-c-go</link><guid isPermaLink="true">https://dev.lifl.space/code-auto-format-on-replit-for-c-go</guid><category><![CDATA[C++]]></category><category><![CDATA[Go Language]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[2Articles1Week]]></category><dc:creator><![CDATA[Serhii Ostapchuk]]></dc:creator><pubDate>Tue, 09 Mar 2021 11:59:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1616427773546/9-7_2JHFJ.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="intro">Intro</h3>
<p>When I'm thinking about where to try out some new language -  <a target="_blank" href="repl.it">repl.it</a>  comes to my mind first. But for a long time I found it hard to code in the environment without auto-format even for small snippets. It works for Python, JS, but doesn't work for some other languages. However, repl.it allows you to control your virtual machine from the console - and that gives a chance for a fix.</p>
<h4 id="how-auto-format-should-work">How auto-format should work?</h4>
<p>Usually, auto-format is triggered by a shortcut, like <code>Alt-Shift-F</code>, in Replit it is registered but language formatter itself is not installed, so unless they fix this or let us install our own (via command line, etc) we have to use other ways.</p>
<p>After some digging I found 2 ways we can trigger our format commands:</p>
<ol>
<li><a class="post-section-overview" href="#triggering-commands-manually">Triggering commands manually</a></li>
<li><a class="post-section-overview" href="#run-format-when-project-files-change">Run format when project files change</a></li>
<li><a class="post-section-overview" href="#run-format-before-the-repl-runs">Run format before the repl runs</a></li>
</ol>
<blockquote>
<p>Replit runs on google cloud pre-emptible VM-s. That means your code can change hosts from time to time and whatever you do in console or cloud environment outside your work folder will be gone once host changes.</p>
</blockquote>
<h3 id="implementation">Implementation</h3>
<h4 id="triggering-commands-manually">Triggering commands manually</h4>
<p>While all your program output goes into <strong>Console</strong> tab (you are able to run commands in it though), you still have access to a separate tab <strong>Shell</strong>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1615290944173/CLC8FnTPF.png" alt="1.png" />
This is where we can test our formatting commands.  Default ones:</p>
<p>For <strong>Go</strong></p>
<pre><code><span class="hljs-attribute">gofmt</span> -w .
</code></pre><p>For <strong>C++</strong></p>
<pre><code>clang-<span class="hljs-keyword">format</span> -i *.*
</code></pre><blockquote>
<p>You might stop there and use them in shell when you want some formatting, but they will be erased from shell cache once host changes - in case of complicated commands that might be a problem. The solution - to create a script <code>sh</code> file and trigger it from console</p>
</blockquote>
<h4 id="run-format-when-project-files-change">Run format when project files change</h4>
<p>To watch file changes you can use whatever method/tool you want. When using free accounts better if that tool is simple and installs fast, as you'll need to reinstall it on launch.</p>
<p>For example, you can use <strong>when-changed</strong> python package just by typing:</p>
<pre><code>pip <span class="hljs-keyword">install</span> <span class="hljs-keyword">when</span>-<span class="hljs-keyword">changed</span>
</code></pre><p>Then you can setup watching like this (C++ example):</p>
<pre><code><span class="hljs-keyword">when</span>-changed . clang-<span class="hljs-keyword">format</span> -i *.*
</code></pre><p>This will make your shell busy, and when host changes you need to re-run this. The solution is to use <code>.replit</code> file (<a target="_blank" href="https://docs.replit.com/repls/dot-replit">docs</a>):
It requires field <code>on</code>, so you need to watch the commands replit uses when launching your repl and copy inside.  After that you can pass <code>onBoot</code> option specifying anything you want to run when repl is booting (host changes)</p>
<p>C++ example:</p>
<pre><code><span class="hljs-attr">run</span>=<span class="hljs-string">"clang++-7 -pthread -std=c++17 -o main main.cpp &amp;&amp; ./main"</span>
<span class="hljs-attr">onBoot</span>=<span class="hljs-string">"when-changed . clang-format -i *.*"</span>
</code></pre><p>That's it! code will be formatted as you type. However I found using this a bit annoying as it conflicts with user input, you might use block while you type  <code>// clang-format off</code> or try the next method.</p>
<h4 id="run-format-before-the-repl-runs">Run format before the repl runs</h4>
<p>Repl run shortcut is <code>Cntrl-Enter</code>. It's pretty convenient to use for formatting.
Downside - your repl will run as well. We have no choice as it's the only configurable hotkey.
In previous section we already saw <code>.replit</code> file in action. Logically, we can put auto-format to work when we are starting a repl as simple as:</p>
<pre><code><span class="hljs-attr">run</span>=<span class="hljs-string">"clang-format \*.\* -i &amp;&amp; clang++-7 -pthread -std=c++17 -o main main.cpp &amp;&amp; ./main"</span>
</code></pre><h3 id="conclusion">Conclusion</h3>
<p>You can use any of the methods depending on your use case as none of them is perfect and has its drawbacks. Personally, I prefer the last one <a class="post-section-overview" href="#run-format-before-the-repl-runs">Run format before the repl runs</a>. </p>
<blockquote>
<p>It can be changed even further to trigger auto-format on single <code>Cntrl-Enter</code> and fast triggering <code>Cntrl-Enter</code> twice to run the repl. This needs saving a timestamp and checking the time difference. You can do this by creating a complex command to write into the file and read it on <code>run</code>, for example.</p>
</blockquote>
<hr />
<p>Thanks for reading! My articles are constantly revised and updated, so bookmark if you want to be up-to-date on a topic 🍺</p>
]]></content:encoded></item></channel></rss>