I've been developing in PHP for a while now, mostly iZeit, my PHP calendar script, but also the odd smaller script and I've picked up a few things along the way.
Quotes vs. Double Quotes
Anything in double quotes is parsed by PHP and variables are replaced. So if you’re concatenating things, use single quotes instead:
$name = 'Bob';
echo 'Name is '.$name; // Name is Bob
echo "Name is $name"; // Name is Bob
echo 'Name is $name'; // Name is $name
echo "Name is ".$name; /* Name is Bob, but wastes processing
time because the non dynamic part of the statement is parsed for variables. */
Check whether a variable's set first
There are times when if you try to use a variable that isn't set, PHP will throw an error at you.
$param = isset($_GET['param']) ? $_GET['param'] : NULL;
Using shorttags
I have no idea why they even added shorttags. Using <?php ?> instead of <? ?> will make your scripts run on alot more servers which don't have short tags enabled in php.ini.
The one thing missing from Google was a catch-all feature, where you could specify a default address so that email sent to anything@yourdomain.com would go to an address you specify. That was until I found out they'd actually added the feature a few months ago. You can set it up under the 'Domain Settings' tab by clicking the 'edit' button next to 'Advanced Settings'. There's a chance you'll just get loads of spam by setting up a catch all address, but if you have a surname like mine which people never spell right, they can spell it however they want and the email will still get to me.
Steve Jobs announced the iPhone at his Macworld keynote speech today, rumored to exist for the last year, it'next big thing from Apple. It has a widescreen multi-touch screen, which isn't a touch screen but a "revolutionary user interface". It’s anyone's guess what Apple mean by that, but it certainly looks interesting.

The iPhone has an impressive specification and runs a slimmed down version of OSX, so it’s sure to offer plenty of eye candy. It has built in WiFi, Bluetooth and EDGE aswell as a 320×480 screen and a 2Megapixel camera. Two versions will be available, a 4GB for £257 and an 8GB for £309.
Pictures at Gizmodo
If you spend alot of time on forums, there’s an easy way to make a panel of clickable images which copy the location of the image to your clipboard so you can paste it onto a forum. It’s good for emoticons or anything else which takes a while to type out. You can arrange the images any way you want, then add the following piece of Javascript to the head:
<script type="text/javascript">
function toclip(iurl) {
if(document.getElementById('forum').checked) {
var imgtext = '[img]'+iurl+'[/img]';
} else {
var imgtext = '<img src="'+iurl+'" alt="" />';
}
if (window.clipboardData) {
window.clipboardData.setData("Text", imgtext); //IE
} else if (window.netscape) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var clip = Components.classes['@mozilla.org/widget/clipboard1'].
createInstance(Components.interfaces.nsIClipboard);
if (!clip) return;
var trans = Components.classes['@mozilla.org/widget/transferable1'].
createInstance(Components.interfaces.nsITransferable);
if (!trans) return;
trans.addDataFlavor('text/unicode');
var str = new Object();
var len = new Object();
var str = Components.classes["@mozilla.org/supports-string1"].
createInstance(Components.interfaces.nsISupportsString);
var copytext=imgtext;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;
if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);
}
// alert("Following info was copied to your clipboard:\n\n" + iurl);
return false;
}
</script>
Then to copy the text to the clipboard when the icon is clicked, call the function with Javascript:
<a onclick="toclip('http://url//of/image.gif');"
href="#"><img src="image.gif" alt="Woot" /></a>
The function works fine with IE, but to get it working in Firefox, you need to allow Firefox clipboard access. Type about:config into the address bar, then 'signed' as the filter, and set the value to true.
I've been running Vista and XP side by side for a few months now, and what I designated as a small partition has slowly got bigger and bigger until there was no space left on my Vista partition, so today I decided to re-jig my partitions. No problem, but due to the lack of partition managers for Vista, I had to boot back to XP and fire up Partition Magic. The problem started when I tried to boot back to Vista, which gave me loads of errors about files not being found before refusing to boot. I was pretty baffled by this point, because from XP I could see that the files that Vista was complaining were missing were right there where they were supposed to be. To fix Vista, I had to boot from the install CD and use the automated recovery tool, but then when I started Vista, my drive letters were all wrong. Now I could see which partitions matched which drive letters, but windows wouldn’t let me change them because they were for the system drive. After a good two hours of trawling through technet, I eventually found a solution:
1. Go to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
2. Find the drive letter you want to change to (new). Look for "\DosDevices\C:".
3. Rename it to an unused drive letter "\DosDevices\Z:".
This frees up drive letter C.
4. Find the drive letter you want changed. Look for "\DosDevices\D:".
5. Rename it to the appropriate (new) drive letter "\DosDevices\C:".
6. Click the value for \DosDevices\Z:, click Rename, and then name it back to "\DosDevices\D:".
MS KB article
I checked my server logs last night, just to see if there was anything interesting. I use two different domains, one for my blog and one for images I use on forums and the like, so the logs for mi6.nu, my images domain are like a breadcrumb trail of my last month's browsing. I was pretty surprised to see a few URLs I'd never heard of as the referrers. A finnish site about Lordi was one and MySpace.com was the other. I hate MySpace, and there's no way I'd have wasted my bandwidth hosting pictures for it. The images being linked was Contemplating Existence, a wallpaper I made last year. Some Idiot was using the image as his background. It's great that he liked my wallpaper but firstly it's my property, he can't use it without my permission, and secondly, it's over 200KB, and was loaded 350 times in December. That's 65MB of bandwidth I've paid for!
I decided to teach the leech a lesson using .htaccess (info in read more), which lets you serve up a different image for specified referrers. Inspired by a recent blog post I'd read, I thought the Goatse pic would be a good choice. For anyone that doesn't know, Goatse was a site available at the turn of the millenium which scarred millions of impressionable AOL kiddies. Now whenever someone from an external site tries to use one of those images, they'll get a nice surprise. Let that be a lesson to anyone else who's thinking of leeching my bandwidth!
Read more »

Each bug is a real bug, with it's carbon guts removed, and metal/silicon guts put in their place by artist Mike Libby. “He spent his youth developing a keen understanding of the material world looking under rocks, dismantling appliances and practicing alchemy with ingredients found under the kitchen sink.”
Insect Labs [Via: HackedGadgets]