<?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: Renan Duarte</title>
    <description>The latest articles on DEV Community by Renan Duarte (@renanduart3).</description>
    <link>https://dev.to/renanduart3</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%2F171477%2F3e94b259-5ed0-4bf7-900c-a9ec5d321c36.jpeg</url>
      <title>DEV Community: Renan Duarte</title>
      <link>https://dev.to/renanduart3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/renanduart3"/>
    <language>en</language>
    <item>
      <title>Bug name folder Windows 11</title>
      <dc:creator>Renan Duarte</dc:creator>
      <pubDate>Fri, 24 Mar 2023 12:41:26 +0000</pubDate>
      <link>https://dev.to/renanduart3/bug-name-folder-windows-11-5g29</link>
      <guid>https://dev.to/renanduart3/bug-name-folder-windows-11-5g29</guid>
      <description>&lt;p&gt;For some reason, while installing an &lt;a href="https://astro.build/"&gt;Astro Project &lt;/a&gt; , i've inserted invalid name for the folder, and some way, the framework had done it a folder with a invalid name, ocurring a infinite loop in terminal, when you try to delete a folder with reference to "." , the system cannot find it and you cant delete this.&lt;/p&gt;

&lt;p&gt;The solution is to enter in WSL in a linux distro, inside the same terminal and delete the folder :)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd /mnt/c/Users/user-name/source/repos/Project/target_folder$&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and &lt;/p&gt;

&lt;p&gt;&lt;code&gt;rm -r target_folder&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And solved it.&lt;/p&gt;

&lt;p&gt;Maybe it can help someone out there, if some way you got invalid namefolders and can't delete them.&lt;/p&gt;

</description>
      <category>windows11</category>
      <category>bugwindows1</category>
      <category>foldernamebug</category>
      <category>wsl</category>
    </item>
    <item>
      <title>Javascript method to return flags of cards.</title>
      <dc:creator>Renan Duarte</dc:creator>
      <pubDate>Wed, 23 Sep 2020 21:25:10 +0000</pubDate>
      <link>https://dev.to/renanduart3/javascript-method-to-return-flags-of-cards-28kn</link>
      <guid>https://dev.to/renanduart3/javascript-method-to-return-flags-of-cards-28kn</guid>
      <description>&lt;p&gt;I'm not really sure which cards we have to deal with in nowadays, but i got this problem to evaluate correctly the cards before sending the number to the &lt;strong&gt;gateway&lt;/strong&gt; that not have something like this (or another solution more professional) to get flag card based on the number, so i've searched, compiled in my snippets and now wrinting here to ... just write, so i hope this could help someone out there 😁&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;by default, the flag returned is 'visa' if nothings match.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;PS: The truth is that i have no idea how this regular expression works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   returnflag('2014 7722409 8894');

   function returnflag(cardNumber) {
        cardNumber = cardNumber.toString().replace(/[^0-9]+/g, '');
        const cards = {
            visa: /^4[0-9]{12}(?:[0-9]{3})?/,
            mastercard: /^(((51)|(52)|(53)|(54)|(55))\d{0,14})/,
            diners: /^3(?:0[0-5]|[68][0-9])[0-9]{11}/,
            amex: /^3[47][0-9]{13}/,
            discover: /^6(?:011|5[0-9]{2})[0-9]{12}/,
            hipercard: /^(606282\d{10}(\d{3})?)|(3841\d{15})/,
            elo: /^((((636368)|(438935)|(504175)|(451416)|(636297))\d{0,10})|((5090)|(5067)|(4576)|(4011))\d{0,12})/,
            jcb: /^(?:2131|1800|35\d{3})\d{11}/,
            aura: /^(5078\d{2})(\d{2})(\d{11})$/
        };

        for (let flag in cards) {
            if (cards[flag].test(cardNumber)) {
                return flag;
            }
        }
        return 'visa';
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
