<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vojta Struhár on Medium]]></title>
        <description><![CDATA[Stories by Vojta Struhár on Medium]]></description>
        <link>https://medium.com/@vojtechstruhar?source=rss-a61bbfb015ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-DxQbxsLyn3MW1Xyda1dmg.jpeg</url>
            <title>Stories by Vojta Struhár on Medium</title>
            <link>https://medium.com/@vojtechstruhar?source=rss-a61bbfb015ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:07:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vojtechstruhar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Weird programming operators 2: Scream and Yolo operators + bonus]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/weird-programming-operators-2-scream-and-yolo-operators-bonus-7a60241a13b6?source=rss-a61bbfb015ef------2"><img src="https://cdn-images-1.medium.com/max/600/1*eAOEmwLz8wh_MH3JYdtVsw.jpeg" width="600"></a></p><p class="medium-feed-snippet">When programmers run out of character combinations, sometimes weird things happen. Let&apos;s continue exploring the world of strange operators!</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/weird-programming-operators-2-scream-and-yolo-operators-bonus-7a60241a13b6?source=rss-a61bbfb015ef------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/weird-programming-operators-2-scream-and-yolo-operators-bonus-7a60241a13b6?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a60241a13b6</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 17:39:01 GMT</pubDate>
            <atom:updated>2024-01-08T17:39:01.910Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Leetcode 202 — Happy Number]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://vojtechstruhar.medium.com/leetcode-202-happy-number-64d1082b7e76?source=rss-a61bbfb015ef------2"><img src="https://cdn-images-1.medium.com/max/1792/1*fiaVEQkcdJ3G0U-id58Kmw.png" width="1792"></a></p><p class="medium-feed-snippet">STOP stringifying numbers just to process the individual digits. Please, for the love of God.</p><p class="medium-feed-link"><a href="https://vojtechstruhar.medium.com/leetcode-202-happy-number-64d1082b7e76?source=rss-a61bbfb015ef------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://vojtechstruhar.medium.com/leetcode-202-happy-number-64d1082b7e76?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/64d1082b7e76</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Wed, 27 Dec 2023 12:59:28 GMT</pubDate>
            <atom:updated>2023-12-27T12:59:28.715Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Convert python object into a dictionary]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/convert-python-object-into-a-dictionary-26784a12bb14?source=rss-a61bbfb015ef------2"><img src="https://cdn-images-1.medium.com/max/1920/1*nrkrljRMQ37--h6WypGuIw.jpeg" width="1920"></a></p><p class="medium-feed-snippet">Turning dictionaries into python classes with the **kwargs syntax is pretty common. This is how to go the other way around.</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/convert-python-object-into-a-dictionary-26784a12bb14?source=rss-a61bbfb015ef------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/convert-python-object-into-a-dictionary-26784a12bb14?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/26784a12bb14</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 21:24:36 GMT</pubDate>
            <atom:updated>2023-12-22T16:35:21.410Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Reverse sort items with a numeric string key]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://vojtechstruhar.medium.com/reverse-sort-items-with-a-numeric-string-key-7d0f013b398c?source=rss-a61bbfb015ef------2"><img src="https://cdn-images-1.medium.com/max/2280/1*0yexq7d6ZUg9onviuMS5jQ.jpeg" width="2280"></a></p><p class="medium-feed-snippet">How to sort numbers that you have to convert to strings&#x200A;&#x2014;&#x200A;in reverse?!</p><p class="medium-feed-link"><a href="https://vojtechstruhar.medium.com/reverse-sort-items-with-a-numeric-string-key-7d0f013b398c?source=rss-a61bbfb015ef------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://vojtechstruhar.medium.com/reverse-sort-items-with-a-numeric-string-key-7d0f013b398c?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d0f013b398c</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[godot]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Fri, 15 Dec 2023 07:22:14 GMT</pubDate>
            <atom:updated>2023-12-15T07:22:14.597Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Kill a process that listens on a port]]></title>
            <link>https://vojtechstruhar.medium.com/terminate-a-process-that-listens-on-a-port-e02341b36059?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/e02341b36059</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[bash]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Thu, 07 Dec 2023 22:05:02 GMT</pubDate>
            <atom:updated>2023-12-11T11:24:43.194Z</atom:updated>
            <content:encoded><![CDATA[<h4>You forgot to shut down a development server, and now it’s running in the background, taking up your favorite port. Terminate it mercilessly.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Mdfbp5IShhS4boM65NfRw.png" /></figure><p>You’ve started a development server on your favorite :8080 localhost port and closed your IDE. But the server is still running in the background and if you try to start a new one, you get a message similar to this:</p><pre>ERROR: listen tcp :8080: bind: address already in use</pre><p>Yeah, me too. Let’s track it down and kill it for good.</p><h3>List process listening on a port</h3><pre>lsof -i:8080</pre><p>For me, this yields this result:</p><pre>COMMAND   PID           USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME<br>main    65536 vojtechstruhar    3u  IPv6 0xd9effee8308abdb      0t0  TCP *:http-alt (LISTEN)</pre><p>See the PID column? That what we&#39;re after. Copy this process id number and terminate it:</p><pre>kill 65536</pre><p>If this doesn’t help, you can add the -9 flag, so that the process is forcibly terminated.</p><h3>Shorthand</h3><p>You can use the -t flag for the lsof command, so that only the PID of the process is printed. We can use this in a beautiful one-liner:</p><pre>kill -9 $(lsof -t -i:8080)</pre><p>If you find yourself doing this often, I’d say create a helper function in your .bashrc or similar:</p><pre>function portkill {<br>	if [ &quot;$#&quot; -lt 1 ]; then<br>		echo &quot;Supply a port to kill as a first argument.&quot;<br>		return 1<br>	fi<br>	<br>	echo &quot;Killing process on port $1&quot;<br>	kill -9 $(lsof -t -i:$1)<br>}</pre><p>Now that this function is available to you in your shell by default, just call portkill 8080 and you are good to go :)</p><p><em>Originally published at </em><a href="https://www.vojtechstruhar.com/blog/kill-process-listening-on-port"><em>https://www.vojtechstruhar.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e02341b36059" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add Vercel Analytics to Your Astro Website!]]></title>
            <link>https://vojtechstruhar.medium.com/add-vercel-analytics-to-your-astro-website-326e60958817?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/326e60958817</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vercel]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 07:48:51 GMT</pubDate>
            <atom:updated>2023-10-25T07:48:51.257Z</atom:updated>
            <content:encoded><![CDATA[<h4>Although Vercel&#39;s main focus is <em>Next.js</em> — a React framework, they are generally very friendly to other projects. Their analytics can be used even in a static site like Astro!</h4><blockquote>I use Astro in its default SSG mode. But this will definitely work with server side rendering too!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*vF0vNTcv_UW-kxyNJ0IMxw.png" /></figure><h3>1. Enable analytics on your Vercel project</h3><p>Go to <a href="https://vercel.com/dashboard">vercel.com</a> and in the header of your project overview, click the little Analytics tab. You can enable your analytics there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*eY_xIzsPTNaC-hdz7OXPzg.png" /></figure><p>There are limits on the amount of data that can be logged for free. I&#39;m of course on the <em>Hobby</em> tier, but I think this limit is plenty for my little personal website!</p><h3>2. Install their analytics package</h3><p>In your Astro project, install the vercel analytics package like you would any other.</p><pre>pnpm i @vercel/analytics</pre><h3>3. Run analytics on your pages</h3><p>Astro ships zero javascript by default. But you can explicitly include a script as HTML tag and it will work just fine!</p><p>I&#39;ve put the following snippet into my root Layout.astro, which wraps all pages on my website. <strong>This way all pages are tracked!</strong> If you want to have analytics only for certain routes, add the snippet only there. But I generally think putting it in a layout component is a good idea.</p><pre>&lt;script&gt;<br>    import { inject } from &quot;@vercel/analytics&quot;;<br>    inject()<br>&lt;/script&gt;</pre><p>It’s that simple!</p><blockquote>Note, that you have to import the function within the script tag itself. If you import it in the Astro frontmatter, the html won’t see it!</blockquote><h3>Don’t worry about the javascript cost</h3><p>This script is absolutely tiny — it weights in at just <strong>~1.1kB</strong> of javascript. Your users are not going to notice that. Smooth sailing!</p><p><em>Thanks for reading! ❤️ If you&#39;d like to read more web development related tips, consider following!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=326e60958817" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The New Hipster Browser — Arc for MacOS]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/macoclock/the-new-hipster-browser-arc-for-macos-d1868670438f?source=rss-a61bbfb015ef------2"><img src="https://cdn-images-1.medium.com/max/2560/1*Apx9vvdlIT5km3KFubLOOw.png" width="2560"></a></p><p class="medium-feed-snippet">This feels like a browser Apple should have made.</p><p class="medium-feed-link"><a href="https://medium.com/macoclock/the-new-hipster-browser-arc-for-macos-d1868670438f?source=rss-a61bbfb015ef------2">Continue reading on Mac O’Clock »</a></p></div>]]></description>
            <link>https://medium.com/macoclock/the-new-hipster-browser-arc-for-macos-d1868670438f?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1868670438f</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[browsers]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 18:50:26 GMT</pubDate>
            <atom:updated>2023-06-28T09:49:43.652Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Weird programming operators: Elvis, Walrus, Spaceship, and Turbofish!]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/weird-programming-operators-elvis-walrus-spaceship-and-turbofish-95c6d04af0d0?source=rss-a61bbfb015ef------2"><img src="https://cdn-images-1.medium.com/max/1024/1*ujPoz8oOTINzDAU1rbakRQ.jpeg" width="1024"></a></p><p class="medium-feed-snippet">Programmers are really ingenious fellows who love coming up with weird names.</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/weird-programming-operators-elvis-walrus-spaceship-and-turbofish-95c6d04af0d0?source=rss-a61bbfb015ef------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/weird-programming-operators-elvis-walrus-spaceship-and-turbofish-95c6d04af0d0?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/95c6d04af0d0</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 16:06:19 GMT</pubDate>
            <atom:updated>2023-03-14T17:59:00.570Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Bootstrap with Tailwind?! Welcome RippleUI]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://javascript.plainenglish.io/bootstrap-with-tailwind-welcome-rippleui-ab4f19963e27?source=rss-a61bbfb015ef------2"><img src="https://cdn-images-1.medium.com/max/1646/1*ZTDv760-GaTvBumts5C5QA.png" width="1646"></a></p><p class="medium-feed-snippet">Do you ever get that feeling when you reach someplace totally new, that somehow you&apos;ve been there before?</p><p class="medium-feed-link"><a href="https://javascript.plainenglish.io/bootstrap-with-tailwind-welcome-rippleui-ab4f19963e27?source=rss-a61bbfb015ef------2">Continue reading on JavaScript in Plain English »</a></p></div>]]></description>
            <link>https://javascript.plainenglish.io/bootstrap-with-tailwind-welcome-rippleui-ab4f19963e27?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab4f19963e27</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 10:39:24 GMT</pubDate>
            <atom:updated>2023-03-06T18:01:07.856Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[My custom Mac emoji shortcuts]]></title>
            <link>https://vojtechstruhar.medium.com/custom-emoji-shortcuts-on-macos-a76263a4c748?source=rss-a61bbfb015ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/a76263a4c748</guid>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[shortcuts]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[emoji]]></category>
            <dc:creator><![CDATA[Vojta Struhár]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 19:30:20 GMT</pubDate>
            <atom:updated>2023-02-22T07:41:49.714Z</atom:updated>
            <content:encoded><![CDATA[<h4>Apple is well known for its emojis and they do a good job supporting them on Macs. Here I want to show you how I keep my favorites at hand.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*2FxD6rhw5v-BwKrHmfthJA.png" /><figcaption>This is what I’m trying to achieve</figcaption></figure><p>You can always press Ctrl + Cmd + Space to access their <em>Character Viewer</em>. But after that, you have to find your emoji and <strong>click it</strong>. That bothers me the most since I have to take my hands off the keyboard, which just <strong>slows me down</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*rGz-cYG78trcMpIGFc2YyQ.png" /><figcaption>Big and slow character viewer</figcaption></figure><p>A better solution is an emoji autocomplete that you can commonly find in apps like Telegram or Discord. Even Medium uses it! All I have to do for this “😂” emoji, is to start typing :joy!</p><p>Can we achieve a similar result in all scenarios? Kind of.</p><h3>MacOS&#39; Text Replacement is a great feature</h3><p>Apple devices have this feature called “Text Replacement” hidden in their settings (even on iOS). On a Mac, you can find it in <em>System Preferences &gt; Keyboard &gt; Text Replacement</em> (button). You can then set up a table for text that should be replaced!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*Rl5dz5WHEDzifv2v5j4j-A.png" /><figcaption>My own emoji helpers!</figcaption></figure><p>Here you can set up your custom emoji shortcuts and they will <strong>work across your devices!</strong> That&#39;s right, these text replacement rules will sync to your iPhone. I find that quite neat!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*Ysk_ilnlg4d6hEH6fKlNlw.jpeg" /><figcaption>Text replacement is synced to other Apple devices</figcaption></figure><p>Setting up all of the :emoji-name options manually would be quite a lot of work. But I&#39;m sure it would make for a fun little bash script. If you want to see that, <strong>write me a comment!</strong></p><p>Thanks for reading! ❤️</p><p><em>Disclaimer:</em> Some text fields in apps or on the web might explicitly prevent autocomplete. This will not work in password inputs, for example. But I find it worth setting up nevertheless :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a76263a4c748" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>