Posts

Showing posts from November, 2017

skipping sunday in working day in js

Hi friends I like to share some code to validate the date in number of days along with skipping sunday to validate working day in week. <span id="result"></span> var day= 14; document.getElementById('result').innerHTML = addDays(day); function addDays(day){  var day = parseInt(day);     var weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];         for(var i=0;i<=day;i++){                var dates = new Date();                 dates.setDate(dates.getDate() + i);              //console.log(weekday[dates.getDay()]);        if(weekday[dates.getDay()]=='Sunday'){              console.log('first if');                               console.log(day);                    day = day+1;        }     }            day = parseInt(day);         var datess = new Date();         datess.setDate(datess.getDate() + day);        if(

optimize gzip and leverage browser cache through .htaccess

Recently i was working on YII2 project i used to several gzip code in yii2 to optimize by validating the site through page speed from google.I was able to come out with solution through youtube and taken the code from comment session and added in my .htaccess file.Let me share the code below <IfModule mod_headers.c> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> </IfModule> # Deflate Compression by FileType <IfModule mod_deflate.c>  AddOutputFilterByType DEFLATE text/plain  AddOutputFilterByType DEFLATE text/html  AddOutputFilterByType DEFLATE text/xml  AddOutputFilterByType DEFLATE text/css  AddOutputFilterByType DEFLATE text/javascript  AddOutputFilterByType DEFLATE application/xml  AddOutputFilterByType DEFLATE application/xhtml+xml  AddOutputFilterByType DEFLATE application/rss+xml  AddOutputFilterByType DEFLATE application/atom_xml  AddOutputFilterByType DEFLATE application/javascript  AddOutputFilterB

Holding giant snake by snake expert

Image
Recently in pune tech park ,snake came into the garden they called snake catcher to catch the snake. Please CLICK HERE to view the video