<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bertold Kolics</title>
    <description>The latest articles on DEV Community by Bertold Kolics (@bertold).</description>
    <link>https://dev.to/bertold</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F466554%2Ff3489ae5-18a6-44ea-b001-e977bf9fdb6d.jpg</url>
      <title>DEV Community: Bertold Kolics</title>
      <link>https://dev.to/bertold</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bertold"/>
    <language>en</language>
    <item>
      <title>Moving DNS Records from NameCheap to Cloudflare</title>
      <dc:creator>Bertold Kolics</dc:creator>
      <pubDate>Wed, 29 Nov 2023 01:23:49 +0000</pubDate>
      <link>https://dev.to/bertold/moving-dns-records-from-namecheap-to-cloudflare-6k8</link>
      <guid>https://dev.to/bertold/moving-dns-records-from-namecheap-to-cloudflare-6k8</guid>
      <description>&lt;p&gt;I would like to setup a small server at home. Prior to doing this, I needed to move my DNS records from &lt;a href="https://namecheap.com" rel="noopener noreferrer"&gt;Namecheap&lt;/a&gt;. I am planning on using &lt;a href="https://cloudflare.com" rel="noopener noreferrer"&gt;Cloudflare's&lt;/a&gt; free plan to host my DNS and also front the services once I have migrated the zone first.&lt;/p&gt;

&lt;p&gt;Namecheap does not make it easy to export DNS records, though.&lt;/p&gt;

&lt;p&gt;Here is what I ended up doing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloudflare migrated some DNS records for me, but not all&lt;/li&gt;
&lt;li&gt;Fortunately, you can import additional records into Cloudflare without deleting existing ones. Unfortunately, their user interface does not make it clear if you are appending to a zone or replacing the entire zone when you import. It is - fortunately - the former.&lt;/li&gt;
&lt;li&gt;Next, I went to the Advanced DNS page in Namecheap and copied the table of records to the clipboard&lt;/li&gt;
&lt;li&gt;After that I opened the Numbers app on my mac and pasted the records. I picked one record type at a time (e.g. &lt;code&gt;TXT&lt;/code&gt;). Fortunately, Numbers can nicely parse the tables.&lt;/li&gt;
&lt;li&gt;Next up: deleting all columns, except for the name and the value columns.&lt;/li&gt;
&lt;li&gt;Exported the remaining columns into a CSV file&lt;/li&gt;
&lt;li&gt;Then I ran a simple script to translate the records into a domain format that Cloudflare can import&lt;/li&gt;
&lt;li&gt;Finally, I imported the records using the Cloudflare interface&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Simple one-liner to convert the CSV (assuming that you exported to &lt;code&gt;txtrecords.txt&lt;/code&gt;. Note that Cloudflare likes the full domain name in the record name (hence the &lt;code&gt;.your.domain.&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="nt"&gt;-F&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="s1"&gt;' { printf("%s.your.domain.\t1\tIN\tTXT\t%s\n", $1, $2) } '&lt;/span&gt; txtrecords.txt &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;records-to-import.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may need to adjust the file before importing if you have &lt;code&gt;@&lt;/code&gt; records in the file.&lt;/p&gt;

&lt;p&gt;You also probably do not want to proxy the imported records before you have setup everything properly on the backend.&lt;/p&gt;

</description>
      <category>dns</category>
      <category>cloudflare</category>
      <category>namecheap</category>
    </item>
    <item>
      <title>A great resource for browser compatibility</title>
      <dc:creator>Bertold Kolics</dc:creator>
      <pubDate>Wed, 18 Nov 2020 02:09:09 +0000</pubDate>
      <link>https://dev.to/bertold/a-great-resource-for-browser-compatibility-37a</link>
      <guid>https://dev.to/bertold/a-great-resource-for-browser-compatibility-37a</guid>
      <description>&lt;p&gt;The &lt;a href="https://developer.mozilla.org"&gt;Mozilla Developer Network&lt;/a&gt; is a fantastic resource for finding out about browser compatibility issues especially when you are working with JavaScript.&lt;/p&gt;

&lt;p&gt;I was reminded of this when I was trying to get Firefox 78 ESR (extended support release) to format time for me and I realized that it only supports the &lt;em&gt;timeStyle&lt;/em&gt; option in &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat"&gt;version 79 or later&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, for example, this snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLocaleTimeString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;timeStyle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;short&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;produces different results in Firefox 78 and in Firefox 83.&lt;/p&gt;

&lt;p&gt;Firefox 78 result:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZR553Qp3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3cff50ir125ync7conkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZR553Qp3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3cff50ir125ync7conkn.png" alt="" width="733" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Firefox 83 result:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BBFgZAAU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5t90tctzcu8pwh0qx9lf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BBFgZAAU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5t90tctzcu8pwh0qx9lf.png" alt="" width="742" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, Firefox 78 will display seconds, but the newer version will adhere to the short time style and not display that field.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Clear your local storage for consistent results</title>
      <dc:creator>Bertold Kolics</dc:creator>
      <pubDate>Tue, 17 Nov 2020 02:24:26 +0000</pubDate>
      <link>https://dev.to/bertold/clear-your-local-storage-for-consistent-results-lf9</link>
      <guid>https://dev.to/bertold/clear-your-local-storage-for-consistent-results-lf9</guid>
      <description>&lt;p&gt;Your test results may be affected by the state kept in your browser. It is recommended to clear your history and application storage to get consistent results.&lt;/p&gt;

&lt;p&gt;There are several ways to accomplish this.&lt;/p&gt;

&lt;p&gt;Open your site in Incognito or Private mode.&lt;/p&gt;

&lt;p&gt;Another is to clean your history.&lt;/p&gt;

&lt;p&gt;I also often end up creating a separate browser profile or Person in Google Chrome parlance for different applications.&lt;/p&gt;

&lt;p&gt;Chrome DevTools also allows you to remove local storage for your site.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EwoRz9S9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a9odgl42g3pbpda5iafj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EwoRz9S9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a9odgl42g3pbpda5iafj.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The fundamental reason to follow these practices is simple: you want consistent test results on all subsequent test runs whether they are automated or manual. You don't want previous tests or visits to your application to alter the results that you see.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Breakpoints to the rescue</title>
      <dc:creator>Bertold Kolics</dc:creator>
      <pubDate>Mon, 16 Nov 2020 01:53:17 +0000</pubDate>
      <link>https://dev.to/bertold/breakpoints-to-the-rescue-36bk</link>
      <guid>https://dev.to/bertold/breakpoints-to-the-rescue-36bk</guid>
      <description>&lt;p&gt;I have come to respect the breakpoints that you can set in Chrome DevTools when inspecting the DOM. It is especially handy when you are trying to find an element that disappears as soon as you click outside the window.&lt;/p&gt;

&lt;p&gt;I was interacting with a drop-down menu of a React app, where the list of items would disappear as soon as I moved the cursor elsewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set a breakpoint
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;Find the container element in the DOM and highlight it. Then click on the ... to bring up the secondary menu. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WZIaRo73--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nrevngci48v9h077apwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WZIaRo73--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nrevngci48v9h077apwl.png" alt="" width="692" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;Set a breakpoint on subtree changes.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Aufa7dPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m0ohuvu7cvuhwghlt5up.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Aufa7dPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m0ohuvu7cvuhwghlt5up.png" alt="" width="872" height="656"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3
&lt;/h3&gt;

&lt;p&gt;Confirm that you see that blue dot next to the selected line.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HwMP2bgO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cikdvgwupo5wwgwqkian.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HwMP2bgO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cikdvgwupo5wwgwqkian.png" alt="" width="880" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Make a move
&lt;/h2&gt;

&lt;p&gt;Now that the breakpoint is set, you can interact with the application. You may need to resume the application a few times to get to the desired state. When you are there, just switch back to the &lt;em&gt;Elements&lt;/em&gt; tab and find the element that you are looking for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remove the breakpoint
&lt;/h2&gt;

&lt;p&gt;When you no longer need it, remove it. You can do this the same way you set the breakpoint.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>html</category>
      <category>react</category>
    </item>
  </channel>
</rss>
