<?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"><channel><title><![CDATA[Aniket's Blog]]></title><description><![CDATA[Hello there! I'm Aniket Patidar, a full-stack engineer who takes pride in engineering captivating digital realms.]]></description><link>https://blog.aniketpatidar.com</link><generator>RSS for Node</generator><lastBuildDate>Sat, 09 May 2026 21:06:43 GMT</lastBuildDate><atom:link href="https://blog.aniketpatidar.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Easily Add VS Code Extensions in Antigravity When Not Available on Open VSX]]></title><description><![CDATA[I began with a simple task: installing the Chai theme extension in Antigravity.My first thought was to search for it in the editor’s extension marketplace, but nothing appeared. I tried several different keywords, but still had no success.
It became ...]]></description><link>https://blog.aniketpatidar.com/how-to-easily-add-vs-code-extensions-in-antigravity-when-not-available-on-open-vsx</link><guid isPermaLink="true">https://blog.aniketpatidar.com/how-to-easily-add-vs-code-extensions-in-antigravity-when-not-available-on-open-vsx</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Tue, 25 Nov 2025 18:44:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1764093791189/8c2a15c3-a13e-402a-975b-e5aca7bc67fb.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I began with a simple task: installing the Chai theme extension in Antigravity.<br />My first thought was to search for it in the editor’s extension marketplace, but nothing appeared. I tried several different keywords, but still had no success.</p>
<p>It became clear that the theme wasn’t available in the Open VSX registry, which is the only marketplace Antigravity can use by default. Due to licensing rules, Antigravity can't access the official Microsoft marketplace, so it couldn't download the extension automatically.</p>
<p>This left me with only one option: to install it manually.</p>
<h3 id="heading-getting-the-vsix-file">Getting the VSIX File</h3>
<p>Since the extension wasn't available in Open VSX, I obtained the .vsix package directly from VS Code. Once you have the VSIX file, Antigravity can easily install it locally. In my case, the file was:</p>
<p><code>hiteshchoudharycode.chai-theme-0.2.0-web.vsix</code></p>
<h3 id="heading-installing-the-extension-manually">Installing the Extension Manually</h3>
<p>Antigravity supports the same local extension installation process as VS Code. All you need is this command:</p>
<pre><code class="lang-bash">antigravity --install-extension hiteshchoudharycode.chai-theme-0.2.0-web.vsix
</code></pre>
<p>Right after that, you receive the confirmation:</p>
<pre><code class="lang-bash">Installing extensions...
Extension <span class="hljs-string">'hiteshchoudharycode.chai-theme-0.2.0-web.vsix'</span> was successfully installed.
</code></pre>
<p>Theme applied.</p>
<h3 id="heading-final-notes">Final Notes</h3>
<p>If an extension isn’t available in Open VSX, you can always:</p>
<ol>
<li><p>Download the .vsix file</p>
</li>
<li><p>Install it manually</p>
</li>
</ol>
<p>This method works and saves you from having to switch editors just for a theme or plugin.</p>
]]></content:encoded></item><item><title><![CDATA[NestJS REPL: Bringing Back the Rails Console Experience]]></title><description><![CDATA[If you've ever worked with Rails, you're likely familiar with the console, a tool that becomes second nature for exploring models, debugging, or modifying data quickly. Transitioning to NestJS, you might miss this handy feature, as it's not available...]]></description><link>https://blog.aniketpatidar.com/nestjs-repl-bringing-back-the-rails-console-experience</link><guid isPermaLink="true">https://blog.aniketpatidar.com/nestjs-repl-bringing-back-the-rails-console-experience</guid><category><![CDATA[Rails]]></category><category><![CDATA[nestjs]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Fri, 21 Nov 2025 18:46:33 GMT</pubDate><content:encoded><![CDATA[<p>If you've ever worked with Rails, you're likely familiar with the console, a tool that becomes second nature for exploring models, debugging, or modifying data quickly. Transitioning to NestJS, you might miss this handy feature, as it's not available out of the box. However, you can create your own version.</p>
<p>A straightforward approach is to use Prisma, as its client is self-contained and easily integrated into a REPL. A simple script can get you started:</p>
<pre><code class="lang-ts"><span class="hljs-keyword">import</span> { PrismaClient } <span class="hljs-keyword">from</span> <span class="hljs-string">'@prisma/client'</span>;

<span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> prisma = <span class="hljs-keyword">new</span> PrismaClient();
  <span class="hljs-keyword">const</span> repl = <span class="hljs-built_in">require</span>(<span class="hljs-string">'repl'</span>).start(<span class="hljs-string">'&gt; '</span>);
  repl.context.prisma = prisma;
}

main();
</code></pre>
<p>Place this script in a file like <code>src/repl.ts</code> and execute it:</p>
<pre><code class="lang-plaintext">npx ts-node src/repl.ts
</code></pre>
<p>Now, you can perform similar tasks as you would in a Rails console:</p>
<pre><code class="lang-bash">&gt; await prisma.user.findMany()
</code></pre>
<p>While it doesn't load the full Rails environment, it serves its purpose.</p>
<h3 id="heading-and-yes-prisma-studio-exists">And yes, Prisma Studio exists</h3>
<p>Before diving into building a custom REPL, consider that Prisma comes with <strong>Prisma Studio</strong>:</p>
<pre><code class="lang-bash">npx prisma studio
</code></pre>
<p>Prisma Studio provides a clean interface for viewing and editing tables. It's excellent for browsing data but doesn't quite capture the "let me try this query right now" feel of the Rails console. This is where the REPL comes in handy.</p>
<h3 id="heading-when-the-repl-is-the-right-choice">When the REPL is the Right Choice</h3>
<ul>
<li>Testing a query before integrating it into a service</li>
</ul>
<p>In summary, a small REPL can be sufficient for quickly testing queries without the need to launch the entire application.</p>
]]></content:encoded></item><item><title><![CDATA[What is GPT?]]></title><description><![CDATA[GPT = Generative Pre-trained Transformer  
A family of large language models that generate text one token at a time, using the Transformer architecture. GPTs are primarily used to generate text.

Generative - it produces (generates) text.

Pre-traine...]]></description><link>https://blog.aniketpatidar.com/what-is-gpt</link><guid isPermaLink="true">https://blog.aniketpatidar.com/what-is-gpt</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Wed, 13 Aug 2025 04:39:35 GMT</pubDate><content:encoded><![CDATA[<p>GPT = <strong>Generative Pre-trained Transformer</strong>  </p>
<p>A family of large language models that generate text one token at a time, using the Transformer architecture. GPTs are primarily used to generate text.</p>
<ul>
<li><p><strong>Generative</strong> - it produces (generates) text.</p>
</li>
<li><p><strong>Pre-trained</strong> - first trained on huge amounts of text (next-token prediction).</p>
</li>
<li><p><strong>Transformer</strong> - the underlying architecture.</p>
</li>
</ul>
<h3 id="heading-how-it-works">How it works:</h3>
<ul>
<li><p>Text is broken down into tokens by a tokenizer. Each token is turned into a vector.</p>
</li>
<li><p>A series of Transformer decoder layers use self-attention and feed-forward networks to figure out the next-token distribution.</p>
</li>
<li><p>During inference, the model either samples or chooses the next token with the highest probability, adds it, and repeats the process.</p>
</li>
</ul>
<h3 id="heading-why-gpt-is-powerful">Why GPT is powerful</h3>
<ul>
<li><p>trained on massive text datasets.</p>
</li>
<li><p>You can teach it new behavior by providing examples.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How I contributed notifications to an open-source product]]></title><description><![CDATA[This post details my contribution to the notification system for Moneygun, an open-source, white-label SaaS boilerplate. It provides a practical and actionable guide on integrating notifications into a Rails application using the Noticed gem.
https:/...]]></description><link>https://blog.aniketpatidar.com/how-i-contributed-notifications-to-an-open-source-product</link><guid isPermaLink="true">https://blog.aniketpatidar.com/how-i-contributed-notifications-to-an-open-source-product</guid><category><![CDATA[Open Source]]></category><category><![CDATA[notifications]]></category><category><![CDATA[Ruby on Rails]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Sun, 06 Jul 2025 13:49:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1751805807419/b8608399-9201-4f66-ab43-a433def52426.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This post details my contribution to the notification system for Moneygun, an open-source, white-label SaaS boilerplate. It provides a practical and actionable guide on integrating notifications into a Rails application using the <a target="_blank" href="https://github.com/excid3/noticed">Noticed</a> gem.</p>
<p><a target="_blank" href="https://github.com/yshmarov/moneygun/pull/286">https://github.com/yshmarov/moneygun/pull/286</a><br />First, I want to share that I learned about <a target="_blank" href="https://x.com/yarotheslav">Yaroslav Shmarov</a> (@yarotheslav) looking for contributors for their open-source product, Moneygun, through a Twitter post he made. I also wanted to explore the new version of the Noticed gem, so I decided to give it a try. That's how I got the opportunity to work on this <a target="_blank" href="https://github.com/yshmarov/moneygun/issues/285">issue</a>.</p>
<p>Do check out Moneygun if you want to build your next B2B SaaS app (software as a service): <a target="_blank" href="https://github.com/yshmarov/moneygun">https://github.com/yshmarov/moneygun</a></p>
<p><a target="_blank" href="https://x.com/yarotheslav/status/1934196524633706540"><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751806188505/251884e9-cc45-4543-a204-0a066a36b808.png" alt class="image--center mx-auto" /></a></p>
<p>There are two things that need to be implemented. </p>
<ul>
<li><p>In-app notifications</p>
</li>
<li><p>Email</p>
</li>
</ul>
<p>First, I explored the gem to understand how to implement basic boilerplate code for notifications, then began by adding the gem to the Rails application:</p>
<pre><code class="lang-ruby"><span class="hljs-comment"># notifications</span>
gem <span class="hljs-string">"noticed"</span>
</code></pre>
<p>Or</p>
<p>Run the following command to add Noticed to your Gemfile:</p>
<pre><code class="lang-bash">bundle add <span class="hljs-string">"noticed"</span>
</code></pre>
<p>Generate and then run the migrations:</p>
<pre><code class="lang-ruby">rails <span class="hljs-symbol">noticed:</span><span class="hljs-symbol">install:</span>migrations
rails <span class="hljs-symbol">db:</span>migrate
</code></pre>
<p>To start, create a Notifier:</p>
<p>We have two requirements here:</p>
<ol>
<li><p>The user should be notified when they are invited to an organization.</p>
</li>
<li><p>The user should be notified when their membership request is accepted.</p>
</li>
</ol>
<pre><code class="lang-bash">rails generate noticed:notifier MembershipInvitationNotifier
rails generate noticed:notifier MembershipRequestAcceptedNotifier
</code></pre>
<p>In this post, we'll deliver notifications by email, and in the next post, we'll cover turbo_stream, which provides real-time UI updates to users' browsers.</p>
<p>First, let's take a look at how the generated notifier appears.</p>
<p>Three files are created under the notifiers:</p>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/notifiers/application_notifier.rb</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ApplicationNotifier</span> &lt; Noticed::Event</span>
<span class="hljs-keyword">end</span>
</code></pre>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/notifiers/membership_request_accepted_notifier.rb</span>
<span class="hljs-comment"># To deliver this notification:</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># MembershipRequestAcceptedNotifier.with(record: <span class="hljs-doctag">@post</span>, message: "New post").deliver(User.all)</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MembershipRequestAcceptedNotifier</span> &lt; ApplicationNotifier</span>
 <span class="hljs-comment"># Add your delivery methods</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># deliver_by :email do |config|</span>
 <span class="hljs-comment">#   config.mailer = "UserMailer"</span>
 <span class="hljs-comment">#   config.method = "new_post"</span>
 <span class="hljs-comment"># end</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># bulk_deliver_by :slack do |config|</span>
 <span class="hljs-comment">#   config.url = -&gt; { Rails.application.credentials.slack_webhook_url }</span>
 <span class="hljs-comment"># end</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># deliver_by :custom do |config|</span>
 <span class="hljs-comment">#   config.class = "MyDeliveryMethod"</span>
 <span class="hljs-comment"># end</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># Add required params</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># required_param :message</span>
<span class="hljs-keyword">end</span>
</code></pre>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/notifiers/membership_invitation_notifier.rb</span>
<span class="hljs-comment"># To deliver this notification:</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># MembershipInvitationNotifier.with(record: <span class="hljs-doctag">@post</span>, message: "New post").deliver(User.all)</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MembershipInvitationNotifier</span> &lt; ApplicationNotifier</span>
 <span class="hljs-comment"># Add your delivery methods</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># deliver_by :email do |config|</span>
 <span class="hljs-comment">#   config.mailer = "UserMailer"</span>
 <span class="hljs-comment">#   config.method = "new_post"</span>
 <span class="hljs-comment"># end</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># bulk_deliver_by :slack do |config|</span>
 <span class="hljs-comment">#   config.url = -&gt; { Rails.application.credentials.slack_webhook_url }</span>
 <span class="hljs-comment"># end</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># deliver_by :custom do |config|</span>
 <span class="hljs-comment">#   config.class = "MyDeliveryMethod"</span>
 <span class="hljs-comment"># end</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># Add required params</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># required_param :message</span>
<span class="hljs-keyword">end</span>
</code></pre>
<p>In the boilerplate code, you can see there's⁣<code>deliver_by: email</code>, so we will implement the mailer delivery method first.</p>
<p>We won't complicate things for now; we'll start with one notifier to give you an idea, and then you can implement another notifier on your own.</p>
<p>So we need to notify the user when he is invited to an organization. First, clean up the commented lines and keep only the ones that are needed.</p>
<pre><code class="lang-ruby"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MembershipInvitationNotifier</span> &lt; ApplicationNotifier</span>
 <span class="hljs-comment"># Add your delivery methods</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># deliver_by :email do |config|</span>
 <span class="hljs-comment">#   config.mailer = "UserMailer"</span>
 <span class="hljs-comment">#   config.method = "new_post"</span>
 <span class="hljs-comment"># end</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># Add required params</span>
 <span class="hljs-comment">#</span>
 <span class="hljs-comment"># required_param :message</span>
<span class="hljs-keyword">end</span>
</code></pre>
<p>Notifiers can use different helper methods. Inside a notification_methods block, we also set up the message and URL helpers.</p>
<pre><code class="lang-ruby">notification_methods <span class="hljs-keyword">do</span>
   <span class="hljs-comment"># I18n helpers</span>
   <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">message</span></span>
     t(<span class="hljs-string">".message"</span>)
   <span class="hljs-keyword">end</span>

   <span class="hljs-comment"># URL helpers are accessible in notifications</span>
   <span class="hljs-comment"># Don't forget to set your default_url_options so Rails knows how to generate urls</span>
   <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">url</span></span>
     user_invitations_url
   <span class="hljs-keyword">end</span>
 <span class="hljs-keyword">end</span>
</code></pre>
<p>These helpers can be helpful when rendering a user’s notifications on the web.</p>
<pre><code class="lang-erb"><span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%</span></span></span><span class="ruby"> @user.notifications.each <span class="hljs-keyword">do</span> <span class="hljs-params">|notification|</span> </span><span class="xml"><span class="hljs-tag">%&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span></span></span><span class="ruby"> link_to notification.message, notification.url </span><span class="xml"><span class="hljs-tag">%&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%</span></span></span><span class="ruby"> <span class="hljs-keyword">end</span> </span><span class="xml"><span class="hljs-tag">%&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
</code></pre>
<p>Calling the message helper in the ERB view will look for the following translation path:</p>
<pre><code class="lang-yaml"><span class="hljs-comment"># config/locales/en.yml</span>
<span class="hljs-attr">en:</span>
 <span class="hljs-attr">notifiers:</span>
   <span class="hljs-attr">membership_invitation_notifier:</span>
     <span class="hljs-attr">notification:</span>
       <span class="hljs-attr">message:</span> <span class="hljs-string">You've</span> <span class="hljs-string">been</span> <span class="hljs-string">invited</span> <span class="hljs-string">to</span> <span class="hljs-string">join</span> <span class="hljs-string">%{organization_name}</span>
</code></pre>
<p>Notifiers can choose required parameters using the <code>required_params</code>method. We need to declare <code>:organization</code> as a required parameter to ensure <code>params[:organization]</code> is available in our notifier:</p>
<pre><code class="lang-ruby"> required_params <span class="hljs-symbol">:organization</span>
</code></pre>
<pre><code class="lang-ruby"> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">message</span></span>
   t(<span class="hljs-string">".message"</span>, <span class="hljs-symbol">organization_name:</span> params[<span class="hljs-symbol">:organization</span>].name)
 <span class="hljs-keyword">end</span>
</code></pre>
<p>In this case, we need the mailer, so generate it by running</p>
<pre><code class="lang-bash">rails generate mailer MembershipMailer invitation_email
</code></pre>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/mailers/membership_mailer.rb</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MembershipMailer</span> &lt; ApplicationMailer</span>
  <span class="hljs-comment"># Subject can be set in your I18n file at config/locales/en.yml</span>
  <span class="hljs-comment"># with the following lookup:</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-comment">#   en.membership_mailer.invitation_email.subject</span>
  <span class="hljs-comment">#</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">invitation_email</span></span>
    @greeting = <span class="hljs-string">"Hi"</span>
    mail <span class="hljs-symbol">to:</span> <span class="hljs-string">"to@example.org"</span>
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<p>app/views/membership_mailer/invitation_email.text.erb</p>
<pre><code class="lang-erb"><span class="xml">Membership#invitation_email

<span class="hljs-tag">&lt;<span class="hljs-name">%=</span></span></span><span class="ruby"> @greeting </span><span class="xml"><span class="hljs-tag">%&gt;</span>, find me in app/views/membership_mailer/invitation_email.text.erb</span>
</code></pre>
<p>Instead of using this default greeting, we want to send our message and include the action_url. To do this, we need to have the notification object available, so we should pass it from our notifier like this:</p>
<pre><code class="lang-ruby">deliver_by <span class="hljs-symbol">:email</span> <span class="hljs-keyword">do</span> <span class="hljs-params">|config|</span>
  config.mailer = <span class="hljs-string">"MembershipMailer"</span>
  config.method = <span class="hljs-symbol">:invitation_email</span>
  config.args   = -&gt; { [ <span class="hljs-keyword">self</span> ] }
<span class="hljs-keyword">end</span>
</code></pre>
<p>Now we need to make a small change to our mailer method.</p>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/mailers/membership_mailer.rb</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MembershipMailer</span> &lt; ApplicationMailer</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">invitation_email</span><span class="hljs-params">(notification)</span></span>
    setup(notification)
    mail(<span class="hljs-symbol">to:</span> @recipient.email, <span class="hljs-symbol">subject:</span> t(<span class="hljs-string">".subject"</span>, <span class="hljs-symbol">organization_name:</span> @organization.name))
  <span class="hljs-keyword">end</span>

  private

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">setup</span><span class="hljs-params">(notification)</span></span>
    @organization = notification.params[<span class="hljs-symbol">:organization</span>]
    @message = notification.message
    @recipient = notification.recipient
    @action_url = notification.url
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/views/membership_mailer/invitation_email.text.erb</span>
&lt;%= @message %&gt;

View your <span class="hljs-symbol">invitations:</span> &lt;%= @action_url %&gt;
</code></pre>
<p>Now our notifier code looks like this:</p>
<pre><code class="lang-ruby"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MembershipInvitationNotifier</span> &lt; ApplicationNotifier</span>
  <span class="hljs-comment"># Add your delivery methods</span>
  deliver_by <span class="hljs-symbol">:email</span> <span class="hljs-keyword">do</span> <span class="hljs-params">|config|</span>
    config.mailer = <span class="hljs-string">"MembershipMailer"</span>
    config.method = <span class="hljs-symbol">:invitation_email</span>
    config.args   = -&gt; { [ <span class="hljs-keyword">self</span> ] }
  <span class="hljs-keyword">end</span>

  <span class="hljs-comment"># Add required params</span>
  required_params <span class="hljs-symbol">:organization</span>

  notification_methods <span class="hljs-keyword">do</span>
    <span class="hljs-comment"># I18n helpers</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">message</span></span>
      t(<span class="hljs-string">".message"</span>, <span class="hljs-symbol">organization_name:</span> params[<span class="hljs-symbol">:organization</span>].name)
    <span class="hljs-keyword">end</span>

    <span class="hljs-comment"># URL helpers are accessible in notifications</span>
    <span class="hljs-comment"># Don't forget to set your default_url_options so Rails knows how to generate urls</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">url</span></span>
      user_invitations_url
    <span class="hljs-keyword">end</span>
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<p>Our notifier setup is now complete. Next, we need to trigger this notifier:</p>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/models/membership.rb</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Membership</span> &lt; ApplicationRecord</span>
  after_create <span class="hljs-symbol">:send_invitation_notification</span>

  private

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">send_invitation_notification</span></span>
    MembershipInvitationNotifier.with(<span class="hljs-symbol">organization:</span> organization).deliver(user)
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<p>With this setup in place, we have everything necessary to notify a user when they are invited to join an organization. Thank you for taking the time to read.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Getter and Setter Methods in Ruby💎]]></title><description><![CDATA[Why?
Getter and setter methods in Ruby provide a controlled way to access and modify the values of instance variables from outside the class. This helps maintain data integrity and adheres to the principle of encapsulation, which means hiding the int...]]></description><link>https://blog.aniketpatidar.com/understanding-getter-and-setter-methods-in-ruby</link><guid isPermaLink="true">https://blog.aniketpatidar.com/understanding-getter-and-setter-methods-in-ruby</guid><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Sat, 06 Jul 2024 04:44:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/hYDBcGGXrUo/upload/6207ce2bb57aea1757d05aa8d6fec61f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Why?</strong></p>
<p>Getter and setter methods in Ruby provide a controlled way to access and modify the values of instance variables from outside the class. This helps maintain data integrity and adheres to the principle of encapsulation, which means hiding the internal state of an object and only exposing necessary parts.</p>
<p><strong>What?</strong></p>
<ul>
<li><p><strong>Getter Methods</strong>: Allow reading the value of an instance variable.</p>
</li>
<li><p><strong>Setter Methods</strong>: Allow modifying the value of an instance variable.</p>
</li>
</ul>
<p><strong>How?</strong><br />Ruby simplifies the creation of these methods with <code>attr_accessor</code>, <code>attr_reader</code>, and <code>attr_writer</code>.</p>
<ul>
<li><p><code>attr_reader</code>: Generates only getter methods.</p>
</li>
<li><p><code>attr_writer</code>: Generates only setter methods.</p>
</li>
<li><p><code>attr_accessor</code>: Generates both getter and setter methods.</p>
</li>
</ul>
<h3 id="heading-example">Example</h3>
<pre><code class="lang-ruby"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Product</span></span>
  <span class="hljs-keyword">attr_reader</span> <span class="hljs-symbol">:name</span>     <span class="hljs-comment"># Generates only a getter for `name`</span>
  <span class="hljs-keyword">attr_writer</span> <span class="hljs-symbol">:price</span>    <span class="hljs-comment"># Generates only a setter for `price`</span>
  <span class="hljs-keyword">attr_accessor</span> <span class="hljs-symbol">:stock</span>  <span class="hljs-comment"># Generates both getter and setter for `stock`</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">initialize</span><span class="hljs-params">(name, price, stock)</span></span>
    @name = name
    @price = price
    @stock = stock
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>

product = Product.new(<span class="hljs-string">"T-Shirt"</span>, <span class="hljs-number">19.99</span>, <span class="hljs-number">10</span>)
puts product.name        <span class="hljs-comment"># Output: T-Shirt (using getter)</span>
product.price = <span class="hljs-number">24.99</span>    <span class="hljs-comment"># No getter for `price`, but setter allows modification</span>
product.stock = <span class="hljs-number">5</span>        <span class="hljs-comment"># Both getter and setter available for `stock`</span>
</code></pre>
<h3 id="heading-listing-instance-variables-and-methods">Listing Instance Variables and Methods</h3>
<p>Ruby provides built-in methods to inspect an object's instance variables and methods:</p>
<ul>
<li><p><code>#instance_variables</code>: Returns a list of instance variables.</p>
</li>
<li><p><code>#public_methods</code>: Returns a list of public methods.</p>
</li>
</ul>
<pre><code class="lang-ruby">p product.instance_variables  <span class="hljs-comment"># Output: [:<span class="hljs-doctag">@name</span>, :<span class="hljs-doctag">@price</span>, :<span class="hljs-doctag">@stock</span>]</span>
p product.public_methods      <span class="hljs-comment"># Output: List of public methods, including `name`, `price=`, and `stock`</span>
</code></pre>
<p>By using these tools, you can better understand the structure and capabilities of your objects.</p>
]]></content:encoded></item><item><title><![CDATA[The Best Way to Learn Programming]]></title><description><![CDATA[There are no easy ways, but there are better ways to do things.
Recently, I read something called “The aggregation of marginal gains” from Atomic Habits by James Clear, which means searching for tiny margins of improvement in everything you do.
Well ...]]></description><link>https://blog.aniketpatidar.com/the-best-way-to-learn-programming</link><guid isPermaLink="true">https://blog.aniketpatidar.com/the-best-way-to-learn-programming</guid><category><![CDATA[Python]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[learning]]></category><category><![CDATA[Learn Code Online]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Ruby]]></category><category><![CDATA[teaching]]></category><category><![CDATA[building]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Sun, 30 Jun 2024 21:32:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1719782991555/7a6621c5-25e2-4174-8cbd-aaff68148089.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are no easy ways, but there are better ways to do things.</p>
<p>Recently, I read something called “The aggregation of marginal gains” from Atomic Habits by James Clear, which means searching for tiny margins of improvement in everything you do.</p>
<p>Well then, let’s see how you can improve how you learn programming. What’s the best way to learn programming?</p>
<p>Watching tutorials on a specific topic on YouTube?</p>
<p>Reading articles?</p>
<p>Blog posts?</p>
<p>Books?</p>
<p>Or is it just simply coding 24x7?</p>
<p>Well, the best way to learn programming is, teaching and building Projects. I said it right.</p>
<p>Let’s talk about how can “teaching” help you learn programming a lot faster…</p>
<p>Teaching Programming:</p>
<p>A lot of you might have already heard about this method of learning –</p>
<p>Learning by teaching others.</p>
<p>Even studies have been done to prove this method works. Sounds a little crazy, but recall an incident in school or college where you couldn’t understand a specific topic or subject, you asked your friend who scores well in that subject and he explained it to you and you understood.</p>
<p>You might be wondering why he scores better than you, though both of you are putting a lot of effort into learning?</p>
<p>The reason for his success is because he has understood the topic to a level, where he could teach it to others. That’s the level of understanding you need.</p>
<p>How can I learn to get to that level in programming?</p>
<p>Well, it’s the same concept. If you learn something new, teach it to someone else. That would help you retain what you learned for a very long time and also solve misconceptions you had.</p>
<p>How do you teach? 🤔</p>
<p>Well, this had been a problem for many of us for a very long time. I’ve heard and knew about this study on how teaching can help you in learning but I’ve always thought, how do I teach and to whom?</p>
<p>I thought I must teach my friends at school or college, etc. But the reality is, you don’t need to.</p>
<p>You can literally teach to anyone around the world, and make yourself better in the subject.</p>
<p>You can write an article on Medium, shoot a video for YouTube, tutor someone online, or even do pair programming…</p>
<p>Building Projects:</p>
<p>Concepts are easy to forget unless you apply them in real life. Building projects are kinda more related to programming.</p>
<p>Learned about how to create objects in JavaScript? Learned how to fetch data from an API?</p>
<p>Create a small project, upload your code to GitHub, write an article, make a post or make a video and publish (be open to critics.)</p>
<p>How can I apply this in my day-to-day life?</p>
<p>Whenever you learn something new in programming or really about anything, teach it to a friend (probably someone who would be interested in it. 😅), record a video, make a post on Instagram, or at least write an article on Medium about it.</p>
]]></content:encoded></item><item><title><![CDATA[Setting Up asdf to Manage Node.js and Ruby on Ubuntu]]></title><description><![CDATA[Managing multiple versions of programming languages can be a headache, but asdf simplifies this process by providing a single CLI tool to manage versions of multiple runtime languages. In this article, we'll walk through the steps to install and conf...]]></description><link>https://blog.aniketpatidar.com/setting-up-asdf-to-manage-nodejs-and-ruby-on-ubuntu</link><guid isPermaLink="true">https://blog.aniketpatidar.com/setting-up-asdf-to-manage-nodejs-and-ruby-on-ubuntu</guid><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Fri, 28 Jun 2024 08:08:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1719562041276/3f8db288-2cc2-41b5-aaad-fac9222429ef.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Managing multiple versions of programming languages can be a headache, but asdf simplifies this process by providing a single CLI tool to manage versions of multiple runtime languages. In this article, we'll walk through the steps to install and configure asdf on Ubuntu, along with Node.js and Ruby.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before we begin, ensure that you have <code>curl</code> and <code>git</code> installed on your system. You can install them using the following command:</p>
<pre><code class="lang-bash">sudo apt install curl git
</code></pre>
<h2 id="heading-step-1-clone-the-asdf-repository">Step 1: Clone the asdf Repository</h2>
<p>First, clone the asdf repository from GitHub into your home directory:</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">clone</span> https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
</code></pre>
<p>This command checks out the version 0.14.0 of asdf. Adjust the version number as needed.</p>
<h2 id="heading-step-2-update-your-shell-configuration">Step 2: Update Your Shell Configuration</h2>
<p>To make asdf available in your terminal, you need to update your shell configuration. Add the following lines to your <code>~/.bashrc</code> file:</p>
<pre><code class="lang-bash">. <span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.asdf/asdf.sh"</span>
. <span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.asdf/completions/asdf.bash"</span>
</code></pre>
<p>After adding these lines, reload your <code>~/.bashrc</code> file to apply the changes:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> ~/.bashrc
</code></pre>
<h2 id="heading-step-3-install-nodejs">Step 3: Install Node.js</h2>
<p>To install Node.js using asdf, follow these steps:</p>
<h3 id="heading-install-additional-dependencies">Install Additional Dependencies</h3>
<p>Node.js requires some additional dependencies which can be installed using the following command:</p>
<pre><code class="lang-bash">sudo apt-get install dirmngr gpg curl gawk
</code></pre>
<h3 id="heading-add-the-nodejs-plugin">Add the Node.js Plugin</h3>
<p>Next, add the Node.js plugin to asdf:</p>
<pre><code class="lang-bash">asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
</code></pre>
<h3 id="heading-install-the-latest-version-of-nodejs">Install the Latest Version of Node.js</h3>
<p>You can now install the latest version of Node.js:</p>
<pre><code class="lang-bash">asdf install nodejs latest
</code></pre>
<h2 id="heading-step-4-install-ruby">Step 4: Install Ruby</h2>
<p>To install Ruby using asdf, follow these steps:</p>
<h3 id="heading-add-the-ruby-plugin">Add the Ruby Plugin</h3>
<p>First, add the Ruby plugin to asdf:</p>
<pre><code class="lang-bash">asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
</code></pre>
<h3 id="heading-install-the-latest-version-of-ruby">Install the Latest Version of Ruby</h3>
<p>Now, you can install the latest version of Ruby:</p>
<pre><code class="lang-bash">asdf install ruby latest
</code></pre>
<h2 id="heading-step-5-verify-the-installation">Step 5: Verify the Installation</h2>
<p>It's important to verify that asdf has correctly installed and configured the runtime versions. You can do this by checking the output of the <code>type -a ruby</code> command.</p>
<ul>
<li><p><strong>Correct Output:</strong></p>
<pre><code class="lang-bash">  ruby is /home/username/.asdf/shims/ruby
  ruby is /usr/bin/ruby
</code></pre>
</li>
<li><p><strong>Incorrect Output:</strong></p>
<pre><code class="lang-bash">  ruby is /usr/bin/ruby
</code></pre>
</li>
</ul>
<p>If you see the correct output, it means that asdf is correctly managing the Ruby version.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>By following these steps, you've installed asdf and configured it to manage Node.js and Ruby on your system. This setup will help you seamlessly switch between different versions of these runtimes, making your development environment more flexible and efficient.</p>
<p>Happy coding!</p>
<hr />
<p>Feel free to ask any questions in the comments below or share your experience using asdf to manage different runtime versions. If you found this article helpful, don't forget to give it a thumbs up and share it with your network!</p>
]]></content:encoded></item><item><title><![CDATA[Tools every developers must know in 2024]]></title><description><![CDATA[If you don't know these tools as a developer, then you're living in the stone age...  
1. Git and Github  
Git and GitHub are two of the most important tools every developer should know. They help you handle version control for your websites and appl...]]></description><link>https://blog.aniketpatidar.com/tools-every-developers-must-know-in-2024</link><guid isPermaLink="true">https://blog.aniketpatidar.com/tools-every-developers-must-know-in-2024</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[chrome extension]]></category><category><![CDATA[#chrome_devtools]]></category><category><![CDATA[oh-my-zsh]]></category><category><![CDATA[Postman]]></category><category><![CDATA[version control]]></category><category><![CDATA[Vercel]]></category><category><![CDATA[notion]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Developer Tools]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Sat, 06 Jan 2024 11:14:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/p-xSl33Wxyc/upload/573d4b47cf444608ea9eadba8bacc381.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you don't know these tools as a developer, then you're living in the stone age...  </p>
<p>1. Git and Github  </p>
<p>Git and GitHub are two of the most important tools every developer should know. They help you handle version control for your websites and applications.  </p>
<p>2. Chrome Dev Tools  </p>
<p>Chrome Dev Tools is a set of tools that come directly into the browser. It helps web developers edit pages and identify bugs in the browser to help build better websites faster.  </p>
<p>3. Oh My Zsh  </p>
<p>Oh My Zsh is an open-source framework to manage your shell configuration. It will help you become a 10x developer.  </p>
<p>4. Postman  </p>
<p>Postman helps you build API's, test them, and receive data from API's. If you want to see what data you receive from an API, Postman makes it all easy.  </p>
<p>5. Vercel  </p>
<p>Vercel is a cloud platform similar to Netlify. It simplifies the way you host your project. Your deployment is just one git push away!  </p>
<p>6. Notion  </p>
<p>Everybody loves. Who doesn't? Notion is an all-in-one place to get your notes, to-dos, ideas, and everything else organized. It works like your second brain.  </p>
<p>Do you use these tools every day as a developer? Did you learn something new today? Let me know what you think in the comments.  </p>
<p>Please do share with your friends and community so that it might help others.<br />Follow for more such content, and do check out my profile.</p>
]]></content:encoded></item><item><title><![CDATA[Supercharge Your Productivity: Must-Have Tools for Software Development Success]]></title><description><![CDATA[There are several tools and software applications that can help boost productivity in software development. Here are some of the best tools widely used by developers:
1. Integrated Development Environments (IDEs):
- Visual Studio Code: A popular, lig...]]></description><link>https://blog.aniketpatidar.com/supercharge-your-productivity-must-have-tools-for-software-development-success</link><guid isPermaLink="true">https://blog.aniketpatidar.com/supercharge-your-productivity-must-have-tools-for-software-development-success</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[Hashnode]]></category><category><![CDATA[hacks]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Wed, 14 Jun 2023 18:26:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1686767052062/08d476c2-f939-4980-be6c-f754a9882adf.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are several tools and software applications that can help boost productivity in software development. Here are some of the best tools widely used by developers:</p>
<p>1. Integrated Development Environments (IDEs):</p>
<p>- Visual Studio Code: A popular, lightweight, and extensible IDE with powerful features, extensive language support, and a vibrant community.</p>
<p>- JetBrains IntelliJ IDEA: A robust IDE that offers smart code completion, code navigation, debugging, and version control integration.</p>
<p>2. Version Control Systems:</p>
<p>- Git: A distributed version control system that enables collaboration, code versioning, branching, and merging.</p>
<p>- GitHub: A web-based platform that provides Git repository hosting, issue tracking, code review, and collaboration features.</p>
<p>- Bitbucket: Another web-based platform that offers Git and Mercurial repository hosting with built-in CI/CD and issue tracking capabilities.</p>
<p>3. Collaboration and Communication Tools:</p>
<p>- Slack: A team communication platform that allows real-time messaging, file sharing, and integration with various development tools.</p>
<p>- Microsoft Teams: A collaboration hub that combines chat, video meetings, file sharing, and integration with other Microsoft products.</p>
<p>- Jira: A popular project management tool for agile development, enabling issue tracking, task management, and team collaboration.</p>
<p>4. Continuous Integration and Deployment (CI/CD) Tools:</p>
<p>- Jenkins: An open-source automation server that facilitates building, testing, and deploying software.</p>
<p>- CircleCI: A cloud-based CI/CD platform that automates the software development process with seamless integration and scalability.</p>
<p>- Travis CI: A popular CI/CD tool that supports various programming languages and integrates well with GitHub repositories.</p>
<p>5. Task and Project Management Tools:</p>
<p>- Trello: A visual collaboration tool that helps organize and track tasks using boards, lists, and cards.</p>
<p>- Asana: A flexible project management tool that enables teams to plan, track progress, and communicate about tasks and projects.</p>
<p>- Monday.com: An intuitive work management platform that provides customizable workflows, task tracking, and collaboration features.</p>
<p>6. Documentation Tools:</p>
<p>- Confluence: A team collaboration and knowledge sharing platform that allows creating, organizing, and documenting project information.</p>
<p>- Markdown Editors (e.g., Visual Studio Code with Markdown extensions): Lightweight editors that simplify writing and formatting documentation in Markdown syntax.</p>
<p>7. Testing and Debugging Tools:</p>
<p>- Selenium: A web automation tool for testing web applications across multiple browsers and platforms.</p>
<p>- Postman: A popular API development and testing platform that simplifies API testing, documentation, and collaboration.</p>
<p>- Chrome DevTools: A set of web developer tools built into the Google Chrome browser, offering debugging, profiling, and performance analysis capabilities.</p>
<p>Remember, the choice of tools may vary depending on your specific requirements, programming language, and team preferences. It's essential to explore and experiment with different tools to find the ones that best suit your workflow and boost your productivity as a software developer.</p>
]]></content:encoded></item><item><title><![CDATA[What is an API ?]]></title><description><![CDATA[A waiter takes the order from the customer, which is then relayed to the chef.  
Once the chef completes the meal, the waiter brings the meal to the customer.  
Similarly,  
An API receives a request from an application.  
Then it interacts with a da...]]></description><link>https://blog.aniketpatidar.com/what-is-an-api</link><guid isPermaLink="true">https://blog.aniketpatidar.com/what-is-an-api</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[software development]]></category><category><![CDATA[operating system]]></category><category><![CDATA[Microservices]]></category><category><![CDATA[#codenewbies]]></category><dc:creator><![CDATA[Aniket Patidar]]></dc:creator><pubDate>Wed, 15 Feb 2023 13:06:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/pOdHBD9uuYE/upload/cc4f048b59d5f06c7cb4658b60bb91ad.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A waiter takes the order from the customer, which is then relayed to the chef.  </p>
<p>Once the chef completes the meal, the waiter brings the meal to the customer.  </p>
<p>Similarly,  </p>
<p>An API receives a request from an application.  </p>
<p>Then it interacts with a data source to collect and process a response,  </p>
<p>Which is then returned to the application.  </p>
<p>📓Definition :-  </p>
<p>An API (Application Programming Interface) is a set of functions that allows applications to access data and interact with external software components, operating systems, or microservices.  </p>
<p><a target="_blank" href="https://www.linkedin.com/feed/hashtag/?keywords=programming&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935074873400516608">#programming</a> <a target="_blank" href="https://www.linkedin.com/feed/hashtag/?keywords=software&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935074873400516608">#software</a> <a target="_blank" href="https://www.linkedin.com/feed/hashtag/?keywords=operatingsystems&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935074873400516608">#operatingsystems</a> <a target="_blank" href="https://www.linkedin.com/feed/hashtag/?keywords=data&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935074873400516608">#data</a> <a target="_blank" href="https://www.linkedin.com/feed/hashtag/?keywords=microservices&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935074873400516608">#microservices</a> <a target="_blank" href="https://www.linkedin.com/feed/hashtag/?keywords=chef&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935074873400516608">#chef</a></p>
]]></content:encoded></item></channel></rss>