Docker file for Express App with PM2
FROM node:10 WORKDIR /usr/src/app COPY package*.json ./ RUN npm install pm2 -g RUN npm install COPY . . EXPOSE 8080 CMD ["pm2-runtime", "server.js"] I hope
FROM node:10 WORKDIR /usr/src/app COPY package*.json ./ RUN npm install pm2 -g RUN npm install COPY . . EXPOSE 8080 CMD ["pm2-runtime", "server.js"] I hope
Let us see an example of how to calculate the difference between dates using Javascript. First, write an HTML code with Javascript as below: const
Array.ForEach is about 95% slower than for() in for each for Arrays in JavaScript. So, don’t use: var data = []; arr.forEach(function (item) { data.push(item);
Here is the simple JavaScript code snippet to check if the given number is an odd or even number. Function to check Number Is Odd
jQuery make it easy to preload images in the background so visitors won’t have to wait forever when they would like to display an image.
$('.btn').hover(function(){ $(this).addClass('hover'); }, function(){ $(this).removeClass('hover'); } ); I hope you like this Post, Please feel free to comment below, your suggestion and problems if you
Occasionally we have times when we have broken image links on our website and replacing them one by one isn’t easy, so adding this simple
var sometext = "here is more HTML"; $("p#text1").append(sometext); // added after $("p#text1").prepend(sometext); // added before I hope you like this Post, Please feel free to
var maxheight = 0; $("div.col").each(function(){ if($(this).height() > maxheight) { maxheight = $(this).height(); } }); $("div.col").height(maxheight); I hope you like this Post, Please feel free to
$("a[href='#top']").click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); I hope you like this Post, Please feel free to comment below, your suggestion
$("a").on("click", function(e){ e.preventDefault(); }); I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we
if ($('#myElement').length > 0) { // it exists } I hope you like this Post, Please feel free to comment below, your suggestion and problems
if($('#myDiv').is(':empty')) { // do something } I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face
$('#element').hover( function(){ $(this).addClass('hover') }, function(){ $(this).removeClass('hover') } ) I hope you like this Post, Please feel free to comment below, your suggestion and problems if
WebFontConfig = { google: { families: [ 'PT+Sans:400,400italic:latin', 'Ubuntu:300,400,500:latin' ] } }; var cb = function() { var wf = document.createElement('script'); wf.src = '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; wf.type