<?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 Gurusabarish on Medium]]></title>
        <description><![CDATA[Stories by Gurusabarish on Medium]]></description>
        <link>https://medium.com/@gurusabarish?source=rss-9273e2bae8fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Gurusabarish on Medium</title>
            <link>https://medium.com/@gurusabarish?source=rss-9273e2bae8fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:09:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gurusabarish/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[Claude Code: Terminal vs IDE Plugin — Which One Should You Actually Use? ]]></title>
            <link>https://gurusabarish.medium.com/claude-code-terminal-vs-ide-plugin-which-one-should-you-actually-use-2ad592419f5e?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ad592419f5e</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai-tools]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 05:25:43 GMT</pubDate>
            <atom:updated>2026-09-21T05:25:43.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*frAvY9P9SeATrRyU5BJgLQ.png" /></figure><p>Okay, real talk. I went down a rabbit hole trying to figure out whether I should be running Claude Code from my terminal or through the VS Code/JetBrains plugin, and honestly, most of what I found online overcomplicates it. So here’s the plain version.</p><p><strong>They’re not two different tools.</strong> They’re the <em>same engine</em> wearing different outfits. Terminal Claude Code is the raw, no-frills version — fast, portable, goes anywhere. The IDE plugin (VS Code, Cursor, Windsurf, JetBrains) is that exact same engine, just wrapped in a few conveniences so you don’t have to keep alt-tabbing out of your editor.</p><p>So if you came here hoping one of them is objectively “faster” — sorry, nope. Same brain, same speed. 🧠 The whole difference lives in <em>friction</em>, not horsepower.</p><p>My honest verdict, upfront: <strong>terminal for anything remote, scripted, or spread across multiple repos. IDE plugin when you’re heads-down in one project and just want diffs to show up where you’re already looking.</strong> Most people I’ve talked to who actually use this daily don’t pick one — they flip between both depending on what they’re doing that day.</p><p>Here’s the detail that made the whole debate click for me. 👇</p><h3>Plot twist: it’s literally the same process</h3><p>When you run claude inside VS Code&#39;s or JetBrains&#39; built-in terminal, you&#39;re not opening some special IDE-flavored build. You&#39;re running the <em>exact same CLI</em> you&#39;d run anywhere else. The plugin just quietly attaches itself on top and adds a few nice-to-haves. It&#39;s not touching the model, not touching response speed, definitely not making Claude &quot;think faster.&quot; 🐢➡️🐇 isn&#39;t a thing here.</p><p>Once that clicked, I stopped comparing the two on performance and started comparing them on <em>workflow</em> — which is really what this whole thing comes down to.</p><h3>What the IDE plugin actually gives you 🎁</h3><ul><li><strong>Quick launch</strong> — Cmd+Esc / Ctrl+Esc and Claude pops open right where you&#39;re working. No hunting for a terminal window.</li><li><strong>Inline diffs</strong> — changes show up in your editor’s own diff viewer instead of a wall of terminal text you have to squint at.</li><li><strong>Auto-shared context</strong> — whatever file or selection you’ve got open gets handed to Claude automatically. No more copy-pasting the same snippet for the third time.</li><li><strong>File shortcuts</strong> — Cmd+Option+K / Alt+Ctrl+K drops in a reference like @File#L1-99 in one keystroke.</li><li><strong>Diagnostics for free</strong> — your IDE’s lint/syntax errors get shared automatically, so Claude often already knows what’s broken before you say a word.</li></ul><p>None of this makes Claude any smarter or quicker under the hood. It just quietly removes the dozens of tiny manual steps — copy this, paste that, explain which file you meant — that eat away at your afternoon without you noticing. ⏱️</p><h3>What the plain terminal gives you back 💻</h3><ul><li><strong>It goes literally anywhere.</strong> SSH into a server, inside a Docker container, inside tmux, in a CI pipeline — the terminal doesn’t blink. The IDE plugin, by contrast, only works while that IDE is actually open and running.</li><li><strong>It scripts beautifully.</strong> Pipe it, chain it, run it headless. If you’re doing repetitive or automation-heavy work, this is a completely different game than “assistant sitting in my editor.”</li><li><strong>One consistent habit, everywhere.</strong> Bounce between VS Code, JetBrains, Vim, and a remote box in the same week? Terminal Claude Code feels identical in every single one. No relearning a shortcut per tool.</li><li><strong>A lighter footprint, in principle.</strong> No extension bridge, no editor process sitting on top — just the CLI itself. Matters more on a cramped remote box than your beefy laptop, but it’s a real difference.</li></ul><p>And here’s the one that actually tips it for me personally: my project is spread across <strong>multiple repos</strong>, and the terminal just deals with that reality better. 🗂️ To be fair to how this actually works — Claude Code doesn’t silently scan your whole machine and “discover” related repos on its own. Cross-repo awareness comes from explicitly pointing it there, usually with the --add-dir flag, which pulls another directory into the same session. What the terminal <em>does</em> give it, though, is full, unrestricted shell access. So mid-debug, it can genuinely go dig — run a find to track down a sibling repo, poke through a .jar sitting in my local Maven cache, grep across folders I never explicitly pointed it at — whatever the problem actually needs. 🔍 An IDE plugin&#39;s world is basically the one project open in that window. The terminal&#39;s world is whatever the shell itself can reach. That&#39;s the real reason I keep going back to it.</p><h3>So… which one actually wins? 🏆</h3><p>Neither, if I’m honest — they’re just built for different moments:</p><ul><li>Heads-down feature work in one repo, tight review loop → <strong>IDE plugin</strong> 🎯</li><li>SSH sessions, containers, remote servers → <strong>Terminal</strong> 🌐</li><li>CI/CD, automation, scripting → <strong>Terminal</strong> ⚙️</li><li>Jumping across multiple repos or environments → <strong>Terminal</strong> 🔁</li><li>Fast, frequent diff reviews → <strong>IDE plugin</strong> 👀</li><li>You basically never leave your editor anyway → <strong>IDE plugin</strong> 🏠</li></ul><p>If I had to put it one way: the terminal is the <em>real thing</em> — it’s literally what Claude Code is at its core. The IDE plugin is a comfortable skin on top of that, built for one very common way of working. You don’t lose anything switching between them either — drop into /ide from an external terminal any time to reconnect — so there&#39;s no genuinely wrong choice here. Just the wrong choice <em>for the moment you&#39;re in</em>.</p><h3>Bottom line 🎬</h3><p>Stop hunting for a speed difference, because there isn’t one — it’s the exact same model doing the exact same work no matter which door you walked through. The real question is how much friction you’re willing to trade for scripting power and remote flexibility. Most people who use this seriously don’t pick a side. They just switch tools the way they switch tabs. 🔄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ad592419f5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run code on scroll complete — Javascript]]></title>
            <link>https://gurusabarish.medium.com/run-code-on-scroll-complete-javascript-6c4990e9b609?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c4990e9b609</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Mon, 11 Mar 2024 02:47:57 GMT</pubDate>
            <atom:updated>2024-03-11T02:47:57.829Z</atom:updated>
            <content:encoded><![CDATA[<h3>Run code on scroll complete — Javascript</h3><p>Let’s say, you have a scenario to run a code on scroll complete. <strong>How would you achieve this?</strong> This can be done through several methods. I will explain these methods below.</p><h4>1. Scrollend Event</h4><p>Javascript provides an event to achieve this. This event will be triggered once scroll gets complete. However, <strong>this event is not supported by all browsers. So, it is not recommended to use</strong>. <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollend_event">Refer here</a> to know more about this event.</p><pre>document.addEventListener(&quot;scrollend&quot;, (event) =&gt; {<br>  // Your code to be executed<br>  console.log(&quot;scroll completed&quot;);<br>});</pre><h4>2. Using Timeout and Scroll event</h4><p>This will be a perfect solution to achieve this. Let’s jump into it. Using timeout inside a scroll event, we can easily run our code on scroll complete.</p><pre>document.addEventListener(&quot;scroll&quot;, (event) =&gt; {<br>  if(scrollTimeOut) {<br>    clearTimeout(scrollTimeOut);<br>  }<br>  var scrollTimeOut = setTimeout(() =&gt; {<br>    // Your code to be executed<br>    console.log(&quot;scroll completed&quot;);<br>  }, 0);<br>});</pre><p><strong>Code execution will be in queue when you use setTimeout. This code will be executed once current code execution complete</strong>. That means our code execution happens after scroll gets complete. Clearing timeout will help us to ensure the execution of code only one time.</p><blockquote>However, I prefer you to use 2nd method as it has the stable performance in all type of browsers. Thanks for your time.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c4990e9b609" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can we find div height without rendering]]></title>
            <link>https://gurusabarish.medium.com/can-we-find-div-height-without-rendering-e2a7c53fac3f?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2a7c53fac3f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 01:46:44 GMT</pubDate>
            <atom:updated>2023-10-24T01:46:44.633Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Probably yes</strong>, we can find an HTML element’s width and height for below mentioned scenario.</p><ul><li>We should know element’s styles like padding, width</li><li>And also we should know each possible character’s height and width. You can also take average of all character height and width if suitable in your case.</li></ul><p>Below example with average height and wight. Here, we take Q character’s height and width as it is one of the largest character. After we have to find maximum characters within specific width. We can find max Line for an element.</p><pre>function maxCharatersByWidth(divStyles, charaterWidthAndHeight) {<br>  var actualWidth = divStyles.width - (divStyles.paddingLeft + divStyles.paddingRight);<br>  var maxCharacters = (actualWidth)/charaterWidthAndHeight.width;<br>  return Math.ceil(maxCharacters);<br>}<br>  <br>var charaterWidthAndHeight = {};<br>var divElem = document.createElement(&quot;div&quot;);<br>divElem.innerText = &quot;Q&quot;;<br>document.body.appendChild(divElem);<br>charaterWidthAndHeight.height = divElem.offsetHeight;<br>charaterWidthAndHeight.width = divElem.offsetWidth;<br>document.body.removeChild(divElem);<br><br>var divStyles = {<br>  width : 100,<br>  paddingLeft : 20,<br>  paddingRight : 20<br>};<br>var divText = &quot;To find div element&#39;s height without rendering&quot;;<br>var maxCharaters = maxCharatersByWidth(divStyles, charaterWidthAndHeight);<br>var maxLine = Math.ceil(divText.length/maxCharaters);<br>var divHeight = (maxLine * charaterWidthAndHeight.height) + divStyles.paddingTop + divStyles.paddingBottom;<br>console.log(&quot;div element&#39;s height is&quot;, divHeight);</pre><p>This approach can offer a rough estimate of an element’s height without rendering, it may not be entirely accurate due to various factors like font variations, text wrapping, and unaccounted CSS properties.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2a7c53fac3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connect netlify cms with hugo website]]></title>
            <link>https://gurusabarish.medium.com/connect-netlify-cms-with-hugo-website-ede0cc78cfaa?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ede0cc78cfaa</guid>
            <category><![CDATA[netlifycms]]></category>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[hugo]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 12:42:35 GMT</pubDate>
            <atom:updated>2021-09-05T12:42:35.820Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, We are gonna connect your hugo website to netlify cms. Prerequirements: Netlify account, basic knowledge about hugo and netlify cms.</p><h3>What is netlify cms?</h3><p>Netlify CMS is <strong>an open source content management system for your Git workflow</strong> that enables you to provide editors with a friendly UI and intuitive workflows.</p><h3>What is hugo?</h3><p><em>Hugo is a fast and modern static site generator written in Go.</em></p><h3>Hugo project folder structure</h3><pre>- archetypes<br>- content<br>- themes<br>- static<br>- config.yaml</pre><h3>Connect netlify cms with your hugo site</h3><ul><li>Create a folder named as admin inside static folder and create two files named as config.yaml and index.html.</li><li>Paste the below code inside config.yaml file.</li></ul><pre>backend:<br>    name: git-gateway<br>    branch: main # Branch to update (optional; defaults to master)<br>  media_folder: static/img<br>  public_folder: /img<br>  collections:<br>    - name: &#39;blog&#39;<br>      label: &#39;Blog&#39;<br>      folder: &#39;content/blog&#39;<br>      create: true<br>      slug: &#39;{{year}}-{{month}}-{{day}}-{{slug}}&#39;<br>      editor:<br>        preview: false<br>      fields:<br>        - { label: &#39;Title&#39;, name: &#39;title&#39;, widget: &#39;string&#39; }<br>        - { label: &#39;Publish Date&#39;, name: &#39;date&#39;, widget: &#39;datetime&#39; }<br>        - { label: &#39;Description&#39;, name: &#39;description&#39;, widget: &#39;string&#39; }<br>        - { label: &#39;Body&#39;, name: &#39;body&#39;, widget: &#39;markdown&#39; }</pre><ul><li>Paste the below code inside index.html file.</li></ul><pre>&lt;!DOCTYPE html&gt;<br>  &lt;html&gt;<br>    &lt;head&gt;<br>      &lt;meta charset=&quot;utf-8&quot; /&gt;<br>      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;<br>      &lt;title&gt;Content Manager&lt;/title&gt;<br>      &lt;!-- Include the script that enables Netlify Identity on this page. --&gt;<br>      &lt;script src=&quot;https://identity.netlify.com/v1/netlify-identity-widget.js&quot;&gt;&lt;/script&gt;<br>    &lt;/head&gt;<br>    &lt;body&gt;<br>      &lt;!-- Include the script that builds the page and powers Netlify CMS --&gt;<br>      &lt;script src=&quot;https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js&quot;&gt;&lt;/script&gt;<br>    &lt;/body&gt;<br>  &lt;/html&gt;</pre><ul><li>Now, deploy your site in netlify and enable netlify identity in your site settings.</li></ul><h4>References</h4><ul><li><a href="https://www.netlifycms.org/docs/hugo">official docs</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ede0cc78cfaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Send mail to multiple accounts using smtplib]]></title>
            <link>https://gurusabarish.medium.com/python-send-mail-to-multiple-accounts-using-smtplib-2ecd5d576a82?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ecd5d576a82</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 12:32:01 GMT</pubDate>
            <atom:updated>2021-09-05T12:32:01.614Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*J1dpdoOxUJk83cJ-6MQxHA.png" /></figure><blockquote><em>You need to enable lesssecureapps in </em><a href="https://myaccount.google.com/lesssecureapps"><em>your gmail account </em></a><em>to send mails using smtplib.</em></blockquote><p>Python code to send mail to multiple accounts</p><p>Python program to send mail more then one account. We can use python’s smtplib build-in library to send mails.</p><pre>import smtplib<br>from email.mime.text import MIMEText</pre><pre>recipients = [<br>   &quot;example@example.com&quot;,<br>   &quot;example1@example.com&quot;,<br>   &quot;example2@example.com&quot;,<br>]</pre><pre>s = smtplib.SMTP(&quot;smtp.gmail.com&quot;, 587)<br>s.starttls()<br>s.login(&quot;yourmail@gmail.com&quot;, &quot;password&quot;)<br>msg = MIMEText(&quot;&quot;&quot;your body text&quot;&quot;&quot;)<br>sender = &quot;yourmail@gmail.com&quot;<br>msg[&quot;Subject&quot;] = &quot;Mail subject&quot;<br>msg[&quot;From&quot;] = sender<br>msg[&quot;To&quot;] = &quot; .&quot;.join(recipients)<br>s.sendmail(sender, recipients, msg.as_string())<br>s.quit()</pre><h3>Python program to send mail</h3><p>This code will send a mail to only one account.</p><pre>import smtplib<br>from email.mime.text import MIMEText</pre><pre>s = smtplib.SMTP(&quot;smtp.gmail.com&quot;, 587)<br>s.starttls()<br>s.login(&quot;yourmail@gmail.com&quot;, &quot;password&quot;)<br>msg = MIMEText(&quot;&quot;&quot;your body text&quot;&quot;&quot;)<br>sender = &quot;yourmail@gmail.com&quot;<br>msg[&quot;Subject&quot;] = &quot;Mail subject&quot;<br>msg[&quot;From&quot;] = sender<br>msg[&quot;To&quot;] = &quot;receiver@example.com&quot;<br>s.sendmail(sender, &quot;receiver@example.com&quot;, msg.as_string())<br>s.quit()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ecd5d576a82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Display the uploaded CSV file in Django template]]></title>
            <link>https://gurusabarish.medium.com/display-the-uploaded-csv-file-in-django-template-199aa8711695?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/199aa8711695</guid>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 12:17:14 GMT</pubDate>
            <atom:updated>2021-09-05T12:17:14.462Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Here, is the python django code to display the uploaded csv file in django template.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*YXJqmsPvXuovcfkF8YHo7Q.png" /></figure><ul><li>Django template code to upload a csv file. <em>Paste the below code in home.html</em></li></ul><pre>&lt;form method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;<br>  {% csrf_token %}<br>  &lt;input name=&quot;file&quot; accept=&quot;.csv&quot; type=&quot;file&quot; id=&quot;csv&quot; /&gt;<br>  &lt;button type=&quot;submit&quot;&gt;upload&lt;/button&gt;<br>&lt;/form&gt;<br>&lt;table class=&quot;table&quot;&gt;<br>  &lt;tbody&gt;<br>    {% for i in header %}<br>    &lt;tr&gt;<br>      &lt;th scope=&quot;row&quot;&gt;{{ i }}&lt;/th&gt;<br>      {% for j in data|get_item:i %}<br>      &lt;td&gt;{{j}}&lt;/td&gt;<br>      {% endfor %}<br>    &lt;/tr&gt;<br>    {% endfor %}<br>  &lt;/tbody&gt;<br>&lt;/table&gt;</pre><ul><li>Backend code to get and display the uploaded csv file. Paste the below code in views.py</li></ul><pre>def home(req):<br>    if req.POST:<br>        context = {}<br>        reader=csv.DictReader(decode_utf8(req.FILES[&#39;file&#39;]))<br>        for row in reader:<br>            header = list(row.keys())<br>            break<br>        data = {}<br>        for row in reader:<br>            for i in header:<br>                values = []<br>                values.append(row.get(i))<br>                if i not in data:<br>                    data[i] = values<br>                data[i].extend(values)<br>        context[&#39;header&#39;] = header<br>        context[&#39;data&#39;] = data</pre><pre>        return render(req, &#39;home.html&#39;, context)<br>    return(render(req, &#39;home.html&#39;))</pre><ul><li>Paste the below code in url.py</li></ul><pre>from django.urls import path<br>from . import views</pre><pre>urlpatterns = [<br>    path(&#39;&#39;, views.home, name=&quot;home&quot;),<br>]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=199aa8711695" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Host your hugo website using Github pages and Github action]]></title>
            <link>https://gurusabarish.medium.com/host-your-hugo-website-using-github-pages-and-github-action-bc2e2350b528?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc2e2350b528</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[hugo]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 12:03:25 GMT</pubDate>
            <atom:updated>2021-09-05T12:03:25.693Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Create Github account <a href="https://github.com/">here</a>. Then, Create your Hugo website.</li><li>Create a github repo named as your username.github.io and push your whole code to this repo.</li></ul><h3>Build your website using github action</h3><p><strong>Create an action in github from the action tab and paste this code in your action file.</strong></p><pre>name: Build your hugo website</pre><pre>on:<br>  push:<br>  workflow_dispatch:</pre><pre>jobs:<br>  deploy:<br>    # The type of runner that the job will run on<br>    runs-on: ubuntu-latest</pre><pre>    # Steps represent a sequence of tasks that will be executed as part of the job<br>    steps:<br>      - name: Checkout<br>        uses: actions/checkout@v2<br>        with:<br>          submodules: true<br>          fetch-depth: 0</pre><pre>      - name: Install Hugo<br>        uses: peaceiris/actions-hugo@v2<br>        with:<br>          hugo-version: &quot;0.79.0&quot;</pre><pre>      - name: Build<br>        run: hugo</pre><pre>      - name: Deploy to live website<br>        uses: peaceiris/actions-gh-pages@v3<br>        with:<br>          personal_token: ${{ secrets.GITHUB_TOKEN }}<br>          publish_dir: ./public<br>          #external_repository:  gurusabarish/hugo-profile-demo<br>          publish_branch: demo<br>          user_name: Github Actions deployment bot<br>          user_email: githubactionsbot@users.noreply.github.com</pre><p>It will generate all static files of your website and create a branch called demo branch, push the file inside demo branch for each time whenever you update your repo.</p><h3>Connecting your demo branch with github pages</h3><ul><li>Go to your settings tab of the repo. There, you can find the pages tab.</li><li>Go to pages tab and enable github pages and select the source from demo branch.</li></ul><p><em>Now, your site is live at ‘username.github.io’.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc2e2350b528" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS amplify admin queries CreateUser]]></title>
            <link>https://gurusabarish.medium.com/aws-amplify-admin-queries-createuser-52b60b198be8?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/52b60b198be8</guid>
            <category><![CDATA[aws-amplify]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 11:56:54 GMT</pubDate>
            <atom:updated>2021-09-05T11:58:38.054Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*Wqm5wwdBQILjMa6-pPpi6w.png" /></figure><p>Amplify does not generate AdminCreateUser by default. If you want enable AdminCreateUser query, You should do the following steps.</p><ul><li>Create adminQueries API using amplify. <a href="https://docs.amplify.aws/cli/auth/admin">Follow this docs</a></li><li>After successful creation, You can find a folder amplify\backend\function\AdminQueriesxxxx\src. We are going to edit some files inside src folder.</li><li>Create a function called CreateUser inside your cognitoActions.js and don’t forget to export that function. <em>Note: Don’t delete other functions</em></li></ul><pre>async function CreateUser(username, password, email) {<br>  var params = {<br>    UserPoolId: userPoolId /* required */,<br>    Username: username /* required */,<br><br>    DesiredDeliveryMediums: [&quot;EMAIL&quot;],<br>    // (optional) ForceAliasCreation: true || false,<br>    MessageAction: &quot;SUPPRESS&quot;,<br>    TemporaryPassword: password,<br>    UserAttributes: [<br>      {<br>        Name: &quot;email&quot;,<br>        Value: email,<br>      },<br>    ],<br>  };<br><br>  console.log(`Attempting to create user ${username}`);<br>  try {<br>    const result = await cognitoIdentityServiceProvider<br>      .adminCreateUser(params)<br>      .promise();<br>    console.log(`${username} successfully created`); // successful response<br>    return {<br>      message: `${username} successfully created`,<br>    };<br>  } catch (err) {<br>    console.log(err);<br>    throw err;<br>  }<br>}<br><br>module.exports = {<br>  CreateUser,<br>  // other functions<br>};</pre><ul><li>Create an API url in app.js and import the createuser function from cognitoActions.js.</li></ul><pre>const {<br>  CreateUser,<br>  //other functions<br>} = require(&quot;./cognitoActions&quot;);</pre><pre>app.post(&quot;/createUser&quot;, async (req, res, next) =&gt; {<br>  if (!req.body.username) {<br>    const err = new Error(&quot;username is required&quot;);<br>    err.statusCode = 400;<br>    return next(err);<br>  }<br>  if (!req.body.password) {<br>    const err = new Error(&quot;password is required&quot;);<br>    err.statusCode = 400;<br>    return next(err);<br>  }<br>  if (!req.body.email) {<br>    const err = new Error(&quot;email is required&quot;);<br>    err.statusCode = 400;<br>    return next(err);<br>  }</pre><pre>  try {<br>    const response = await CreateUser(<br>      req.body.username,<br>      req.body.password,<br>      req.body.email<br>    );<br>    res.status(200).json(response);<br>  } catch (err) {<br>    next(err);<br>  }<br>});</pre><ul><li>Add this <em>“cognito-idp:AdminCreateUser”</em> in <em>Resources.lambdaexecutionpolicy.Properties.PolicyDocument.Statement[1].Action</em>. The file you should edit,amplify\backend\function\AdminQueriesc360a2c4\AdminQueriesxxx-cloudformation-template.json</li></ul><h3>Reference and contact</h3><p>In this article, I am also explained these contents. But, the difference is “We are added the json responce”. Catch me on <a href="https://twitter.com/gurusabarishh">Twitter</a></p><ul><li><a href="https://github.com/aws-amplify/amplify-cli/issues/4351">Github issue</a></li><li><a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#adminCreateUser-property">AWS documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52b60b198be8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy your hugo website with Netlify, Github pages and Vercel]]></title>
            <link>https://gurusabarish.medium.com/deploy-your-hugo-website-with-netlify-github-pages-and-vercel-1e2af9bfba4e?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e2af9bfba4e</guid>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[vercel]]></category>
            <category><![CDATA[hugo]]></category>
            <category><![CDATA[github-pages]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 07:21:14 GMT</pubDate>
            <atom:updated>2021-09-05T07:21:14.188Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build your website with “Hugo” comment</h3><p>Go to the terminal and type “hugo” and press enter to build website files with public folder. The public folder is used to deploy your hugo website. Now you should have a folder as the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*JSkBcgtDb_Vvp5NI.png" /></figure><p><em>Note: You should delete the public folder for each time before using hugo comment.</em></p><h3>Deploy your hugo website with Netlify</h3><p>You can easily deploy your website using Netlify. There are two ways to deploy in Netlify. Here,</p><h4>Manual deploy:</h4><ul><li>In manual deploy, you should upload your website to netlify for each and every change. Lets see “how to deploy?”, Now you have the public folder that has the all website files.</li><li>Go to the <a href="https://netlify.com/">Netlify</a> switched to the site tap and drag and drop your public folder and Setup your <a href="https://docs.netlify.com/domains-https/custom-domains/">custom domain</a> in netlify.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*cMYM-zXdlaO7Lpxx.png" /></figure><h4>Deploy from github:</h4><ul><li>You can also use the github as your source. To use this method, you should link your github account in netlify. After connecting, you can create a website from github using the New site from git button.</li><li>Your github repository should have the files same as the public folder. You can push the public folder files in github.</li><li>It will automatically update your website whenever your gihub source code is modify.</li></ul><h3>Deploy your hugo website using Github Pages</h3><p>Github allows to host your static website in github with free domain ( username.github.io ). If you want to deploy your hugo website using github pages, you should have a github account and should know to <a href="https://guides.github.com/features/pages/">setup github pages</a>. In github, also two ways to deploy.</p><h4>username.github.io repository:</h4><ul><li>Create a repository as your username followed by github.io<em>(username.github.io)</em></li><li>Push your public folder files to that github repo.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*bs4z_G1vMxYjFDAh.png" /></figure><ul><li>In setting, enable the github pages.</li><li>Now, you will get a website as your username.github.io</li></ul><h4>Project repository:</h4><p>This repo looks like username/project. You should add <a href="https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/about-custom-domains-and-github-pages">custom domain</a> to your repo to create a website for this repository otherwise it will not work well. You can follow the same as above for further.</p><h3>Deploy without using build(hugo) comment</h3><p>In this method, you can deploy your hugo website without using “hugo build” comment. You should have github repository to suse this method. You don’t need push the public folder to github instead, Push your hole hugo website folder to your github repo. Your repo looks like below image. Here you can use two hosting companies one is Netlify and another one is Vercel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ZL1usiB0QJED1kDA.png" /></figure><h4>Deploy your hugo website in Netlify without using hugo build comment:</h4><ul><li>Add a file in your hugo website folder called netlify.toml and push to your github repo that file contains the below content. For reference <a href="https://github.com/gurusabarish/hugo-profile">this github repo</a></li></ul><pre>[build]<br>publish = &quot;public&quot;<br>command = &quot;hugo --gc --minify&quot;<br><br>[context.production.environment]<br>HUGO_VERSION = &quot;0.76.5&quot;<br>HUGO_ENV = &quot;production&quot;<br>HUGO_ENABLEGITINFO = &quot;true&quot;<br><br>[context.split1]<br>command = &quot;hugo --gc --minify --enableGitInfo&quot;<br><br>[context.split1.environment]<br>HUGO_VERSION = &quot;0.76.5&quot;<br>HUGO_ENV = &quot;production&quot;<br><br>[context.deploy-preview]<br>command = &quot;hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL&quot;<br><br>[context.deploy-preview.environment]<br>HUGO_VERSION = &quot;0.76.5&quot;<br><br>[context.branch-deploy]<br>command = &quot;hugo --gc --minify -b $DEPLOY_PRIME_URL&quot;<br><br>[context.branch-deploy.environment]<br>HUGO_VERSION = &quot;0.76.5&quot;<br><br>[context.next.environment]<br>HUGO_ENABLEGITINFO = &quot;true&quot;</pre><ul><li>Go to your netlify account and create a website from github using the New site from git button.</li><li>It will automatically update your website whenever your gihub source code is modify.</li></ul><h4>Deploy your hugo website in Vercel without using hugo build comment:</h4><ul><li><em>You don’t need to add any extra files to your github repo.</em> Cerate a <a href="https://vercel.com/">Vercel</a> account</li><li>Click the import project button and continue with github</li><li>Paste the github repo URL</li><li>Select the framework as hugo and click the deploy button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*hRhd7gH9QtZ_AATq.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e2af9bfba4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add Hugo pagination for blog or posts in hugo]]></title>
            <link>https://gurusabarish.medium.com/add-hugo-pagination-for-blog-or-posts-in-hugo-c3c328fe192?source=rss-9273e2bae8fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3c328fe192</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[hugo]]></category>
            <dc:creator><![CDATA[Gurusabarish]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 07:13:55 GMT</pubDate>
            <atom:updated>2021-09-05T07:13:55.714Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we are discuss about <strong>‘’’How to set hugo pagination in your website which is generated by Hugo?’’’</strong>.</p><h3>Introduction to Hugo</h3><p>Hugo is a static site generator which helps to build a website easily and looks like a professional developer. Hugo is made with GOLANG and maintaining by <a href="https://github.com/orgs/gohugoio/people">hugo developers</a>. Hugo is the fastest genarators camparitively other static site generators.</p><h4>Why hugo is so popular?</h4><ul><li>You get a strong security for website</li><li>To get a high Performance website</li><li>Ease of use even your are not a developer</li><li>Too many website themes provided by Hugo to make a website instanly.</li></ul><h3>what is pagination?</h3><p>Assume that “you have a 50 blog posts and display this all posts in a single page”. <strong>What will be happen?</strong></p><ul><li>Your website gets slow down</li><li>User may not view the all posts</li><li>Website not looks like a professionial.</li></ul><p>So, we are decide to give a pagination for each 5(your wish) posts. Pagination will display the given number of blog posts. So, we can easily overcome the above problems using pagination.</p><h3>Hugo’s Internal Pagination</h3><p>Hugo provides a internal pagination. Here, we are look into “how to use that internal pagination to your hugo website”.</p><p>Lets move into coding part. Ausume that your list page code looks like or something like this.</p><pre>{{ range .Pages }}<br>&lt;a class=&quot;text-decoration-none&quot; href=&quot;{{ .Permalink }}&quot;&gt;<br>  &lt;div class=&quot;card-body&quot;&gt;<br>    &lt;div class=&quot;text-xs font-weight-bold text-primary text-uppercase mb-1&quot;&gt;{{ .Title }}&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/a&gt;<br>{{ end }}</pre><p>If you want to add pagination, you should change the code as below and <strong>add Paginate count(Paginate: 5) in your config file.</strong> Paginate count decide “How many blog posts should be present in a page”.</p><pre>{{ range .Paginator.Pages }}<br>&lt;a class=&quot;text-decoration-none&quot; href=&quot;{{ .Permalink }}&quot;&gt;<br>  &lt;div class=&quot;card-body&quot;&gt;<br>    &lt;div class=&quot;text-xs font-weight-bold text-primary text-uppercase mb-1&quot;&gt;{{ .Title }}&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/a&gt;<br>{{ end }} {{ template &quot;_internal/pagination.html&quot; . }}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3c328fe192" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>