Changing the default Mac screen shot image type

I recently had the need to change the default Mac OSX takes it’s screen shots in. There’s some occasions where you need more quality than PNG and some occasions where you need a file anyone can open and simply don’t want PNG as your default. Well, in OSX 10.4 and onwards you can change the…

Adding an unsubscribe link to a Magento newsletter template

A quick tip for Magento developer’s here, in how to add an unsubscribe link into a newsletter template so that the person can unsubscribe from the newsletter if they chose to do so. Simply add {{var subscriber.getUnsubscriptionLink()}} into your template in order to output the link for the user to unsubscribe. This even works for…

Share on Twitter link

Ever wanted to give your readers, or your client’s readers a chance to share the post quickly on Twitter? The code is straight forward: <a href=”http://twitter.com/home?status=Currently reading ” title=”Click to share this post on Twitter”>Share on Twitter</a> If you’re using WordPress and want to automate this, simply use the following to insert the link to…

301 and 302 redirects with .htaccess

I’ve been asked this question time and time again, so here we are. How to redirect directories and old URL’s to new ones when moving your site from one domain to another, or launching a new version with re-structured URLs. Here’s a sample structure of a re-direct line: Redirect 301 /about.php /about.php here is the…

Force www. in your URL using .htaccess

Insert this into the top of your .htaccess file, making sure that ‘RewriteEngine On’ comes before it: RewriteCond %{HTTP_HOST} !^www.jhuskisson.com Replace jhuskisson.com with your chosen domain and make sure if you are placing any full stops within the first line to enter a backslash before each full stop. This will prevent the code from…

‘Send me a message on AIM’ link

Here’s the code: <a href=”aim:goim?screename=username&message=hello”>Send me a message on AIM</a> Replace username with your required AIM username and ‘hello’ with whatever message you wish to set for the user to send you. You can remove ‘hello’ altogether if you don’t wish to pre-set a message for a user to send you upon clicking the link.…

Re-enabling error reporting in MAMP

For some reason error reporting is turned off by default in MAMP.. So this is how to re-enable it to how it should be. 1. Find your ‘MAMP’ directory in ‘Applications’ 2. Find ‘conf’ and open it up.. 3. Open up php4 or php5 (depending on your enabled version) 4. Line 270 should be something…

Track outbound links for Google Analytics automatically

Place this code before the </body> tag and it’ll track all outbound links that aren’t part of your website. <script type=”text/javascript”> if (document.getElementsByTagName) { var ahrefs = document.getElementsByTagName(‘a’); for (var i=0; i<ahrefs.length;i++) { if (ahrefs.onclick = function () { var track = this.href + ”; urchinTracker (‘/outgoing/’+track.substring(7)); } } } } </script> Simply replace http://www.jhuskisson.com…

From PHP 4 to PHP 5.. PHP Fatal zlib error: imagepng()

Getting this error? PHP Fatal error: imagepng() : gd-png: fatal libpng error: zlib error in example.php on line 10 Fix it easily by changing your compression variable of imagepng, imagegif or imagejpg/imagejpeg into a 1-10 ranged number – instead of the PHP 4 1-100 standard. It should work smoothly now :)…

Never lose visitors from old URLs again

Was coding a script for redirection of old URL’s into new ones for WordPress when I found this plugin. This plugin redirects the old ?p=1 ?page_id=1 URL structure as well as handling feedburner re-direction. Which saved me a lot of time and frustration. It also means converting sites not using permalinks into sites with permalink…