extract bz2 linux

extract bz2 linux

tar -xf archive.tar.bz2Copy Here is what the above code is Doing: 1. The tarfile module makes it easy to create and extract tar archives. 2. The first argument to tarfile.open() specifies that we want to create a tar archive. 3. The second argument is the name of the tar archive we want to create. 4….

axios check if call is already running

axios check if call is already running

var numberOfAjaxCAllPending = 0; // Add a request interceptor axios.interceptors.request.use(function (config) { numberOfAjaxCAllPending++; // show loader return config; }, function (error) { return Promise.reject(error); }); // Add a response interceptor axios.interceptors.response.use(function (response) { numberOfAjaxCAllPending–; console.log(“———— Ajax pending”, numberOfAjaxCAllPending); if (numberOfAjaxCAllPending == 0) { //hide loader } return response; }, function (error) { numberOfAjaxCAllPending–; if (numberOfAjaxCAllPending…

pm2 typescript

pm2 typescript

## Add the new typescript dependency in PM2: pm2 install typescript ## Start app.ts in watch & restart: pm2 start app.ts –watch Here is what the above code is Doing: 1. Install the typescript dependency in PM2 2. Start app.ts in watch & restart mode Now, if you make any changes to app.ts, PM2 will…

array compare detailed

array compare detailed

var a1 = [1,2,3]; var a2 = [1,2,3]; console.log(a1==a2); // Returns false console.log(JSON.stringify(a1)==JSON.stringify(a2)); // Returns true Here is what the above code is Doing: 1. We are creating two arrays a1 and a2. 2. We are comparing the two arrays using == operator. 3. We are comparing the two arrays using JSON.stringify() method. The ==…

como saber si un afecha es mayor o menor js

como saber si un afecha es mayor o menor js

let date1 = new Date(2019, 08, 07, 11, 45, 55); let date2 = new Date(2019, 08, 03, 11, 45, 55); if (date1.getTime() < date2.getTime()) document.write("date1 is lesser than date2"); else if (date1.getTime() > date2.getTime()) document.write(“date1 is greater than date2”); else document.write(“both are equal”); Here is what the above code is Doing: 1. We are creating…