<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title></title>
    <description>Yet another software engineer</description>
    <link>https://salvagni.dev//</link>
    <atom:link href="https://salvagni.dev//feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 25 Jul 2025 10:10:43 +0000</pubDate>
    <lastBuildDate>Fri, 25 Jul 2025 10:10:43 +0000</lastBuildDate>
    <generator>Jekyll v4.3.3</generator>
    
      <item>
        <title>Tidy First</title>
        <description>&lt;p&gt;I saw this book recommended in several places, and it’s actually quite a good refresher. It’s not so much about the technical aspects of refactoring (or tidying it up), but more about how to approach it. A quick and worthwhile read.&lt;/p&gt;
</description>
        <pubDate>Thu, 29 May 2025 18:20:00 +0000</pubDate>
        <link>https://salvagni.dev//2025/05/29/tidy-first.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2025/05/29/tidy-first.html</guid>
        
        
        <category>photo</category>
        
      </item>
    
      <item>
        <title>Quick life updates</title>
        <description>&lt;p&gt;I ran my second half marathon in 2024, it was the &lt;a href=&quot;https://www.strava.com/activities/12644630016&quot;&gt;Royal Parks Half Marathon in London&lt;/a&gt;, and my &lt;a href=&quot;https://www.strava.com/activities/13023927595&quot;&gt;&lt;strong&gt;first Marathon&lt;/strong&gt; in Valencia, also in 2024&lt;/a&gt;. 2024 was the year I ran the most, an incredible (to me) ~1200km across 12 months. In fact, I think I ran too much, which kind of burned me out of it - I haven’t ran much in 2025.
In 2024 I had shin splits and &lt;em&gt;runners knee&lt;/em&gt; pain due to the increase in the work load. Ah, I also managed to ran my fastest 10km, which was something I was trying for quite some time. For so long I couldn’t run 10km under 60min, but finally did it!&lt;/p&gt;

&lt;p&gt;Apart from running, this month I did my first bike touring in a while. During the Easter Bank Holidays in the UK, I took a ferry from Dover to Dunkirk, and cycled from there until Amsterdam. It was a 5 days journey, crossing the cost of Belgium and the Nord Sea islands in the Netherlands, until finally arriving to Amsterdam. I had my camping gear with me, and set up my tent twice and spent the remaining days in hotels. It was a tough journey, however worth it. The total distance was ~340km, so not short but not unmangeable.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.strava.com/activities/14216015270&quot;&gt;Dunkirk - Ostend&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.strava.com/activities/14224944332&quot;&gt;Ostend - Bruges&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.strava.com/activities/14224944786&quot;&gt;Bruges - Breskens&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.strava.com/activities/14225985802&quot;&gt;Vlissingen -&amp;gt; Camping&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.strava.com/activities/14238271276&quot;&gt;Middelburg -&amp;gt; Brielle&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.strava.com/activities/14245647234&quot;&gt;Brielle -&amp;gt; The Hague&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.strava.com/activities/14245609400&quot;&gt;The Hague -&amp;gt; Amsterdam&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was quite surprised (well I shouldn’t have been surprised given the year in Berlin, but…) about the cycling infrastructure in all 3 countries and it was such a down coming back to the UK in this aspect. I wish this could change.&lt;/p&gt;

&lt;picture&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/bike-fr-nl-500-982432928.webp 500w, /generated/assets/images/posts/bike-fr-nl-800-982432928.webp 800w, /generated/assets/images/posts/bike-fr-nl-1200-982432928.webp 1200w, /generated/assets/images/posts/bike-fr-nl-1600-982432928.webp 1600w&quot; type=&quot;image/webp&quot; /&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/bike-fr-nl-500-53346aa87.jpg 500w, /generated/assets/images/posts/bike-fr-nl-800-53346aa87.jpg 800w, /generated/assets/images/posts/bike-fr-nl-1200-53346aa87.jpg 1200w, /generated/assets/images/posts/bike-fr-nl-1600-53346aa87.jpg 1600w&quot; type=&quot;image/jpeg&quot; /&gt;
  &lt;img src=&quot;/generated/assets/images/posts/bike-fr-nl-800-53346aa87.jpg&quot; /&gt;
&lt;/picture&gt;

</description>
        <pubDate>Wed, 30 Apr 2025 17:00:00 +0000</pubDate>
        <link>https://salvagni.dev//2025/04/30/quick-life-updates.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2025/04/30/quick-life-updates.html</guid>
        
        
        <category>Life</category>
        
        <category>Cycling</category>
        
        <category>Running</category>
        
      </item>
    
      <item>
        <title>Bus Stop Debugging</title>
        <description>&lt;p&gt;Someone was debugging the bus station timetable some weeks ago. West Wimbledon.&lt;/p&gt;
</description>
        <pubDate>Wed, 30 Oct 2024 21:04:55 +0000</pubDate>
        <link>https://salvagni.dev//2024/10/30/bus-stop-debugging.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2024/10/30/bus-stop-debugging.html</guid>
        
        
        <category>photo</category>
        
      </item>
    
      <item>
        <title>Oasis and future classics</title>
        <description>&lt;p&gt;Getting overly excited about two things recently: the Oasis reunion and flipping a classic (or future classic) car. Incredibly (but not surprisingly), there’s nothing related about them. However, both can lead to frustration and massive overspending.&lt;/p&gt;
</description>
        <pubDate>Thu, 29 Aug 2024 15:42:00 +0000</pubDate>
        <link>https://salvagni.dev//2024/08/29/15-46.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2024/08/29/15-46.html</guid>
        
        
        <category>short</category>
        
      </item>
    
      <item>
        <title>Short</title>
        <description>&lt;p&gt;While setting up this blog again, and reading (and fixing so many grammar/spelling mistakes), I realised that plenty of things has happened since I move to Europe. I guess this the real value of writing down blog posts. It works as a time capsule. I can totally travel back in time when I read these old, silly and mispelled texts.&lt;/p&gt;
</description>
        <pubDate>Thu, 08 Feb 2024 22:18:00 +0000</pubDate>
        <link>https://salvagni.dev//2024/02/08/22-18.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2024/02/08/22-18.html</guid>
        
        
        <category>short</category>
        
      </item>
    
      <item>
        <title>New Threshold</title>
        <description>&lt;p&gt;Got back to running early this year. I bought a Garmin FR 255 and I’m trying to do all the Daily Suggested Workouts (or as much as I can) and I hope I can improve my fitness level in a few months.&lt;/p&gt;
</description>
        <pubDate>Fri, 02 Feb 2024 12:59:00 +0000</pubDate>
        <link>https://salvagni.dev//2024/02/02/new-threshold.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2024/02/02/new-threshold.html</guid>
        
        
        <category>photo</category>
        
      </item>
    
      <item>
        <title>I finished my first half marathon</title>
        <description>&lt;p&gt;Last quarter of 2019, I decided that I’d run a half-marathon &amp;amp; marathon in 2020. Unfortunately, 2020 hit us hard, and I had to postpone my plans. At that point in time, I had no idea whether I’d be able to run any of the races anytime soon. For a while, I kept training hard, but gradually I started putting my training sessions aside. Although I skipped the marathon, I finally managed to finish a half-marathon.&lt;/p&gt;

&lt;picture&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/half-marathon/199423730-500-234b8b67b.webp 500w, /generated/assets/images/posts/half-marathon/199423730-800-234b8b67b.webp 800w, /generated/assets/images/posts/half-marathon/199423730-1200-234b8b67b.webp 1200w&quot; type=&quot;image/webp&quot; /&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/half-marathon/199423730-500-234b8b67b.jpeg 500w, /generated/assets/images/posts/half-marathon/199423730-800-234b8b67b.jpeg 800w, /generated/assets/images/posts/half-marathon/199423730-1200-234b8b67b.jpeg 1200w&quot; type=&quot;image/jpeg&quot; /&gt;
  &lt;img src=&quot;/generated/assets/images/posts/half-marathon/199423730-800-234b8b67b.jpeg&quot; /&gt;
&lt;/picture&gt;

&lt;h2 id=&quot;the-training&quot;&gt;&lt;strong&gt;The training&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;I started running as a hobby. I was looking for something to spend my time doing something not related to coding/computers/buying-useless-gadgets. In my spare time, I’d either be trying something new on a code editor or watching a sitcom for the N time. The difference I noticed between doing sports and sending my latest side-project to the graveyard is the feeling of accomplishment.&lt;/p&gt;

&lt;p&gt;We can debate that coding something on the side, even a small project, can give you that feeling of accomplishment as well. However, at least for me, that seemed way too much like work. I’d set up a board on Trello, create a private repository on Gitlab, set up a local development environment, and config for Heroku, and so on. That said, what I mean is that side-projects weren’t disconnecting me from work. And I think we all need that.&lt;/p&gt;

&lt;p&gt;Anyway, let me get back to the half- &amp;amp; marathon. Both races were confirmed to happen in 2021. However, they would happen with an interval of a month between each other. That wouldn’t be a problem if I had been working out hard like in the beginning. I even tried to keep with the plan and run both but failed to keep the training. In the end, I’d be able to run only the first one.&lt;/p&gt;

&lt;p&gt;I had never run 21,0975km (13.1094mi) before. The longest distance I reached while training was 19km (11.8061mi), which gave me mixed feelings about my capacity to finish the half-marathon. On one hand, I was so exhausted after the workout that I didn’t want to feel like that again. On the other hand, I was super excited and my endorphin levels were so high, that I could only think that I was “almost there”.&lt;/p&gt;

&lt;p&gt;That’s one of the best feelings of running, in my opinion. You realize how much progress you have made and that all the workouts were paying off. Every week you will notice that you can run further or that your previous run is not that hard anymore. Besides, there are all the adversities that you have to overcome during the training process.&lt;/p&gt;

&lt;p&gt;Since I ran throughout the entire year, I had the chance to run on mild and hot summer days; with rain; at night; and with snow. There were days I woke up at 6 am to run at 7 am with temperatures of 0 Celsius and a real feel of -10 Celcius. Even with the proper clothing, it’s way too cold for me. My running route would start and end from the door of my building so I could spend the minimum amount of time outside in the cold. I would also take my running gear to my holiday trips, which made me run in great places like Greece and Spain.&lt;/p&gt;

&lt;picture&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/half-marathon/IMG_7298-500-fa9a346f5.webp 500w, /generated/assets/images/posts/half-marathon/IMG_7298-800-fa9a346f5.webp 800w, /generated/assets/images/posts/half-marathon/IMG_7298-1200-fa9a346f5.webp 1200w, /generated/assets/images/posts/half-marathon/IMG_7298-1600-fa9a346f5.webp 1600w&quot; type=&quot;image/webp&quot; /&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/half-marathon/IMG_7298-500-fa9a346f5.jpeg 500w, /generated/assets/images/posts/half-marathon/IMG_7298-800-fa9a346f5.jpeg 800w, /generated/assets/images/posts/half-marathon/IMG_7298-1200-fa9a346f5.jpeg 1200w, /generated/assets/images/posts/half-marathon/IMG_7298-1600-fa9a346f5.jpeg 1600w&quot; type=&quot;image/jpeg&quot; /&gt;
  &lt;img src=&quot;/generated/assets/images/posts/half-marathon/IMG_7298-800-fa9a346f5.jpeg&quot; /&gt;
&lt;/picture&gt;

&lt;p&gt;Although it was tough to run during winter with cold, rain, and eventually snow, it also took out that laziness that hits you before you go outside for a run. Similar to the ones that make you skip the gym. During spring and summer, I had this mental mantra on my head that would make me wake up early in the morning and go for a run: I ran with -10 Celcius, I’m not going to skip a workout on such a beautiful day.&lt;/p&gt;

&lt;h2 id=&quot;the-race&quot;&gt;&lt;strong&gt;The Race&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;I was a bit nervous on the race day. I knew I wouldn’t be able to reach my goal of finishing it in less than two hours, so I focused on my main goal: finish it. It seems silly, but I could have messed up otherwise. If I had aimed to run faster, I wouldn’t be able to keep the pace long enough and, therefore, would break. That said, the first 10km, I ran at a comfortable pace, which I knew I could keep for at least two hours and would make me a finisher. Everyone has their strategy for the race. I was keeping myself hydrated, and I’d take power gel every 40 minutes.&lt;/p&gt;

&lt;p&gt;Once I reached the first 10km, I decided to accelerate. For a moment, I thought that just finishing wouldn’t be enough, that I was in a race and I should compete – with myself only. I started to reduce my pace gradually and run faster. I was feeling great. I kept it until the 16th kilometer, and after hydrating myself again, I decided to run faster. At this point, I thought that I’d be able to even finish in a good time. It was a silly mistake, and a few kilometers later, I had to slow down a bit. Otherwise, I wouldn’t finish it.&lt;/p&gt;

&lt;p&gt;The race day is completely different from the training runs. The atmosphere is great. During the whole route, you will find people cheering for you. People that you don’t even know will read aloud your name from your event’s tag. Besides, there were bands, and people playing music on other parts of the route. Eventually, you find some friends calling your name as well. It’s something else.&lt;/p&gt;

&lt;p&gt;On the 20th kilometer, I heard a couple of friends calling my name and pushing me forward. I was exhausted, couldn’t really fold my knees properly, and was already complaining to myself for putting the workouts sessions aside for too long. Anyway, there was only one kilometer left.&lt;/p&gt;

&lt;p&gt;My wife also ran it, and she started and finished it earlier as well, in 1h50min. To my surprise, she was waiting for me on the other side of the finish line, cheering for me and calling me. An absolutely amazing feeling. Again, mixed: couldn’t even walk well and not even hug Luisa properly as I was panting looking for air, but I have finally finished my first half marathon.&lt;/p&gt;

&lt;picture class=&quot;full-image&quot;&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/half-marathon/IMG_5052-500-a40dc1dfa.webp 500w, /generated/assets/images/posts/half-marathon/IMG_5052-800-a40dc1dfa.webp 800w, /generated/assets/images/posts/half-marathon/IMG_5052-1200-a40dc1dfa.webp 1200w, /generated/assets/images/posts/half-marathon/IMG_5052-1600-a40dc1dfa.webp 1600w&quot; type=&quot;image/webp&quot; /&gt;
  &lt;source sizes=&quot;(max-width: 480px) 500px, (max-width: 768) 800px, (max-width: 1024px) 1024px, (min-width: 1201px) 1470px, (max-width: 1200px) 1600px&quot; srcset=&quot;/generated/assets/images/posts/half-marathon/IMG_5052-500-a40dc1dfa.jpeg 500w, /generated/assets/images/posts/half-marathon/IMG_5052-800-a40dc1dfa.jpeg 800w, /generated/assets/images/posts/half-marathon/IMG_5052-1200-a40dc1dfa.jpeg 1200w, /generated/assets/images/posts/half-marathon/IMG_5052-1600-a40dc1dfa.jpeg 1600w&quot; type=&quot;image/jpeg&quot; /&gt;
  &lt;img src=&quot;/generated/assets/images/posts/half-marathon/IMG_5052-800-a40dc1dfa.jpeg&quot; /&gt;
&lt;/picture&gt;

&lt;p&gt;Berlin, 23 August 2021, 21,0975km (13.1094mi) and 2h30min after (I know, what a shame) I did it.&lt;/p&gt;
</description>
        <pubDate>Mon, 18 Oct 2021 17:15:00 +0000</pubDate>
        <link>https://salvagni.dev//2021/10/18/finished-my-first-half-marathon.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2021/10/18/finished-my-first-half-marathon.html</guid>
        
        
        <category>Life</category>
        
        <category>Berlin</category>
        
        <category>Running</category>
        
      </item>
    
      <item>
        <title>The sweet road of building a custom date picker</title>
        <description>&lt;p&gt;Recently I had to replace a date picker component in an Angular application and I decided, along with my teammates, to go with a custom solution. The previous date picker we’ve been using was a component from &lt;a href=&quot;https://valor-software.com/ngx-bootstrap/#/datepicker&quot;&gt;ngx-bootstrap&lt;/a&gt; library, which is a great one.&lt;/p&gt;

&lt;p&gt;The decision of building a custom one was taken mostly because we need mobile support, and we didn’t find a solution off-the-shelf that would fit our requirements. It wasn’t an easy decision, &lt;a href=&quot;https://zachholman.com/talk/utc-is-enough-for-everyone-right&quot;&gt;a calendar is always tricky to build&lt;/a&gt;. Although, on our side, there was a narrow range of use cases that would make it simpler than building a date picker for global usage.&lt;/p&gt;

&lt;p&gt;I started looking for an open-source date picker component that would suit our needs and, since we needed support to a range of dates, there wasn’t easy to find a ready-to-use. I tried at first styling and customizing the date picker from ngx-bootstrap, but the results were suboptimal. One issue that I couldn’t not workaround properly was the &lt;a href=&quot;https://github.com/valor-software/ngx-bootstrap/issues/2810&quot;&gt;double-tap to select a date&lt;/a&gt; on iOS. The suggestion proposed on the GH issue isn’t ideal, as it changes a private* method of this component. I made enough changes to make this component mobile-ready to our use case and left it aside. It would have been great if I could only change the theme without having to replace the implementation, and that’s why I choose to first give our (at the moment) current one a chance.&lt;/p&gt;

&lt;p&gt;My second approach was looking at Angular Material components. They offer a date picker, however without range selection support, as of now. They are planning to release a date picker with range selection at the end of Q1/2020. I couldn’t wait and soon dropped the idea.&lt;/p&gt;

&lt;p&gt;The third library that I tried out was &lt;a href=&quot;https://flatpickr.js.org/&quot;&gt;flatpickr&lt;/a&gt;, that offers a lightweight date picker written in JavaScript. I approach this solution the same way I did with ngx-bootstrap date picker. Since this component is not an Angular component, it was needed to create a wrapper for it, instantiate it and display it inside of modal (CdkOverlay). I still needed to create directives to open it from any element and an input date picker for it. As soon as I got a working solution, I left it aside to go further with another attempt.&lt;/p&gt;

&lt;p&gt;All these three approaches with the off-the-shelf solutions were my fallback. I would invest the time that I had remaining to build a custom one, that was agreed upon within the team.&lt;/p&gt;

&lt;p&gt;Now, when you decide to build a custom component, you have the freedom to build it as you desire. If that in mind, I started evaluating different calendar approaches from other developers and teams. The first attempt was to build an infinite scrolling calendar like the experience iOS gives you with the calendar on the iPhone. I got inspired by this &lt;a href=&quot;http://clauderic.github.io/react-infinite-calendar/#/basic-settings/basic-configuration?_k=k1rmcu&quot;&gt;react-infinite-calendar&lt;/a&gt; and decided to write something similar in Angular.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://material.angular.io/cdk/categories&quot;&gt;Angular CDK&lt;/a&gt; is super handy. They offer solutions both for &lt;a href=&quot;https://material.angular.io/cdk/overlay/overview&quot;&gt;overlay &amp;amp; positioning&lt;/a&gt; and &lt;a href=&quot;https://material.angular.io/cdk/scrolling/overview&quot;&gt;virtual scrolling&lt;/a&gt;. It was enough to start building custom calendar #1 using Angular CDK solutions.&lt;/p&gt;

&lt;p&gt;I built a similar calendar and got an huge help from &lt;a href=&quot;https://indepth.dev/writing-custom-virtual-scroll-strategy/&quot;&gt;this article&lt;/a&gt; to make it possible. I tried first with the ready-to-use solution from CDK and later had to write a custom strategy for virtual scrolling. Both approaches gave suboptimal results on mobile (Samsung Galaxy A6+ as base device for testing). The main issue was that the virtual scrolling expects you to inform the size of the item in the list. It should be fixed. What happens is that we don’t have regular month sizes in our calendar and the count of weeks (consequently rows) changes from one month to another. Even with the custom strategy, where I would set dynamically the size of the content, I couldn’t make it work properly on mobile. Although this is something that I want to look at with more time in the near future, I decided to drop this idea for the current problem we are trying to solve: a mobile-ready date picker.&lt;/p&gt;

&lt;p&gt;The final solution was building a custom date picker with the regular side-by-side month calendar. It works great. It’s fast, I’m not using any third-party library (looking at you Moment) to generate the calendar. Basically, it’s a pure Angular component. I’m going to give a brief description of its features, built according to our expectations and requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single and range selection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to be able to select one date or a range of dates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Date limits&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to be able to set a minimum and maximum selectable date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Custom ranges&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to be able to select a custom range of dates by clicking on a shortcut button (last 7 days).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week starts at…&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We must be able to define the week starting date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Must be localized&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We must offer it both in German and English. Used Angular Locales and its handy date functions to do it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inline on desktop, fullscreen on mobile&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you tried to select a date on a date picker built for desktop only, on a mobile device? If so, you get this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calendar, input component, directives, and ControlValueAssessor&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You know, everything you expect from a form element in an Angular application.&lt;/p&gt;

&lt;p&gt;Although I said at the beginning of this post that building calendars are never an easy task, it can become easier when you narrow your requirements to the real use cases of your product. Does this custom component work for every product? No. Does it cover everything such as the ngx-bootstrap or the flatpickr components? No. Does it support 25+ languages? No. Does it manipulate time, intervals and timezone? No, thank god. And it’s fine.&lt;/p&gt;

&lt;p&gt;The problems with working with dates are always the exceptions that we need to be aware of, especially when manipulating dates and working with timezone. All these issues were, fortunately, not in the scenarios of the component I built. I need a calendar that works from 2010 to 2030, and that’s all. That’s what simplified the things during this process.&lt;/p&gt;

&lt;p&gt;In the past, I was always more inclined to use ready-to-use libraries of components instead of building custom ones. Since a couple of years ago, this line of thought changed. The main reason that changed my mind, is that I believe we shouldn’t get used to the chaos. We shouldn’t get used to picking solutions that are not ideal, for the simple reason that they are ready, would save your time. The cost of having an unhappy user is way higher than the time investing in building something that they are going to love to use. Don’t let your UI staying in the way of a user that wants to achieve a task just for the sake of releasing it fast.&lt;/p&gt;

&lt;p&gt;In the end, there are two reasons people are going to use your web app: spend and saving time. As a software engineer, unless you are working in the entertainment industry (hey Netflix), your ultimate goal is to save people’s time.&lt;/p&gt;

&lt;p&gt;(*) JavaScript has no real private methods, they are always accessible, but it’s a bad practice changing it. I mean, they are private for a reason, right?&lt;/p&gt;
</description>
        <pubDate>Mon, 09 Mar 2020 17:33:00 +0000</pubDate>
        <link>https://salvagni.dev//2020/03/09/the-sweet-road-of-building-a-custom-date-picker.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2020/03/09/the-sweet-road-of-building-a-custom-date-picker.html</guid>
        
        <category>Javascript</category>
        
        <category>Angular</category>
        
        <category>Typescript</category>
        
        
        <category>Frontend</category>
        
      </item>
    
      <item>
        <title>Business Strategy: Case Study Analysis of Starbucks’ Competitive Advantage</title>
        <description>&lt;p&gt;As I mentioned in a previous post, &lt;a href=&quot;https://dsalvagni.com.br/2019/09/business-strategy-case-study-analysis/&quot;&gt;Business Strategy: Soft-drinks Industry Analysis&lt;/a&gt;, I’m taking the fifth course, called &lt;a href=&quot;https://www.coursera.org/learn/strategy-business&quot;&gt;Business Strategy&lt;/a&gt;, of &lt;a href=&quot;https://www.coursera.org/specializations/strategic-leadership&quot;&gt;Strategic Leadership and Management Specialization&lt;/a&gt; from the University of Illinois on Coursera. This course is taught by &lt;a href=&quot;https://www.coursera.org/instructor/deepak-somaya&quot;&gt;Deepak Somaya&lt;/a&gt;, Professor of Business Administration.&lt;/p&gt;

&lt;p&gt;This is a four-module course, one module per week, and at the end of each module, we have an assessment: to write a case study analysis about a given topic. In the first week, I had to write a hypothetical memo to the CEO of Uber, suggesting a new mission statement. In the second week, I had to write a hypothetical memo to Warren Buffet to suggest to increase or decrease the investments on Coca-Cola Company. Now, in the third week, I had to answer two questions about the internal competitive advantage of Starbucks.&lt;/p&gt;

&lt;p&gt;These assignments demand a couple of hours to get it done, due to the amount of information and analysis that is needed. However, it gives you amazing insights while analyzing real cases and practicing what you just learned.&lt;/p&gt;

&lt;h1 id=&quot;assignment&quot;&gt;Assignment&lt;/h1&gt;

&lt;p&gt;Write a memo to the Starbucks CEO with an internal analysis of the competitive advantage of Starbucks. Include a brief activity analysis (based on either a value chain or value network approach) and/or a resources and capabilities analysis to clearly highlight two key issues for the CEO:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;What main internal features/ strengths (sets of activities or resources/capabilities) is Starbucks’ competitive advantage built on?&lt;/li&gt;
  &lt;li&gt;What barriers to imitation (or replication) exist that will ensure that Starbucks’ competitive advantage will be sustained in the long run?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Date:&lt;/strong&gt; 01.11.2019&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To:&lt;/strong&gt; Kevin Johnson&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From:&lt;/strong&gt; Daniel Salvagni&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subject:&lt;/strong&gt; Starbucks Competitive Advantage Analysis&lt;/p&gt;

&lt;p&gt;The purpose of this memo is to analyze the main sets of activities, resources, and capabilities that give Starbucks a competitive advantage. In a second moment, evaluate the actions Starbucks takes to avoid imitation and replication aiming for sustained competitive advantage.&lt;/p&gt;

&lt;p&gt;Starbucks’ main product is the experience of drinking a good quality coffee in a place where the customer hangs out with friends and family. It’s a coffee shop, also know now as the &lt;em&gt;third place&lt;/em&gt;, apart from home and work. It started in 1987 with one coffee shop in Seattle, emerged from the U.S. west-coast Italian-style dark roasting tradition, to grow to 24.000 shops in 2014.&lt;/p&gt;

&lt;p&gt;Quality coffee production depends on different factors, from growing the brewing, such as the variety, the region where it’s grown, how it’s roasted, grounded and packed, and blended and served. Starbucks covers every single step from this value chain. Starbucks controls the quality from the coffee beans at the farmer level, how they dry the coffee and the logistics until it gets to the coffee shops. It also guarantees that almost 100% percent of the coffee is ethics-sourced.&lt;/p&gt;

&lt;p&gt;At the other end, Starbucks ensures that its human-capital resources are well-trained and well-paid, rewarded and have the chance to grow within the company. This is confirmed when comparing the turnover rate of baristas from Starbucks to its competitors.&lt;/p&gt;

&lt;p&gt;Nevertheless, the sources of competitive advantage we find in Starbucks can be explained by its own history, small events in cultural behavior that introduced coffee as an affordable luxury, strategic choices and, well, a bit of chance.&lt;/p&gt;

&lt;p&gt;Starbucks history is unique and can be traced back to a tradition, which means that the coffee served in a coffee shop is a result of an intrinsic knowledge that started in the early stages and it’s spread all over the company. Besides, Starbucks was able since the beginning to produce quality coffee and, over the years, enhanced its process and made it scalable worldwide. Besides, a mix of chance, changes in cultural behavior of coffee consumption, and managerial foresight that saw, for example, in the tv show &lt;em&gt;Friends&lt;/em&gt;, this trend happening, allowed the company to grow exponentially.&lt;/p&gt;

&lt;p&gt;Moreover, Starbucks has technological resources to ensure that the roaster machines will roast the coffee precisely as required. It has the know-how to repeatedly produce and serve the best coffee. Besides, it enjoys a product reputation and brand loyalty in its relationship with the consumers.&lt;/p&gt;

&lt;p&gt;In summary, Starbucks has a competitive advantage in the capability to add value while creating an experience for the consumers in the coffee shops. Besides, he know-how to offer quality coffee on a worldwide scale isn’t commonly available to other firms.&lt;/p&gt;

&lt;p&gt;By having a unique history, Starbucks also has a tacit knowledge within the firm about all their processes, which gives the firm an outstanding barrier for imitation or replication. It’s not clear, from outside, from where the company performances come from since the beginning, the starting point. Besides that, its complexes process of combined activities to ensure quality in a value chain are, in theory, inimitable. Finally, the human-capital management ensures that the company doesn’t lose talented workers to the competition. All these factors combined allow Starbucks to have a long-lasting sustained competitive advantage.&lt;/p&gt;

&lt;p&gt;Although the firm has all the attributes to keep on going for a sustained competitive advantage, durability and relevance might be a threat for the future. How can Starbucks keep coffee as relevant as it’s nowadays? It might not depend only on the firms’ actions, but also, again, on whether or not this cultural behavior may change. Besides, how long can Starbucks keep the activities and resources aligned and combined to deliver the best product? Again, it might not depend exclusively on the firm’s actions. Local regulations might change for farmers adding barriers in the supply chain of the firm.&lt;/p&gt;

&lt;p&gt;Nevertheless, Starbucks will have the necessary knowledge to overcome the threats of durability and relevance and when faced.&lt;/p&gt;
</description>
        <pubDate>Sat, 09 Nov 2019 13:15:00 +0000</pubDate>
        <link>https://salvagni.dev//2019/11/09/business-strategy-case-study-analysis-of-starbucks.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2019/11/09/business-strategy-case-study-analysis-of-starbucks.html</guid>
        
        
        <category>Business Strategy</category>
        
        <category>Industry Analysis</category>
        
      </item>
    
      <item>
        <title>Business Strategy: Soft-drinks Industry Analysis</title>
        <description>&lt;p&gt;I’m taking the fifth course, called &lt;a href=&quot;https://www.coursera.org/learn/strategy-business&quot;&gt;Business Strategy&lt;/a&gt;, of &lt;a href=&quot;https://www.coursera.org/specializations/strategic-leadership&quot;&gt;Strategic Leadership and Management Specialization&lt;/a&gt; from the University of Illinois on Coursera. This course is taught by &lt;a href=&quot;https://www.coursera.org/instructor/deepak-somaya&quot;&gt;Deepak Somaya&lt;/a&gt;, Professor of Business Administration. This is a four-module course, one module per week, and at the end of each module, we have an assessment: to write a case study analysis about a given topic.&lt;/p&gt;

&lt;p&gt;In the first week, I had to write a hypothetical memo to the CEO of Uber, suggesting a new mission statement. The second week, that I just finished, I had to write a hypothetical memo to Warren Buffet to suggest to increase or decrease the investments on Coca-Cola Company. Both assignments were hard to write and demand a considerable amount of time to get it done, and, the first one I couldn’t get it right in the first attempt and had to resubmit my assignment. For the second one, I’m now waiting for a review of my peers. Anyway, I think it would be good to share it here to gather some feedback if it might occur.&lt;/p&gt;

&lt;h1 id=&quot;assignment&quot;&gt;Assignment&lt;/h1&gt;

&lt;p&gt;Write a memo to Warren Buffet — the billionaire investor and Chairman of Berkshire Hathaway -and make a recommendation on whether he should increase or decrease his investment in CocaCola (Berkshire Hathaway currently holds a little under 10% of Coca Cola’s stock). Within the memo please conduct a short industry analysis of the soft drink industry using the 5-Forcesframework. Based on this analysis provide your evaluation of how profitable (relative to other industries) you think the soft drink industry will be in the medium term (say the next 5–10 years).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Date:&lt;/strong&gt; 19.09.2019
&lt;strong&gt;To:&lt;/strong&gt; Warren Buffet
&lt;strong&gt;From:&lt;/strong&gt; Daniel Salvagni
&lt;strong&gt;Subject:&lt;/strong&gt; Soft-drinks Industry Analysis&lt;/p&gt;

&lt;p&gt;The purpose of this report is to analyze the current market share from Coca-Cola and the industry trends, evaluating the impact of the five forces in the industry.&lt;/p&gt;

&lt;h2 id=&quot;industry-analysis-and-trends-in-the-industry-and-consumers-behavior&quot;&gt;Industry Analysis and Trends in the Industry and Consumers’ Behavior&lt;/h2&gt;

&lt;p&gt;The market share for non-alcoholic beverages is dominated mainly by Coca-Cola and Pepsico, which, together, holds 60% percent of the world’s market. According to the article from Investopedia¹, Coca-Cola is responsible for 40% and, consequently, 20% is under Pepsico domain.&lt;/p&gt;

&lt;p&gt;The habits and behaviors of soft-drinks consumer have changed in recent years due to two main reasons: Change of consumers-lifestyle that prefer healthy and environmentally conscious brands; and the rise of substitute products, such as juices and bottled water.&lt;/p&gt;

&lt;h2 id=&quot;competitive-rivalry&quot;&gt;Competitive rivalry&lt;/h2&gt;

&lt;p&gt;However, lately, Coca-Cola is underperforming in Wall-Street in comparison with PepsiCo². In the last five years, PepsiCo has grown almost double more than Coca-Cola. In fact, both companies had underperformed which might be a sign of a change in the industry, although, Coca-Cola still holds the sixth position in the rank of the most valuable brands.&lt;/p&gt;

&lt;h2 id=&quot;bargain-power-of-customers&quot;&gt;Bargain Power of Customers&lt;/h2&gt;

&lt;p&gt;Consumers in the age from 18–34 years old, also known as the Millenials generation, are engaged in different values than the previous generation, the Generation X and Baby Boomers. While targeting Millenials, the markets must consider a change in what the audience would expect from the company and the product. This generation would value more the impact on health and in the environment in spite of the brand of the product. Which means that branding and quality products are not enough for this generation.&lt;/p&gt;

&lt;h2 id=&quot;threats-of-substitutes&quot;&gt;Threats of Substitutes&lt;/h2&gt;

&lt;p&gt;The trends in the industry and consume includes the seek for innovation. Millennials like to try new products and they would spend more doing so³. Moreover, this trend includes social awarenesses and health consciousness and the main factors to decide which product to buy³. Finally, Millennials are drinking less alcoholic beverages⁴ and the market shows a grown in the sales of non-alcoholic beverages.&lt;/p&gt;

&lt;p&gt;To conclude, a beverage company to succeed in this new scenario must offer a diversity of healthy beverages along with a social and environmental consciousness. Those would be substitutes to regular carbonated soft drinks.&lt;/p&gt;

&lt;h2 id=&quot;threats-of-new-entrants&quot;&gt;Threats of New Entrants&lt;/h2&gt;

&lt;p&gt;Every country has its regulations in regards to the beverage industry, which suggests that there’s not a global regulation barrier for new entrants, besides capital to invest, obviously. Although, with the mentioned trends in the industry, millennials⁵ are constantly in seek for authenticity, and authenticity is a huge change, according to Andrew Geoghegan, Diageo’s global consumer planning director.&lt;/p&gt;

&lt;p&gt;This particular trend is a threat for big corporations as Coca-Cola once consumer behavior is shifting to look and choose for local producers over big brands. An immediate consequence is that supermarkets⁵, aware of the trend, gives now more space in the shelf for small brands.&lt;/p&gt;

&lt;p&gt;Along with the new habits of consumption, the rise of small brands is threating big corporations.n Even though they are not currently competitors, they might become in the future if Coca-Cola does not act fast to this movement.&lt;/p&gt;

&lt;h2 id=&quot;bargaining-power-of-suppliers&quot;&gt;Bargaining power of suppliers&lt;/h2&gt;

&lt;p&gt;Should Coca-Cola shift the target and focus on the desires of this new generation, it must reevaluate its supply chains at least partially. Since Millennials want to know the origin of the ingredients and also would definitely choose the brand that uses ethical and healthy ingredients.&lt;/p&gt;

&lt;p&gt;This trends might turn the alert lights on in regards on suppliers of such ingredients, although it should be fine while Coca-Cola has its supply chain under control for most of its products.&lt;/p&gt;

&lt;h2 id=&quot;what-to-expect-for-the-next-years&quot;&gt;What to expect for the next years&lt;/h2&gt;

&lt;p&gt;There’s no way we can predict the future, however, with enough information and the understanding of the trends in industry and consumption behaviors, we can prepare ourselves to act and react fast to the environment changes.&lt;/p&gt;

&lt;p&gt;It’s important to note that even in developed markets, such US, these changes are not happening so quickly⁵ according to Jorge Paulo Lemann, the Brazilian investor behind both AB InBev and 3G Capital. And, besides it’s clear the grew of small business towards this market, they are not Coca-Cola competitors. In reality, it’s a good thing to have new entrepreneurs in the market to test the trends before big brands dive into it.&lt;/p&gt;

&lt;p&gt;Finally, Coca-Cola still has the potential for more investment, and, as a solid and well established in the market, would react with no time and efficiently to the market changes. Even though the net revenue has dropped in the past year, it was not related to the new trends in the industry as we can see that the organic revenue grew 5% in the same period⁶.&lt;/p&gt;

&lt;p&gt;The soft drinks industry is changing and, although it sounds like threats, it also shines as opportunities. Coca-Cola Company have a strong base and can take advantage of these opportunities in the market to increase the revenue in the next five to ten years, at least.&lt;/p&gt;

&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;

&lt;p&gt;¹ Much of the Global Beverage Industry Is Controlled by Coca Cola and Pepsi &lt;a href=&quot;https://www.investopedia.com/ask/answers/060415/how-much-global-beverage-industry-controlled-coca-cola-and-pepsi.asp&quot;&gt;https://www.investopedia.com/ask/answers/060415/how-much-global-beverage-industry-controlled-coca-cola-and-pepsi.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;² Pepsi Beats Coke, Again &lt;a href=&quot;https://www.forbes.com/sites/panosmourdoukoutas/2019/07/13/pepsi-beats-coke-again/#4eba1d0f2bad&quot;&gt;https://www.forbes.com/sites/panosmourdoukoutas/2019/07/13/pepsi-beats-coke-again/#4eba1d0f2bad&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;³ Millennials think before they drink: fewer rounds, less carbs, more variety &lt;a href=&quot;https://www.nielsen.com/nz/en/insights/article/2017/millennials-think-before-they-drink-fewer-rounds-less-carbs-more-variety/&quot;&gt;https://www.nielsen.com/nz/en/insights/article/2017/millennials-think-before-they-drink-fewer-rounds-less-carbs-more-variety/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⁴ Sales of nonalcoholic booze are on the rise — and it reveals a dark truth about social-media surveillance culture &lt;a href=&quot;https://www.businessinsider.de/millennials-gen-z-drinks-less-drags-down-alcohol-sales-2019-2?r=US&amp;amp;IR=T&quot;&gt;https://www.businessinsider.de/millennials-gen-z-drinks-less-drags-down-alcohol-sales-2019-2?r=US&amp;amp;IR=T&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⁵ How millennials’ taste for ‘authenticity’ is disrupting powerful food brands &lt;a href=&quot;https://www.ft.com/content/09271178-6f29-11e8-92d3-6c13e5c92914&quot;&gt;https://www.ft.com/content/09271178-6f29-11e8-92d3-6c13e5c92914&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⁶ Coca-Cola Reports Strong Results for Fourth Quarter and Full Year 2018 &lt;a href=&quot;https://www.coca-colacompany.com/press-center/press-releases/coca-cola-reports-strong-results-for-fourth-quarter-and-full-year-2018&quot;&gt;https://www.coca-colacompany.com/press-center/press-releases/coca-cola-reports-strong-results-for-fourth-quarter-and-full-year-2018&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 19 Sep 2019 14:15:00 +0000</pubDate>
        <link>https://salvagni.dev//2019/09/19/business-strategy-soft-drinks-industry-analysis.html</link>
        <guid isPermaLink="true">https://salvagni.dev//2019/09/19/business-strategy-soft-drinks-industry-analysis.html</guid>
        
        
        <category>Business Strategy</category>
        
        <category>Industry Analysis</category>
        
      </item>
    
  </channel>
</rss>
