Something that took me a while to figure out was how to drag a marker on a map to a new position and then retrieve it's lat/lng (version 3).
This assumes you have the map variable set as an instance of google.maps.Map and latlng which is the current position to show on the map as an instance of google.maps.LatLng.
There are many tools around that will help cache your web pages to increase speed and performance (most notably Memcached) however these usually require installation on your web server, thus rendering them useless for people who use shared hosting and don't have access to the server.
Using some simple PHP code we can quite effectively cache a webpage, useful for sites that are database driven and have a large amount of queries or high volumes of traffic.
First we need to setup the folder where the cached files are stored, making sure it has read/write permissions (CHMOD to 0777 - see your FTP client documentation on how to do this).
Next create a file called cache.php which contains the following code:
Often I find that generating a random string can be tedious, there seem to be so many ways to do this.
I wrote this simple function to do the work, and it can be easily modified.
You can remove any of the ranges in $characters (for example if you didn't want uppercase letters delete the range('A','Z')) or put in your own array of characters.
Not so long ago this site and other domains hosted on my server were injected with malware PHP scripts that caused all sorts of damage, including amending javascript files to display ads to people who visited my sites.
These 2 bash commands saved my life and I would like to share them with the world.
The first one will find any javascript file that contains the string "eval(unescape" which is the most common way of injecting malicious code. The second is a similar method for PHP files.