Write custom javascript to modify any web pages


Hello. Before diving into this article, first, we need to know few things.

1. What is a Userscript?

A userscript is a program, usually written in JavaScript, for modifying web pages
- wikipedia

2. Why we need a Userscript?

Suppose we wanted to modify the web page dynamically like adding export to PDF button, display the number of words in a page, etc. We can achieve these functionalities by writing custom javascript.

3. How to add Userscript to a web page?

Chrome provides a built-in feature called Snippets, where we can run custom javascript on web pages. I have written an article explaining it in detail. It comes with a limitation that the script cannot be triggered automatically.

4. What is a Userscript Manager?

A userscript…

A data structure to store values with multiple keys in a map


HashMap is a wonderful data structure that stores data in the form of Key-Value pairs that provide insert, update, retrieve, and delete operations in O(1) time.

HashMap has one limitation that it can have only one key. But wait. Why do we need multiple keys for a single value? Let us look at an example.

Suppose we want to look up the marks of a student by Student, Exam, and Subject. The typical solution is to create a Nested Map like below.

Build complex objects step by step

Let’s say we want to create an Employee class that has the below mandatory and optional attributes.

Mandatory Attributes

  • firstName
  • lastName
  • primaryMobileNumber
  • primaryEmail

Optional Attributes

  • secondaryMobileNumber
  • secondaryEmail

The Employee class and its constructor looks like below

Easy way to inspect sites on a mobile device

I was recently creating my responsive portfolio website and was testing it on my mobile. I wanted to inspect few elements. I thought there is no way to do that. But I came to know that there is a way. In this article, we will see how to debug a website on a mobile device.

1. Enable USB Debugging

  1. First, we need to enable USB Debugging on our mobile.
  2. To do the Developer Options should be enabled. To enable Developer Options, go to About Phone and click Build Number 5 times.

Easily integrate with your Portfolio, Twitter, and more

In modern years, many Digital Creators like Youtubers, Blog Writers, Ghost Writers have emerged a lot. There are so many ways to monetize their content. For example, Youtube has a Patreon option where subscribers can donate money to the Youtubers. But there are very limited options for other content creators to get support from the audience.

Here comes the lifesaver, Buy Me a Coffee. It offers seamless integration with our portfolio sites, share on Twitter and Facebook, etc. In this article, we will be creating a Buy Me a Coffee account and integrate it with the portfolio site.

Create a Buy Me a Coffee Account

Setting up…

Revisiting the clock that I created 4 years back

HTML5 provides us with the Canvas API which can be used to draw graphics on a browser using Javascript. We can start drawing graphics in the browser by just adding a canvas tag in HTML. It is similar to the real canvas that we use to paint. We can draw various shapes and texts and animate them using Javascript.

In this article, we will be using HTML5 Canvas and Javascript to create a beautiful clock.

Add HTML — Layout

First, we will start by adding an HTML file with a canvas tag

Hidden Python features that you may not know

Python is one of the easiest languages to learn. I got attracted by Python during my college because of its simplicity and ease of learning. Though it is simple to learn, it is one of the powerful languages too. It is quite famous for complex tasks like Machine Learning, Image Processing, NLP, etc.

In this article, we will be looking into the 10 hidden and coolest features of python which many people (I was one of them 😉) may not have heard of.

1. For Else

We all knew about the if-else in programming. …

Hidden Python features that you may not know

This is the continuation of the previous article where we saw 5 coolest features of Python. Please do read it here if you haven’t read it. In this article, we will be seeing another 5 coolest features of Python

6. Dictionary Comprehension

We all know about one of the best features of Python, List Comprehension. Please do check out this article, where I solved famous Leetcode problems using List Comprehension.

Dictionary Comprehension is similar to List Comprehension. Here we use dictionaries instead of lists.

Consider we want to generate the squares of N numbers in the form of a dictionary, where the key…

A beautiful platform to setup personal blog sites

Last year, I started writing blogs on Medium. During that time I was searching for ways to create my own site for listing my blogs. All I ended up with was setting up a Wordpress site which has both free and premium version. Personally, I did not like the themes provided in the free version. So, I created my own portfolio site, where I added the blogs that I wrote on Medium.

Recently, I came to know about Hashnode, a simple and easy platform to set up a blog site in minutes. You can even customize your hashnode site to…

Host static websites with a custom domain and free SSL certificate

Hello everyone. In this article, we will host my personal portfolio site using Github Pages, map a custom domain name and add a free SSL certificate.


Setup Github Pages

  1. Login into Github.
  2. Create a new repository with the name <github_username>.github.io
  3. Push your website code to the repository. It should have an index.html file in the root directory.

Ganesh Kumar Marimuthu

SDE II at Amazon. ✍️ Blog Writer 🔸 👨‍💻 Full Stack Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store