Archive > July 2010

Manso Trick: Pad a number with leading zeroes in javascript

I was missing a simple and elegant method for padding a number with leading zeroes in javascript. A typical example of leading zeroes is when you want to show the current time and you want the time to be formatted like hh:mm. There is no problem when it’s 12:40, but when is five minutes past […]

Continue reading

, , ,

How to get user-agent in Google App Engine using Python

User-Agent tells which is the client application that is making the request. It tells if it’s a browser (and information which browser it is), if it’s a robot (for example a Google/Yahoo/Bing spider), …  In theory the string is present in all HTTP headers, no matter which client is doing the request, but it might […]

Continue reading

, ,