Save Your Images to imgur and use URL in blog

When creating blog posts on my Hugo site, I used to run into requirement of adding image - there are 2 choices: Put the image as static file in my site Should I use a public URL from a quick Google search (hosted by someone else!) I decided to go with a 3rd option - host my own image on cloud and use its URL. Doing it with imgur. It allows unlimited storage with limit of 50 uploads per hour....

April 26, 2022 · 2 min · Anant

Minimum Safe Integer in JavaScript

What is the smallest number that can be represented without a problem in JavaScript, for integers? Number.MIN_SAFE_INTEGER is a constant in JS that represents the smallest possible value that can be safely used, that is (-(2^53 - 1)) or -9007199254740991 For values smaller that this, BigInt can be used “Safe” refers to the ability of JavaScript to represent integers exactly and to correctly compare them. Example: Value of Number.MIN_SAFE_INTEGER value = Number....

April 26, 2022 · 1 min · Anant

How to kill all Chrome processes on Windows

Sometimes all those open Chrome tabs may be too much for your RAM to handle. Use the following on your Powershell to kill all chrome services: taskkill /F /IM chrome.exe

April 25, 2022 · 1 min · Anant

Bash Script to switch Git Configs

I have following global git configs: git config commit.gpgsign # true for work, false for personal git config user.name # different for work(global) and personal git config user.email # different for work(global) and personal Assuming the default(global) git config is my work related configs, which I dont want to use for personal git repos So I can switch to personal every time I work on a personal project. To change all the 3 with predetermined values, use following shell script....

April 22, 2022 · 2 min · Anant

Bash Script to create new page (MD File) in Hugo

Based on the way described in a previous article, following shell script can be run to create new md file (new blog post) based on archetype. #!/bin/sh echo "Enter post title (.md will be automatically added)" echo "Post title: " read posttitle hugo new -k post posts/$posttitle.md running this will create a new md file in /content/posts based on the archetype in /archetype Create a file called new.sh and place this ....

April 22, 2022 · 1 min · Anant