Showing posts with label Tech. Show all posts
Showing posts with label Tech. Show all posts

Sunday, September 14, 2014

Choosing browsers for different purposes

I am a Mozilla fan and I use mozilla products firefox & thunderbird. Being a developer also I prefer firefox. For using google products chrome/chromium(a open source project) obviously a best choice.

Chrome uses webkit which renders better feel specially the new HTML5 elements and the new CSS3 features. Chrome & Safari both uses Webkit whereas Firefox uses Gecko. Though chrome has moved to a new engine Blink which is a fork from Webkit browser engine. Safari also uses Webkit. Another browser that recently have come to attention is the Maxthon cloud browser which is also on webkit, and seems a modified version of chromium. Following is a detailed information about which browser uses which engines:
  • Firefox and other Mozilla browsers use Gecko. 
  • Chrome uses its own fork from Webkit named Blink starting from 2013/04/03 (as they have annouced). 
  • Safari, Maxthon & Konqueror use Webkit. 
  • Internet Explorer uses Trident. 
  • Opera 9+ uses Presto

Now if you are browsing some websites regularly which is based on some good graphics on HTML5 extensively then you must use chrome instead of firefox as chrome renders better graphics and heavy javaScript work than firefox. Safari is good but if you are using OS other than Mac its of no use cause there is no option to use it on any linux distro and on windows they have stopped further development.


Chrome/Chromium uses more system memory to give smooth user experience where firefox uses moderate amount of system resources. Alternative to chrome you can try Maxthon which is good webkit based browser, it is stable and can render HTML5 flawlessly.


Other than these popular rich browsers sometime I prefer some light weight browsers like K-Meleon, QtWeb

Tuesday, November 19, 2013

Server clock on client side using JS + PHP

A small piece of code(js + PHP) which will help you to get the server clock in browser using js on a global variable. It may be helpful when your are building some activity/tracker kind of application using js.


<script type="text/javascript">
    <?php date_default_timezone_set('Asia/Calcutta'); ?>
    var i = 0;
    var servDate = '<?php echo date("Y/m/d/H/i/s", time()); ?>';
    var servDateArray = servDate.split('/');
    var serverTimestamp = '';

    function serverClock()
    {
        var now = new Date( 
            Number(servDateArray[0]), 
            Number(servDateArray[1]), 
            Number(servDateArray[2]), 
            Number(servDateArray[3]), 
            Number(servDateArray[4]), 
            Number(servDateArray[5]) + i
        );
        i++;
        
        var secs = now.getSeconds();
        var mins = now.getMinutes();
        var hr = now.getHours();
        var date = now.getDate();
        var month = now.getMonth();
        var year = now.getFullYear();
        
        var finaldate = year
                            + '-' + ((month < 10) ? "0" + month : month) 
                            + '-' + ((date < 10) ? "0" + date : date);
        var finaltime = ((hr < 10) ? "0" + hr : hr) 
                            + ':' + ((mins < 10) ? "0" + mins : mins) 
                            + ':' + ((secs < 10) ? "0" + secs : secs);
        
        serverTimestamp = finaldate + ' ' + finaltime;
        // console.log(serverTimestamp);

        setTimeout('serverClock()', 1000);
    }

    window.onload = serverClock;
</script>

Saturday, September 15, 2012

One very basic file manager for the web

This is a  very basic app to manage (upload / download and delete) files to the remote server. This needs only php and a web server to run. This is basically a single php file which does the all. To configure the store dir (which will contain the uploaded files) you need to write down the path under $config variable in the same php file(one default value is there).
May be this app seems very insecure for the WEB but I have written it just to take files using HTTP from my home system to my mobile(and the way other) using wifi, and its fast.

This piece of code may help you too may be for some other purpose, please don't forget to reply to this post about your purpose if you are using this file manager.

Download: https://github.com/pras9/fmanager