<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title> - tech</title>
    <link href="https://burg2.maheshbansod.com/tags/tech/atom.xml" rel="self" type="application/atom+xml"/>
    <link href="https://burg2.maheshbansod.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-10-12T20:19:05.071+00:00</updated>
    <id>https://burg2.maheshbansod.com/tags/tech/atom.xml</id>
    <entry xml:lang="en">
        <title>CSS clamp() function</title>
        <published>2025-10-12T20:19:05.071+00:00</published>
        <updated>2025-10-12T20:19:05.071+00:00</updated>
        <author>
          <name>Unknown</name>
        </author>
        <link rel="alternate" href="https://burg2.maheshbansod.com/til/20251012201905-css-clamp-function/" type="text/html"/>
        <id>https://burg2.maheshbansod.com/til/20251012201905-css-clamp-function/</id>
        
        <content type="html">&lt;p&gt;CSS has a clamp function that takes a min value, &amp;quot;preferred&amp;quot; value and a max value.&lt;&#x2F;p&gt;
&lt;p&gt;If the preferred value is between min and max, then the preferred value is returned,
otherwise the output is clamped based on min and max.&lt;&#x2F;p&gt;
&lt;p&gt;I used this recently on the astro rewrite of this blog while setting margin for
my &amp;quot;See all posts&amp;quot; CTA so that it&#x27;s dependent on viewport size such that it never
goes out of the viewport and smoothly goes inside the viewport as we resize.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;css&quot; style=&quot;background-color:#ffffff;color:#323232;&quot; class=&quot;language-css &quot;&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span style=&quot;color:#63a35c;&quot;&gt;margin-right&lt;&#x2F;span&gt;&lt;span&gt;: clamp(-25.5px,calc((900px - 100vw) &#x2F; 2 - 10px),0px);
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ref: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;CSS&#x2F;clamp&quot;&gt;clamp() - CSS | MDN&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>vim &quot;+norm Go&quot; &quot;+startinsert&quot; $filename</title>
        <published>2025-10-07T17:21:17.403+00:00</published>
        <updated>2025-10-07T17:21:17.403+00:00</updated>
        <author>
          <name>Unknown</name>
        </author>
        <link rel="alternate" href="https://burg2.maheshbansod.com/til/20251007172117-vim-norm-go-startinsert-filename/" type="text/html"/>
        <id>https://burg2.maheshbansod.com/til/20251007172117-vim-norm-go-startinsert-filename/</id>
        
        <content type="html">&lt;p&gt;Use the command&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#ffffff;color:#323232;&quot;&gt;&lt;code&gt;&lt;span&gt;vim &amp;quot;+norm Go&amp;quot; &amp;quot;+startinsert&amp;quot; $filename
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;to automatically move at the end of the file and start editing.&lt;&#x2F;p&gt;
&lt;p&gt;This is useful when you are invoking vim from another script i.e. when you
don&#x27;t want this to be the default behaviour but want it in a special case.&lt;&#x2F;p&gt;
&lt;p&gt;For me this was useful for my &lt;code&gt;journal&lt;&#x2F;code&gt; script which appends the current time
at the end of a file and opens the file and (now) automatically moves to the end
and goes to insert mode.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Cool things in Swift</title>
        <published>2025-08-17T07:53:35.279+00:00</published>
        <updated>2025-08-17T07:53:35.279+00:00</updated>
        <author>
          <name>Unknown</name>
        </author>
        <link rel="alternate" href="https://burg2.maheshbansod.com/blog/cool-things-in-swift/" type="text/html"/>
        <id>https://burg2.maheshbansod.com/blog/cool-things-in-swift/</id>
        
        <summary type="html">&lt;p&gt;I recently picked up &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.swift.org&quot;&gt;Swift&lt;&#x2F;a&gt;.
This article is about some of the things in Swift that I thought were cool.
I will probably update this as I come upon more cool stuff, which is bound to
happen as I&#x27;m still starting out.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Making LLMs do what you want</title>
        <published>2025-03-29T19:34:35.193+00:00</published>
        <updated>2025-03-29T19:34:35.193+00:00</updated>
        <author>
          <name>Unknown</name>
        </author>
        <link rel="alternate" href="https://burg2.maheshbansod.com/blog/making-llms-do-what-you-want/" type="text/html"/>
        <id>https://burg2.maheshbansod.com/blog/making-llms-do-what-you-want/</id>
        
        <summary type="html">&lt;p&gt;Tired of spending hours convincing an LLM to just do that one thing?
You have tried lots of different ways to no satisfaction  and yet it
eludes you why it isn&#x27;t able to just do this really simple task? Look
no further! You&#x27;ve reached the place  you&#x27;ll learn the dark arts of 
making any LLM head over heels for you. I have worked with LLMs since 
about two years now and this guide is about what I learnt and how we
can ensure the best prompts while also modifying prompts to accomodate
evolving requirements.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Iterate over Tuple Type in TypeScript without recursion</title>
        <published>2024-12-14T17:09:01.448+00:00</published>
        <updated>2024-12-14T17:09:01.448+00:00</updated>
        <author>
          <name>Unknown</name>
        </author>
        <link rel="alternate" href="https://burg2.maheshbansod.com/blog/iterating-over-tuple-type-in-typescript-without-recursion/" type="text/html"/>
        <id>https://burg2.maheshbansod.com/blog/iterating-over-tuple-type-in-typescript-without-recursion/</id>
        
        <summary type="html">&lt;p&gt;A simple trick to iterate over a tuple in TypeScript without resorting to recursion.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Avoiding assertions in TypeScript</title>
        <published>2023-12-03T15:37:02.169+00:00</published>
        <updated>2023-12-03T15:37:02.169+00:00</updated>
        <author>
          <name>Unknown</name>
        </author>
        <link rel="alternate" href="https://burg2.maheshbansod.com/blog/avoiding-assertions-in-typescript/" type="text/html"/>
        <id>https://burg2.maheshbansod.com/blog/avoiding-assertions-in-typescript/</id>
        
        <summary type="html">&lt;p&gt;Often, when working with Typescript, people tend to go for type assertions to suppress errors. Though that does suppress the immediate error, it is often the case that you&#x27;re causing yourself a pain by not fixing the underlying issue, and exposing yourself to bugs at runtime. The main advantage of Typescript is the types we define, the more accurate they are to reality the less often you&#x27;ll encounter type related bugs in production.The rest of this article is about type assertion, non null assertion, and how to avoid it.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Making your first game</title>
        <published>2020-05-29T14:01:00.169+00:00</published>
        <updated>2020-05-29T14:01:00.169+00:00</updated>
        <author>
          <name>Unknown</name>
        </author>
        <link rel="alternate" href="https://burg2.maheshbansod.com/blog/wp-making-your-first-game/" type="text/html"/>
        <id>https://burg2.maheshbansod.com/blog/wp-making-your-first-game/</id>
        
        <summary type="html">&lt;p&gt;So, you&#x27;ve learnt programming? You&#x27;ve made some easy programs? Maybe even made a few bigger projects? It&#x27;s about time for you guys to start making games. If you don&#x27;t know programming, I encourage you to use google to look for programming tutorials to learn a beginner friendly language like Python. After you&#x27;re done with that, come here again. &lt;&#x2F;p&gt;
&lt;p&gt;This tutorial is aimed at people who are `okay` at programming in C and are interested in making games. It&#x27;s also aimed at people who are bored of their life and want to just read something random which involves an &lt;span style=&quot;color: orange&quot;&gt;awesome&lt;&#x2F;span&gt; orange demon.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
</feed>
