<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/public/pretty-feed-v3.xls"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>ar-at-localhost’s Blog</title><description>Full stack development guides and stories</description><link>https://ar-at-localhost.site/</link><item><title>ar-at-localhost Blog</title><link>https://ar-at-localhost.site/blog/introducing-blog/</link><guid isPermaLink="true">https://ar-at-localhost.site/blog/introducing-blog/</guid><description>Introducing my personal blog on ar-at-localhost!</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Hi everyone, you’re reading the very first post on my blog. With this post, my personal project
&amp;lt;b&amp;gt;ar-at-localhost&amp;lt;/b&amp;gt; officially gets a blog of its own.&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;
Subscribe to my blog to stay updated on my project, personal experiences and
other tech-related authoring.
&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;Thank you for stopping by!&lt;/p&gt;
</content:encoded></item><item><title>Lovely code of the week – 48/2026</title><link>https://ar-at-localhost.site/blog/love-code-of-the-week-24/</link><guid isPermaLink="true">https://ar-at-localhost.site/blog/love-code-of-the-week-24/</guid><description>Introducing my personal blog on ar-at-localhost!</description><pubDate>Sat, 21 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Happy weekend, programmers!&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I did a lot of stuff on the &amp;lt;code&amp;gt;ar-at-localhost&amp;lt;/code&amp;gt; project this week.
Here’s a lovely piece of code from this week.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;b&amp;gt;TL;DR:&amp;lt;/b&amp;gt; Objects make nice, lightweight maps. Paired with sensible fallbacks, they
offer a clean and elegant solution without the overhead of a &amp;lt;code&amp;gt;Map&amp;lt;/code&amp;gt;.&lt;/p&gt;
&lt;h2&gt;Problem&lt;/h2&gt;
&lt;p&gt;&amp;lt;p&amp;gt;I’ve introduced keys where users may manage a set of keys used in their operations. We need
to allow users to update them as necessary. Since most of them are secret, users should see
them as passwords—but may turn on view to see them as plain values. The quirk is that we have several
keys, not just one.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;h2&gt;Solution&lt;/h2&gt;
&lt;p&gt;&amp;lt;br /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;At first glance, I thought of a map to store the current state of the field, but a map can be too
noisy with its &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;has&amp;lt;/code&amp;gt;, etc – so I turned to an
object as a map (indeed a Map is an object) and let missing keys be treated as hidden, as it would
be the default. Then I added a function to rotate them.&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;br /&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;script lang=&quot;ts&quot;&amp;gt;
  // ...
  const fieldTypes = $state&amp;lt;
    { [key: string]: &apos;password&apos; | &apos;text&apos; }
  &amp;gt;({}); // notice empty {}

  const onview = (key: string) =&amp;gt;
    fieldTypes[key] = fieldTypes[key] === &apos;text&apos;
      ? &apos;password&apos;
      : &apos;text&apos;;
  // ...
&amp;lt;/script&amp;gt;

{#each userKeys.values() as key,idx}
  &amp;lt;!-- ... --&amp;gt;
  &amp;lt;InputGroupButton onclick={() =&amp;gt; onview(key)}&amp;gt;
    {#if fieldTypes[key] === &apos;text&apos;}
      &amp;lt;EyeOff /&amp;gt;
    {:else}
      &amp;lt;Eye /&amp;gt;
    {/if}
  &amp;lt;/InputGroupButton&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
{/each}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item></channel></rss>