

Check whether a file exists or not in a Google Cloud Storage bucket using gsutil
The gsutil stat command provides a strongly consistent way to check for the existence (and read the metadata) of an […]

Aggregated free testnet faucets for all blockchain networks
A Curated list of Testnet faucets for Ropsten, Goerli, Kovan, Polygon/Mumbai, FantomTest, Sokol, Aurora etc. Networks Etherspot Etherspot testnet PoA […]

Android — Basic Hilt setup with viewmodel + fragment
Hilt is a modern android DI framework for dependency injection. It is merely a wrapper around Dagger2. Forget dagger-android, hilt brings […]

How to install a specific nodejs version according to the workspace with pnpm?
You install a particular version of nodejs according to a workspace with pnpm. For installation, you need a .npmrc file. Steps Create […]



Android — Instrumentation test with hilt
Testing in Android has been a pain from the beginning and there is no standard architecture setup to execute the […]

Android Utility belt — Collection of dependencies for a greenfield project
[ Originally published at https://mahendranv.github.io/posts/android-gradle-deps-kit ] Starting an android project will bring in a new set of challenges 👀 aka […]

Access JavaScript property case-insensitively
You can alternatively already provide the searchKey in lowercase. If you want it as a function: If the key can’t […]

How to read command line arguments in NodeJS?
Let’s assume you are passing a few values from the command line when you are running a node command. These […]

Sort the list of file names using ls command
To list only the file names using ls command we can pass -a option to it. You can sort the […]

Flatten an irregular list of lists in Python
Let’s say I would like to flatten an irregular list of lists. First approach is by using collections.Iterable where x […]

Split a list into evenly sized chunks in Python
where l is the list and n is the number of items in a chunk. Use xrange() instead of range() in the case of […]

Create a flat list out of a list of lists in Python
Let’s take a list of lists. To merge this lists to a flat list you can use the following ways. […]

Rename keys in an array of objects using JavaScript
I have an array of country objects. In this array I would like to replace the key name with country. […]

TypeError: ‘str’ object does not support item assignment – Python error – How to fix?
Python strings are immutable and they cannot be changed during the course of Python program execution. In Python, strings cannot […]

Warning: Each child in a list should have a unique “key” prop – How to fix this react error?
When creating a list in the UI from an array with JSX, you might get this error. To fix this […]

Kill all processes running on a port in Linux
To kill all processes running on the port 8080:

Update counter on click of button in React
In this example, the counter is updated every time the user clicks on the Update Counter button, the page is refreshed and […]














Generate random string with only numbers or alphabet in JavaScript
This is a simple approach to generate random string with either numbers or letters using a predefined set.

TypeError: Router.use() requires a middleware function but got a Object – How to fix this Express/Node.js error?
TypeError: Router.use() requires a middleware function but got a Object – How to fix this Express/Node.js error? You would typically […]

Append text to file in Go
Syntax Examples An example from Github.

Reading an array of N elements in C#
The first line contains N, the number of elements. The next line contains N space-separated integers.

Replace all occurrences of a string in Go
To replace all occurrences of a string in a string, we can use strings.ReplaceAll function. It returns a copy of […]




Select rowid along with all other columns from a table in Oracle database
To select rowid along with all other columns from a table, just use an alias and get the columns using […]

How to clear the Material UI text field Value in React?
To clear the Material UI text field Value in React, we can set the value property of the input to an empty […]

How to change the page title with JavaScript?
To change the page title with JavaScript, we can set the document.title property. This can be useful if you want to change […]

How to get the size of the database in PostgreSQL?
SELECT pg_size_pretty( pg_database_size('dbname') );

TypeError[ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.json” – How to fix ?
Since ES6 when you try to import JSON file you might face this error. To fix this error simple add […]

Kill all blocking objects in Oracle database
To list down all blocking objects with status as ‘is blocking’, we can run the following query. There is a […]

View processes list in tree format in Linux
pstree is a command that shows the running processes as a tree. It is used as a more visual alternative […]

Get home directory of logged in user in Shell
Using a built-in variable: Using a tilde:

Get current user in Shell
Using a built-in variable: Using a command:

Filter on all fields in an array of objects
We know how to filter on an array of objects on specific fields. In some cases we might want to […]

Get the number of processors in Linux and MacOS
This command queries the configured processor values using the getconf command. Example


How can the default node version be set using NVM?
To view the list of NVM installed in your machine: To make an NVM version default:

Round a decimal number to nearest decimal that is divisible by 5 in JavaScript
I would like to convert 1.2 to 1.5 and 1.7 to 2. This is basically rounding a decimal number to […]

Error: algorithms should be set – JWT Error – How to fix?
To fix the error – Error: algorithms should be set – just add the algorithms to the JWT constructor.

Play a Youtube video using pywhatkit in Python
The playonyt() function in pywhatkit module is used to play a Youtube video either from a URL or from a […]

SyntaxError: Cannot use import statement outside a module – How to fix this error in Node.js?
SyntaxError: Cannot use import statement outside a module – This error occurs when you use ES6 imports in your node.js […]

ER_CANNOT_RETRIEVE_RSA_KEY – error when connecting to MySQL with MariaDB npm package. How to fix?
When you connect to a MySQL Database with MariaDB npm package you might face this error. To fix this just […]
How to install a specific nodejs version according to the workspace with pnpm?
You install a particular version of nodejs according to a workspace with pnpm. For installation, you need a .npmrc file. Steps Create […]
Curly hair, very fair, please share :)
Android — Basic Hilt setup with viewmodel + fragment
Hilt is a modern android DI framework for dependency injection. It is merely a wrapper around Dagger2. Forget dagger-android, hilt brings […]
Aggregated free testnet faucets for all blockchain networks
A Curated list of Testnet faucets for Ropsten, Goerli, Kovan, Polygon/Mumbai, FantomTest, Sokol, Aurora etc. Networks Etherspot Etherspot testnet PoA […]
Check whether a file exists or not in a Google Cloud Storage bucket using gsutil
The gsutil stat command provides a strongly consistent way to check for the existence (and read the metadata) of an […]
One line PowerShell scripts to start MS Office apps to start with blank documents
To start a blank PowerPoint presentation: To start a blank Word document: To start a blank Excel document: To start […]
Optional Chaining in JavaScript
Have you ever had to check for the existence of objects or arrays before accessing its properties using && ? […]
Importing JSON into a MongoDB collection
Use the mongoimport utility to import data into a MongoDB database. MongoDB provides the mongoimport utility that can be used to import JSON, CSV, […]
Differences between java.util.Date and java.sql.Date in Java
Handling dates is tricky in Java just like handling JSON in Java. This confusion lets developers use libraries like Joda […]
Unsupported projection option: sort – Mongoose error – How to fix?
UnhandledPromiseRejectionWarning: MongoError: Unsupported projection option: sort is an error that is thrown when you pass sort options into mongoose schema […]