Wootten’s Weblog
Some of the visitors to this site might be aware that I like my t shirts, each with their bold and awesome illustrations. I’m also quite an avid supporter of fairtrade, being involved with fairdos and purchasing fairtrade options such as tea and chocolate where possible. One of the big bugbears my friends and I have always had in the support of the fairtrade movement is that many of the designs put across upon fairtrade cotton products don’t appeal to us at all. Some of these friends are people who are right up there within prominent fairtrade companies, who although avid promoters, won’t wear fairtrade on a day to day basis if it means they have to sacrifice their style. It seems that the fairtrade companies don’t do design and so we’re not given a choice between two similar products. The end result is we’re faced with looking great and feeling a little discontent that the garment isn’t as fantastic as it could be, or feeling great about a product - but not looking so awesome. We’ve often spoken of beginning a fairtrade company that puts out clothing that is both ethically produced and well designed, but held off doing so because it felt a little beyond us. I can say here now that we’ve made the first step in bringing that vision a little closer.
Fair and Bare is a crowdsourcing project which pays out comission to designers who successfully produce t shirt design ideas for fairtrade t shirts. It’s also an attempt for the fairtrade community to lose that somewhat ’serious face’ with which I think they are often associated and relax the shoulders a bit whilst having some fun. We’re currently offering £200 for designs and £50 for design ideas which we think are worth printing up onto fairtrade cotton. We then hope to offer shirts at a somewhat more accessible price than other fairtrade shirts. It’s a fun, small project at the moment, but I hope that we can help rejuvinate an otherwise awesome product and maybe inspire others to do the same.
One of the things that’s bugged me for a while whilst having a website is that at certain times of the year when people might actually like to buy me a gift they’re unable to find my wishlist. This is mainly because they’re simple folk who might not think to check amazon for my name. I’m also signed up with amazon associates, so I decided it could do me well to post my wishlist items along with my referal tag in the links in order to earn a bob or two on my own homepage. All this data is available on the web already its just a case of putting it together.
Some keen readers might of noticed the wishlist page I stuck up recently and want something similar on their own site and (like myself) either can’t be bothered or didn’t have the time to create a plugin to pull this data together. I’m putting up here my own quick and dirty plugin I built a few weeks ago to achieve this.
It uses amazon web services to look up a wishlist, stick in a specified associates id in each of my item links and replace where I put the text (without spaces) in a post with my wishlist items. The plugin regularly updates this (hourly) as a scheduled event in wordpress in case someone decides to actually buy me something. Of course you’ll need a services key to use it, which you can easily get by signing up with amazon at aws.amazon.com. Fill out your services id, your wishlist id (found by logging into amazon and heading to your wishlist page) and your locale (the bit after amazon. so mine is .co.uk) and press the fetch items to pull all the items in. If you don’t have an associates id, feel free to leave as my own : )
I used curl to get the remote data from amazon as the file_get_content methods generally aren’t enabled on normal web hosts. If you’d like the items to be fetched less regularly, then install the plugin with and updated wp_schedule_event method in the main wishlist.php to a value of your choice.
You can download it over here.
Double alliteration in a post title? Not sure I’ve attempted that before.
In this book, author David Upton walks you through use of the Code Igniter framework, which is essentially PHP’s answer to Ruby on Rails. I’ve been a avid user of Code Igniter since I discovered it last year, which is a nice waypoint for anyone trying to understand model-view-controller architectures and not wanting to make the move over to ROR quite yet.
The angle of this book is taken from a first time CI developer, but one with some knowledge of both PHP and web development in general. The initial chapters begin by exploring why you’d choose to use CI and some of its benefits over straight PHP code (such as saving on code reproduction or easing development burdens), though doesn’t really offer any real comparison of features of other similar frameworks. A traditional chapter on setup of CI is also included, (though I think at 4 pages could have perhaps been merged with another!).
The book then proceeds by tackling the subject at the core of CI, ‘model-view-controller’ and how this relates to traditional methods of programming. David breaks down how CI is structured very well and gives suggestions of how applications built within it should be designed to be successful. Some of the example code savings at this stage are somewhat minimal over a standard approach, but I think David conveys how these rack up throughout a web app. Useful chapters of how active record and CRUD can be used to ease DB interaction and also how views can be organised to avoid repitition complete with examples should allow any new CI developer to get to grips with it very quickly.
The later chapters quite extensively cover more “geeky” complicated subjects (using objects and namespaces, localisation, getting CI to interact with other services) which might be a bit much for a hobbyist user, but it gives some room for learning for others. The book also includes some good descriptions of how to make the most of the testing and profiling features which CI has out of the box to debug some of the larger web applications that you might undertake (Both features which I’ve previously been unaware of).
The use of friendly language is a welcome change from other texts, but I think in places it does get in the way a bit of the particular functionality which is being talked about. The constant reenforcement of the MVC throughout will be welcome for new converts, but my own practical experience suggests this might be better bent in places. A number of the descriptions of features provided in the book are at the CI site, and I think what might have helped this book is if a single larger running example led the way to describing each of the features.
At the moment, this is the only CI book available and it does well at covering the large featureset CI has. For a seasoned CI veteran it won’t bring any revelations, but if you’re new the framework it will serve you extremely well at getting your head round what makes it shine.
[Disclosure: This book was given freely by PackPub for review within the Cardiff Geeks group.]
One of the most frustrating things I find about hearing about possible web development jobs on certain sites is the sheer amount of them which are simply unviable due to my UK location. Previously I decided to post all those jobs I could find to my own webtyrant site and the recent job and profile sites in the django communities has got me thinking about how these two pieces of information on locality could be aggregated together (I don’t have time myself to do this though unfortunately - perhaps someone might like to chat about collaborating). What I’ve concluded is that being aware of those jobs within a certain area might be quite useful - and simple to implement. What you’d basically end up with is a situation where you could subscribe to updates on jobs in a particular field within a certain area (think - “tell me about all dev jobs within 50 miles”). Whilst this feature may exist on some other sites (though I’m unaware of it) my experience tells me that it probably isn’t executed particularly well.
Learning jQuery takes a look at the JavaScript library jQuery by Jonathan Chaffer and Karl Swedberg, whom run learningjquery.com, a popular resource to jQuery developers. Jonathan and Karl work through a example based approach of common problems in web application development to demonstrate how jQuery can be used to minimize the amount of code written by developers and instead focus on the functionality of their code.
The book is set for the developer with some knowledge of HTML, CSS and Javascript but a jQuery novice. The examples in the first few chapters offer solutions which may be achieved more simply through alternative approaches (e.g. applying styles with JavaScript, rather than applying it directly in HTML), but they serve their purpose of introducing what can be done without introducing a huge amount of features of the library too quickly. The following examples are far more realistic, focusing on tasks more suited to the library.
Each example is explained so thoroughly it includes exploring many eventualities that the less descerning developer may glaze over, with many set over the course of a chapter. I certainly found that many of the examples highlighted problems I just wouldn’t be aware of. The applications built through the examples include style switchers, animation effects and Chapters 8-9 cover much more completely how to build more full featured scripts such as AJAX based searches, a shopping cart system and image shufflers and rotators. Other topics of note include how to perform manipulation of the DOM tree of a HTML page and how to handle particular event requests. The book also does really well at consistently suggesting in the later examples the must haves of any page featuring JavaScript, progressive enhancement and graceful degradation.
One of the things that frustrated me slightly however was the frequency of code repitition and screen captures for each new added feature, but this is a minor problem considering how well the books covers the subject.
I found this an extremely easy and interesting read, with the example based approach keeping me engaged in how each situation could be enhanced with use of jQuery. The sensible organisation of each chapter means that many asides are covered enough to give the reader a working knowledge of how complementary technologies are able to be used with the library. The book also includes appendices documenting a number of useful web development sites, not all specific to just jQuery. Overall, a thorough introduction to the language.
[Disclosure: This book was given freely by PackPub for review within the Cardiff Geeks group.]
One of the most frustrating things I find in managing a number of websites is that I’m always forgetting passwords. The version of Filezilla I’m running however makes it easy to remember them again through its use of weak XOR encryption and a the key being hard coded into the software. I’ve used a program previously called the Filezilla Password Recover, but it turns out that this is also extremely easy to extract them using a simple PHP script. The following code makes use of the nice XML parsing in PHP5 and a decryption function I found over here. I’ve added some comments to roughly describe what is going on.
Note: Apparently this encryption has been dropped from version 3 with absolutely no encryption featured at all, that’ll make my job easier now.
<?php
$filezilla_password_file = “FileZilla.xml”;
$xml = file_get_contents($filezilla_password_file);
$simple_xml = simplexml_load_string($xml);
foreach(
$simple_xml->Sites->Site as $site)
{
$attributes = $site->attributes();
print
“Site: ”.$attributes->Name.“\n”;
print “User: ”.$attributes->User.“\n”;
print “Encrypted Pass: ”.$attributes->Pass.“\n”;
print “Unencrypted Pass:”.decryptPass((string)$attributes->Pass).“\n\n”;
}
function decryptPass($pass)
{
// Encryption Key for FileZilla 2 Passwords
$key = “FILEZILLA1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ”;
// Find the offset position in the key for this pass
$pos=(strlen($pass)/3) % strlen($key);
$decrypt = ”;
$t=0;
//Loop through each 3rd of the password
for($i=0;$i < strlen($pass) / 3;$i++) {
//Get 3 characters, remove the 0 at the
//front to get ASCII code to represent the character
$num = substr($pass,$i * 3,3);
if (
substr($num,0,1) == 0) {
$num = substr($num,1,2);
}
//Get the ascii code of the unencrypted character
//by performing XOR against current ASCII and key
//before converting back and adding to decrypted pass
$t = $num ^ ord($key[($i + $pos) % strlen($pass)]);
$decrypt .= chr($t);
}
// Return the decrypted pass
return $decrypt;
}
?>
I’m a firm believer that by upholding my own principles, I’ll be rewarded. It’s a tag line I adopted for the small hosting company that I’ve been running for a while now. It also has been reflected this year in a nasty situation I was left in with my landlords, the council and a previous housemate (who doesn’t really deserve that title, more just a person whom shared the house). In all these situations things have turned out better for me in the long run, due to myself re-enforcing what I believe should be done - even if it does mean a longer struggle through.
Today, one of my favourite breaks record labels (Marine Parade) were offering a compo to win a cd by responding to them over myspace. (Ok, maybe a somewhat less grandiose scenario than this post may have made out, but still!) I’ve long refused to sign up to myspace out of principles (it looks bloody awful, mainly) so I sent them a message to point it out:
As much as I’d like to respond to get the cd via myspace, I feel I shouldn’t have to be forced to use that poor excuse for an interweb page.
Anyway, here is my address just in case you feel like sending me Adam Freelands - Tectonics.
To my joy, they didn’t care!
fair enough, you get one!
I don’t think I’ve ever won a competition due to principles. Maybe I should start bending the rules of other competitions and still try to win prizes?
The Cardiff geeks will be having its first ever face to face on Wednesday 17th October from 7pm at Cafe Floyd, just opposite the castle. Props to Dan Zambonini for organising the venue.
This is an informal, introduction between us all. If you’re a geek, or interested in chatting with us about what we and you are passionate about, make sure you get over there!
Today on the return from uni I passed the new Subway that is opening up soon near Queen Street train station. On one of their job adverts, they were advertising for team leaders and sandwich artists. I’ve never really noticed my sandwiches being arranged in a artistic fashion before, maybe it would brighten my day if they were. I feel sorry for the poor art school graduate who ends up filling baguettes for a living.
Does anyone else have examples of jobs with somewhat over enthusiastic job titles?
Yes, yes I know I already posted about the FOWA Roadtrip in Bristol, but I live in Cardiff and have friends and colleagues in Bristol too. I promise I didn’t just head there for free drinks once again. This time the Carson Systems team had pulled together some funky little FOWA Roadtrip badges that they handed out on the door, rather than the stickers at Bristol. I’d previously learned that Ryan’s wife, Gillian had taken a MSc in Cardiff and it seems the same is true of Lisa Price too. I had a really interesting conversation with Lisa about how Future Publishing (whom she previously worked for) produced one of my favourite mags (PCFormat) back in my adolescence. (I actually still own all the magazines I bought for like 3 years and harbour plans to ship them back to Future in Bath, along with all the CDs).
Anyway, it was grand that those who were involved in the web app scene in Cardiff finally made it to an event together, and our newly formed Cardiff Geeks group is already scheming to stage another meet up for geeky people. (It’s a good label, it’s a nerd you don’t want to be).
Hey, you've reached the personal blog of Ian Wootten. Thanks for stopping by.