Vimium is a chrome extension that provides keyboard shortcuts for web page navigation. So, if you also love mouseless browsing just like me, then you will definitely find vimium useful. Just to give an insight, for example, pressing f key will show a shortcut key corresponding to every link on the web page. Pressing the […]
We use “git log” many times a day while using Git in our projects. Sometimes we need to list Git commits between specific dates. Although, Git provides command to do this but the syntax is too long to type. So I created a script named timesheet, which facilitates us to display Git commits between two specific […]
Node.js is single threaded so it runs one process on a single CPU, as the power of Node.js is its performance and speed it doesn’t seem good to use only one CPU in a multi-core system. For utilizing all the CPUs, Node.js allows us to create a network of processes that all shares the same […]
In my recent project, I needed to copy the redis database from one server to another. Although redis provides SAVE and BGSAVE commands, I found another cool way of doing it. Log in to the new server and execute the following command in terminal: [bash] redis-cli slaveof IP-ADDRESS-OF-OLD-SERVER 6379 [/bash] The above command starts replicating […]
We are assuming that you have installed js2 in your system, in case if you have not installed js2, first install js2. First of all create a InheritanceTest.js2 file in scr directory with the content given below: [js] class Person { // Parent class var firstName; var lastName; function initialize(firstName, lastName) { // Constructor this.firstName […]
We are assuming that you have installed node.js in your system, in case if you have not installed node.js, first install node.js. To install js2 run the command given below: [bash] npm install js2 [/bash] Let’s create a simple Hello World project, but first let’s create a project directory structure: [bash] mkdir helloWorldJs2 cd helloWorldJs2 […]
In my previous post, I explained how to get started with node.js and executing your first script with node. Now in this tutorial, we will go a step ahead and learn using Expressjs and MongoDB. For people who are new, Express is a web application framework for node which provides a set of features that […]
In this tutorial i will walk you through the installation of node.js on your Linux system and executing your first script with node. To get started goto the official node.js website and download the Linux Binaries file (as shown in the screenshot below) according the bit version of your system. Save the downloaded file in […]
We were facing problem at time of creating Static properties in any Object in JavaScript as there is not any direct method to create static properties. For example if we want to create a static property in an array object and we want it to be same for every other object without storing the property […]
Arrays in JavaScript are daunting and particularly difficult in nature. The fundamental reason for making this statement is that JavaScript does not provide as many functions/methods for array operations as several other languages do. As a result, an array operation as simple as removing duplicate elements from an array may also be particularly intimidating. A […]