Skip to content

Category: Solutions

Find host’s cloud provider in node.js

I came across a npm package called cloud-detect that lets you find the name of the cloud provider in a node.js application. Install the cloud-detect npm package in your node.js […]

Convert character to ASCII code in JavaScript

String.prototype.charCodeAt() method in JavaScript returns the ASCII code of a character from a string. It accepts the index of the characters as an argument and returns the ASCII equivalent of […]

Validate Aadhaar number in JavaScript

Aadhaar is a verifiable 12-digit identification number issued by UIDAI (Unique Identification Authority of India)to the resident of India for free of cost. It’s similar to the Social Security Numbers […]

Slicing in Python

Slicing from a list or string can be achieved in Python using the following syntax. Syntax Examples Slicing from string can be done like..

Configure Outlook email in Redmine

Configure your email Inside your config directory in redmine root directory, create a new file called configuration.yml and configure your SMTP settings for redmine like this. Test and save redmine […]

Closing a browser tab using JavaScript

To close a browser tab we can user window.close() method. window.close() will close the browser tab without any warnings. You can choose to show an alert to let the user […]

Concise arrow functions in JavaScript

Arrow functions were introduced with ES6 as a new syntax for writing JavaScript functions. They let the developers write functions with a simple syntax. All modern browsers support arrow functions. […]

Empty an array in JavaScript

In this post we will discuss the different ways to empty an array in JavaScript. Let’s declare an array for explanation purposes. Setting length to 0 Assigning to empty array […]