<?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: gyurisc</title>
    <description>The latest articles on DEV Community by gyurisc (@gyurisc).</description>
    <link>https://dev.to/gyurisc</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%2F326945%2Fcac009dd-327e-44dc-ac81-a06f25b3022a.jpeg</url>
      <title>DEV Community: gyurisc</title>
      <link>https://dev.to/gyurisc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gyurisc"/>
    <language>en</language>
    <item>
      <title>How has programming changed you for better or worse in your life?</title>
      <dc:creator>gyurisc</dc:creator>
      <pubDate>Tue, 28 Apr 2020 08:04:22 +0000</pubDate>
      <link>https://dev.to/gyurisc/how-has-programming-changed-you-for-better-or-worse-in-your-life-2bbd</link>
      <guid>https://dev.to/gyurisc/how-has-programming-changed-you-for-better-or-worse-in-your-life-2bbd</guid>
      <description>&lt;p&gt;Recently, I started wondering how my career choice impacted my life. I am coding for 20+ years and I consider myself really lucky since I love it, but there are days when I have no motivation and sometimes I feel burnout. &lt;/p&gt;

&lt;p&gt;I am trying to reflect on how this lifelong love of coding impacted other areas of my life? Spending lots of times coding will change you in many ways that are hard to notice. &lt;/p&gt;

&lt;p&gt;Here are a few not so great ways how coding affected me:   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Introvert&lt;/strong&gt;: I think being an introvert is a given and coding gave me an excuse not to improve in this regard. It was always easier to go into code instead of talking to people. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Patience&lt;/strong&gt;:  when coding or debugging changes happen immediately. It is very easy to see the outcome. Other areas in life are not like this: gardening, investing, or SEO. You make a change and you will not see results in weeks, months, or years even. It is harder for me to start with that kind of thing because there is no instant gratification.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Control&lt;/strong&gt;: being in control and understanding your app. Managing all things down to the minuscule details. This is an important thing for me in coding. I expect to be able to control everything. Like I mentioned in the previous point, other areas in the non-digital world are not this black and white. The outside world is not in your control. Other people not in your control. Life is not black and white like when you coding... &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shiny objects&lt;/strong&gt;, There is always a new shiny object that I am dying to know more about, learn about it and try. In the 30 minutes, it took me to write this article I found myself reading Svelte. Sometimes, it takes me a great effort to focus on my tasks and finish things. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How coding is affected you and how do you try to overcome the not so great things in it?&lt;/p&gt;

&lt;p&gt;If you like this article, share it, follow me and check out my other &lt;a href="https://www.littlebigtomatoes.com/" rel="noopener noreferrer"&gt;blog posts&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
    </item>
    <item>
      <title>Easily remove empty lines using regular expression in Visual Studio Code</title>
      <dc:creator>gyurisc</dc:creator>
      <pubDate>Fri, 10 Apr 2020 10:14:14 +0000</pubDate>
      <link>https://dev.to/gyurisc/easily-remove-empty-lines-using-regular-expression-in-visual-studio-code-1230</link>
      <guid>https://dev.to/gyurisc/easily-remove-empty-lines-using-regular-expression-in-visual-studio-code-1230</guid>
      <description>&lt;p&gt;This is a quick tip on how to remove empty lines using regular expression from a large text file in Visual Studio Code.&lt;/p&gt;

&lt;p&gt;When I am processing data and need to do it quickly, I found the best way is to use a simple text editor before loading it to Excel or to import it to a database. My favorite one is for cleaning and normalizing data is Visual Studio Code and the regular expression support of its Search Tab.&lt;/p&gt;

&lt;p&gt;What I normally do is to start Visual Studio Code and begin removing unneeded lines or words from it. Recently, I had a few hundred lines of text that I needed to convert to CSV, so I can load it to Excel for further processing.&lt;/p&gt;

&lt;p&gt;After removing the not needed data I ended up with a rather large text file like with hundreds of empty lines like this one in the screenshot. Removing this many empty lines is hard and unproductive work which I do not like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F04%2Fremoving_empty_lines-1024x505.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F04%2Fremoving_empty_lines-1024x505.png" alt="Removing empty lines using regular expression in Visual Studio Code" width="800" height="400"&gt;&lt;/a&gt;Removing empty lines using regular expression in Visual Studio Code&lt;/p&gt;

&lt;h2&gt;
  
  
  How to remove empty lines using regular expression
&lt;/h2&gt;

&lt;p&gt;To find the empty lines, do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the &lt;strong&gt;Search&lt;/strong&gt; icon on the left or use shortcut Ctrl-Shift-F&lt;/li&gt;
&lt;li&gt;Put in the regular expression below&lt;/li&gt;
&lt;li&gt;Make sure that the &lt;strong&gt;Use Regular Expression&lt;/strong&gt; option is selected next to the &lt;strong&gt;Search Term&lt;/strong&gt; entry.&lt;/li&gt;
&lt;li&gt;Make sure that the &lt;strong&gt;Replace&lt;/strong&gt; entry remains empty. &lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Replace All&lt;/strong&gt; to remove the empty lines. This button is next to the Replace field or use the shortcut Ctrl-Alt-Enter. &lt;/li&gt;
&lt;li&gt;If you have multiple files open then make sure that you remove the empty lines only from the file that you want to. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use this &lt;a href="https://gist.github.com/fomightez/706c1934a07c08b6c441" rel="noopener noreferrer"&gt;regular expression to find empty lines&lt;/a&gt; in your text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;^(?:[\t]*(?:\r?\n|\r))+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is it. Enjoy! :).&lt;/p&gt;

&lt;h2&gt;
  
  
  More tips with regular expressions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I match lines with a regular expression that ends with a word?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F04%2FAnnotation-2020-04-10-122730-150x150.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F04%2FAnnotation-2020-04-10-122730-150x150.png" alt="Removing lines with regular expression only where a specific word ends the line" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have text where lines are containing a certain word like &lt;strong&gt;someline&lt;/strong&gt; but you want only to remove only the lines where this word ends the line, but keep other lines where the word is in a URL for example, then use &lt;strong&gt;someline$&lt;/strong&gt; regular expression to match the lines&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I match lines with a regular expression that begins with a word?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F04%2FAnnotation-2020-04-10-122946-150x150.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F04%2FAnnotation-2020-04-10-122946-150x150.png" alt="Removing lines with regular expression only where a specific word begins the line" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have text where lines are containing a certain word like &lt;strong&gt;someline&lt;/strong&gt; but you want only to remove only the lines where the line begins with this word, but keep other lines where the word is in a URL for example, then use &lt;strong&gt;^someline&lt;/strong&gt; regular expression to match the lines&lt;/p&gt;

</description>
      <category>regex</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Azure Deployment Slots – 5 most important things to know about them</title>
      <dc:creator>gyurisc</dc:creator>
      <pubDate>Fri, 13 Mar 2020 09:55:53 +0000</pubDate>
      <link>https://dev.to/gyurisc/azure-deployment-slots-5-most-important-things-to-know-about-them-366a</link>
      <guid>https://dev.to/gyurisc/azure-deployment-slots-5-most-important-things-to-know-about-them-366a</guid>
      <description>&lt;h2&gt;
  
  
  What are Azure Deployment Slots?
&lt;/h2&gt;

&lt;p&gt;Azure Deployment Slot is a very useful feature of the Azure App Service. With this feature, it is possible to create one or more slots that can host different versions of your app. You can then swap these deployment slots without causing any downtime for your users.&lt;/p&gt;

&lt;p&gt;When you add your first deployment slot in your app service, let’s call it staging. Then this would become the place where you can deploy the new version of your app. After validating this new version, you can swap it with the current production slot.&lt;/p&gt;

&lt;p&gt;After swapping, the production slot becomes the staging slot. The staging becomes the production slot. If there is a problem you can roll back your changes by swapping back. With this, it is very easy to return to the last-known-good state of the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Most important features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Multiple versions of the same app in your app service.&lt;/li&gt;
&lt;li&gt;Each slot has its own URL.&lt;/li&gt;
&lt;li&gt;Swapping and rolling back is very easy&lt;/li&gt;
&lt;li&gt;Redirect part of the traffic to the staging slot, so you can test the new app under load.&lt;/li&gt;
&lt;li&gt;Each slot can have shared or slot specific settings. &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to create deployment slots
&lt;/h2&gt;

&lt;p&gt;Creating a deployment slot is very straightforward. In your AppService, you need to locate the Deployment Slot menu and provide the name. The URL for the new deployment slot will be your appname-slotname. So if your original app URL is appname.azurewebsites.net then the URL for the new slot will be &lt;a href="mailto:appname-slotname@azurewebsites.net"&gt;appname-slotname@azurewebsites.net&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to deploy to your slot
&lt;/h2&gt;

&lt;p&gt;There are different ways to deploy to your deployment slot. The easiest is to right-click on your VS.NET project. Select publish and then create a new publish profile. Then select an existing AppService plan and choose to stage. You can also download the publishing profile for the slot and then import it to your Visual Studio project. Another quick and dirty solution is to clone the git repo for the deployment slot and then copy your binaries to the repo. Commit and push and that is all.&lt;/p&gt;

&lt;p&gt;Other ways to do this are using Azure DevOps or other CI/CD systems like Jenkins.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when swapping
&lt;/h2&gt;

&lt;p&gt;When the staging version looks good and it is ready for deployment then all you need to do is perform a swap. All we need to do is to click the swap button. What happens during swapping is the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slot specific settings are moving from old slot to new slot.&lt;/li&gt;
&lt;li&gt;App in the new slot is restarted and gets warmed up&lt;/li&gt;
&lt;li&gt;New traffic gets redirected to the new slot. Old slot servers the existing request but not receiving new ones anymore&lt;/li&gt;
&lt;li&gt;Old production slot moving to the staging slot, settings applied and restarted&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pricing tiers
&lt;/h2&gt;

&lt;p&gt;To be able to use a deployment slot, you will need to switch your AppService pricing plan to one of your paid tiers. Free, Shared and Basic do not offer deployment slots, unfortunately. The obvious choice here is the Premium AppService plan. This is the cheapest plan that supports deployment slots.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fonly_paid_plans.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.littlebigtomatoes.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fonly_paid_plans.png" alt="Azure Deployment slots are only available in paid plans." width="800" height="400"&gt;&lt;/a&gt;Azure Deployment slots are available only in paid plans.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Deployment slots is a terrific feature for your AppService. You can do deployments without the downtime. You can test the new version before putting it into production. Slots can have shared configuration settings and slot specific ones. Also, you can direct a certain amount of traffic to your staging slot to see how it behaves under live traffic. If something fails then it is very easy to get back to your last working version. If you have a critical application then this is a welcome addition, so it helps cut down stress for you and for your customers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero-downtime deployments by warming up new versions &lt;/li&gt;
&lt;li&gt;Testing in production &lt;/li&gt;
&lt;li&gt;Great way to do validation before putting into production &lt;/li&gt;
&lt;li&gt;Easy to go back to last known state &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will need a Premium AppService plan as Free, Shared and Standard are not supporting this feature.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots" rel="noopener noreferrer"&gt;Deploy staging slots&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.littlebigtomatoes.com/azure-deployment-slots-5-most-important-things-to-know-about-them" rel="noopener noreferrer"&gt;Azure Deployment slots 5 most important things to know&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>azure</category>
      <category>web</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
