Archive for October, 2009
Gmail for business
Just moved our email over to Google mail, and as a result I can switch off the Active Directory and Exchange virtual servers, and use the Mac Pro for somthing useful like writing code!
I did have to fire up a windows isntance to use the Google Mail Uploader but it was worth it, I have ~9000 mails in outlook that are now in gmail.
Gmail has just saved us 2 windows server licenses and an exchange 2007 license, never mind all the time and effort.
Moving your email over to Gmail? You should be!
IPhone Libraries
Mose developers collect a number of libraries and Open Source code samples during their career, which they use over and over again.
Here is a list of the IPhone code that I use when building apps, please feel free to send me some suggestions for more?
- TouchJSON
TouchJSON is parser and generator for JSON implemented in Objective C. - Three20
Three20 is an Objective-C library for iPhone developers, featuring a Photo Viewer, Message Composer, Web Images View, Internet aware table view controllers, Better text fields, HTTP disk cache and URL-based navigation. - HTTPRiot
HTTPRiot is a simple REST library designed to make interacting with REST services much easier. It supports GET, POST, PUSH and DELETE requests and HTTP Basic Authentication. HTTPRiot was inspired by John Nunemaker’s excellent httparty Ruby library.
I also have a personal stash of UIKit extensions which i often re-us, I will put them together for a later post
QuickTweet is Open Source
A while ago we developed a simple Twitter Client to scratch a personal itch I had with the existing clients.
The idea was to have a simple app that loaded really quick and enabled me to post a status update to twitter, using a full screen view that contained just a keyboard and a text box.
I also wanted it to rotate nicely in to landscape when I rotated the IPhone.
Seems simple ey? yet all the good twitter clients have really poor implementations.
This is what the App looks like:
This project will show you how to do the following things:
- Draw a custom control (TextField)
- Use a Fliped Transition (settings view)
- Save and fetch user defaults
- Custom Rotation logic to position elements manually
- Animation, the tweet text field animates away when you click Post
- Integrating with a 3rd party code base (MGTwitterEngine)
Go get the source from http://svn.floydprice.com/OSS/QuickTweet/trunk/
Automatic Elastic Block snapshots with a cron job
Amazon EC2 really is amazing, and the Elastic Block storage is pretty darn good too, however I wish you could automate the snapshot process form the EC2 console.
It is however pretty easy to do yourself using a simple cron job.
Before you start make sure you have a JRE:
sudo apt-get install sun-java6-jre
You will also need the EC2 API tools:
wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip unzip ec2-api-tools.zip
At this point you should make a metal note of where you unzipped the api tools to.
Now that you have the prerequisites you need the following simple script:
#!/bin/bash export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre/ export EC2_HOME=/root/ec2-api-tools-1.3-42584 export EC2_PRIVATE_KEY=/data/misc/pk-Umbongo.pem export EC2_CERT=/data/misc/cert-Umbongo.pem export AWS_ACCESS_KEY_ID="Twinkle Twinkle Little star" export AWS_SECRET_ACCESS_KEY="If your happy and your know it, clap your hands" $EC2_HOME/bin/ec2-create-snapshot vol-999999
Obviously you need to specify your volume id where i have vol-999999
Once you have modified this file to be executable you are ready to test it.
chmod +x snapshot.sh ./snapshot.sh
Once your have ran it go to the EC2 Console and verify that the snapshot process has started.
And thats it, the first time you run this script the snapshot will take a while to complete but the next one will be much quicker as the snapshot process is incremental, so only the changes since the last snapshot will be read.
Oh, don’t forget to create a cron job for this (*/5 * * * * /path/snapshot/sh)
How to respond to the IPhone Shake Gesture
The IPhone 3.0 SDK includes support for detecting when a user “Shakes” the IPhone, this is intended to be a usability feature allowing app developers to implement Refresh or Read All functions on shake, wow those crazy guys at Apple really do know how to innovate!
It’s pretty easy to implement all you need to do is register your view controller as the first responder and listen for the motion event.
-(void) viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; [self becomeFirstResponder]; }
Once your controller is the First Responder you can receive the motion event like so:
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { if (motion == UIEventSubtypeMotionShake) { refresh; } }
This will work beautifully but you will however notice that any views you present over this one will not respond to all touch events, for instance the keyboard will not show when you touch a text field, this is because you need to resign the First Responder before you present the view like so:
- (IBAction)showMyCustomView { [self resignFirstResponder]; [self presentModalViewController:myCustomViewController animated:YES]; }
As you can see this is all pretty easy and the only gotcha is the First Responder stuff, which also is pretty trivial.
Enjoy and please people, Shake Responsibly!
Search Engines…
Bing loves us,
Google thinks we are cool,
and Yahoo would cross the road it it saw us coming…
If you search for “Subversion Hosting” on the three major search engines you will see pretty mush the same bunch of results just in a very different order.
for instance Bing has Code Spaces right at the top (YAY!) however Google has Code Spaces in at number 6 (hmmm!) and Yahoo! has Code Spaces at number 10 (Bah!).
Obviously Bing and Yahoo! mean absolutely nothing when it comes to traffic (relative to google anyway) but its interesting how all three has slightly different opinions about the web. Personally I think Bing have nailed it
The PayPal effect!
This is a little story about a wonderful product called DropBox.
I have been using DropBox for a while and today I noticed that i’m using about 50% of the 2GB you get for FREE (yeah! it’s pretty generous!), for some reason I had an urge to click the “Upgrade My DropBox” link that was looking back at me, Don’t ask me why, maybe it was good link placement by the DropBox guys or simply my own appreciation of the FREE plan that caused it, but true enough I clicked the link…
Upon clicking the link I was faced with a beautifully laid out screen offering me 50GB for $9.99 or 100GB for $19.99, I instantly clicked the 50GB option expecting to get a nice big DropBox only to be presented with a payment screen that “Required” me to go and get my credit card before i could continue! Now… call me lazy but this seems like a silly hurdle to put in front of a potential customer, especially one who is here entirely on impulse.
For this (seemingly daft) reason I’m not going to upgrade, after all I don’t actually “NEED” to upgrade yet I still have ~1GB left, but I wonder how many people just like me would have upgraded if the payment process had that magic little “Pay with PayPal” button on it… I know i would have.
JRuby.com
For as long as the JRuby project has been going the jruby.com domain has been owned by a nasty little Domain Squatter, but recently the Company I Work For purchased the domain off the before mentioned toe-rag for a small fortune.
Today the domain is being send to it’s rightful resting place, that is, we are giving it to the JRuby project.
Hip Hip Hooray!
Code Spaces Website Redesign
We have been working on the CodeSpaces.com website for a while and today released it to the world, it’s likely to evolve quite quickly as we are trying to catch up on all the SEO work we haven’t done over the last 2 years.
Check it out at http://www.codespaces.com


