Here are a few of my resolutions for 2011, hopefully if I remember I’ll try to tick them off throughout the year.
Learn Ruby on Rails. I’ve wanted to learn RoR for a while now, but I’ve had the need. However, RoR is gaining a lot of popularity among clients. Another need reason to learn it is nanoc, a really neat web publishing system which is much suitable for small business websites.
Contribute more to GitHub and Google Code projects. I’m sure working on small projects semi regularly will benefit my coding skills and help with some cool stuff.
Blog more. I’m hoping for about a post a week, maybe not entirely about programming but still geeky.
Get an Android App into the market. I’ve been playing around with android for a while; it would be nice to make something which I feel is market worthy.
Exercise more, without joining a gym.
Use Linux more. I love Linux, but due to MS Word, Photoshop and games not running well under Wine I keep ending up back on Windows. I might also try and get a Mac at some point, but that’s more of a “Could have” then a “Must have”.
Stop using YouTube & other websites which annoy me. A handful of websites are making small changes which are bugging me, in 2011 I’m going to stop using websites which appear to be trolling me.
Design More. I suck at designing, and a little practise would go a long way.
A few weeks ago I wrote a neat little PHP Class which makes talking to twitter via their API really easy for Socialize This. You can download it and contribute to it, on it’s Google Project homepage. Here are a few quick examples of how to use it:
Update you Timeline (Send a tweet)
$t->updateStatus('Messing about with my Twitter API script');
A few days ago Google opened up their URL shortening service goo.gl to the public. Luckily it is pretty easy to make use of the API and shorten URL’s in PHP. Here is a function I put together which you can make use of.
<?php
// Coded by Mike Rogers (http://www.fullondesign.co.uk/) 1st October 2010.
function shorten($url, $qr=NULL){
if(function_exists('curl_init')){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, 'http://goo.gl/api/shorten');
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'security_token=null&url='.urlencode($url));
$results = curl_exec($ch);
$headerInfo = curl_getinfo($ch);
curl_close($ch);
if ($headerInfo['http_code'] === 201){ // HTTP Code 201 = Created
$results = json_decode($results);
if(isset($results->short_url)){
$qr = !is_null($qr)?'.qr':'';
return $results->short_url.$qr;
}
return FALSE;
}
return FALSE;
}
trigger_error("cURL required to shorten URLs.", E_USER_WARNING); // Show the user a neat error.
return FALSE;
}
// Example: Just the Short URL
echo shorten('http://www.google.com/');
// Example: Give the Short Code URL and image it.
$qrURL = shorten('http://www.google.com/', TRUE);
echo '<img src="'.$qrURL.'" />';
?>