https://www.digitalocean.com/community/tutorials/how-to-set-up-http-authentication-with-nginx-on-ubuntu-12-10
Monday, 18 August 2014
How To Set Up HTTP Authentication With Nginx
Nginx configuration file error
When restarting nginx after a configuration file change, if you get an error message that the configuration file has an error, you can get more info about the error with:
sudo nginx -t
sudo nginx -t
Tuesday, 5 August 2014
To get a mysql formatted datetime using javascript:
I couldn't find a simpler jQuery solution to this.
If you want the time according to the user's time zone, remove the "UTC" in the second last line of the code.
**
* You first need to create a formatting function to pad numbers to two digits…
**/
function twoDigits(d) {
if(0 <= d && d < 10) return "0" + d.toString();
if(-10 < d && d < 0) return "-0" + (-1*d).toString();
return d.toString();
}
/**
* …and then create the method to output the date string as desired.
* Some people hate using prototypes this way, but if you are going
* to apply this to more than one Date object, having it as a prototype
* makes sense.
**/
Date.prototype.toMysqlFormat = function() {
return this.getUTCFullYear() + "-" + twoDigits(1 + this.getUTCMonth()) + "-" + twoDigits(this.getUTCDate()) + " " + twoDigits(this.getUTCHours()) + ":" + twoDigits(this.getUTCMinutes()) + ":" + twoDigits(this.getUTCSeconds());
};
I couldn't find a simpler jQuery solution to this.
If you want the time according to the user's time zone, remove the "UTC" in the second last line of the code.
Subscribe to:
Posts (Atom)