Javascript hoisting example

<head>
<title>Hoisting example</title>
</head>
<body>
    <h1>Hoisting in action</h1>
    <script type="application/javascript">
        var hoisting = "global variable";
        (function(){
            confirm("\"" + hoisting + "\"" + " click OK" );
            var hoisting = "local variable";
            alert(hoisting);
        })(); //self-executing function 

     //Best practice - declare local variables at the beginning of the function 
    </script>
</body>

The alias way to backup mysql database from command line

Tired of searching for the right command every time you need to back up a MySql database via mysqldump. Well make an alias out of it, and it should work for a while. Continue reading