An iOS client for my Coffee Tracker API

About 9 hours ago I dandered down the road to see what was happening at the FlackNite event being hosted in Farset Labs.

When I finally got myself settled down with network access and a cup of coffee and said hello to everyone it seemed I was the only one without a project to work on. Nightmare.

Decisions, Decisions

I couldn’t think of what to focus on but Rob and Pete were sitting next to me and tinkering with some Objective-C and Cocoa. Considering that I’m now on the iOS developer program, doing something similar seemed like a good idea.

I needed to pick something that could be accomplished within a relatively short period of time and I’ve had a few small projects which I’ve wanted to get out of the way for a while but most of them would have required some research effort to take me into unchartered territory.

This constraint left me with a single task: the relatively straight-forward job of porting the OS X client of my Coffee Tracker API to iOS.

Double Jalapenos

Coffee was drank, pizza was eaten, many laughs were had and some Objective-C was cranked out.

Beyond creating a new iOS project and user interface, the existing code didn’t require much change. Turning off ARC for AFNetworking was the most involved thing I had to do.

After the basic port I added a few finer details like turning on the network activity indicator when the web service was being accessed and making sure the count was refreshed whenever the app became active. Simple.

Dive In

It was good again to sit down with a specific task, open Xcode and eventually come to a solution. Maybe some day I’ll produce something more involved but I’m pleased with how things are progressing.

Full source code is available on GitHub so fill your boots.

Tracking my coffee consumption with Redis, Sinatra and Cocoa

I’ve often joked about putting together an app to track my coffee consumption, such is my reputation for consuming the black goodness. Like a lot of my other personal projects, the idea had a prolonged gestation period and was finally born through a welcome spark of motivation.

Crafting fine web APIs

Over the past 6 months the bulk of what I’ve been doing day to day with Vigill has involved building web APIs for consumption by mobile clients. This has involved lots of Sinatra, Redis and MongoDB.

In this time I’ve also put together a couple more Cocoa apps.

Thick client boogie

An unexpected resurgance in enthusiam for developing desktop apps combined with a fluency in cranking out webservices put me in a good position to put together a simple API and client.

I’m not a big user of mobile apps but I do spend the bulk of my waking hours sitting in front of a Mac so producing a client for OS X was the logical choice.

For the API I considered using something a bit more esoteric than my standard toolkit, but no matter what combination of technologies I investigated not much seems to come close to the power and flexibilty I find with Ruby and it’s frameworks for performing the bulk of tasks required by the web applications of today.

Areas of note

A valid API key must be sent in the request headers when sending a POST to the Sinatra app. Validity of the key is determined by checking set membership in Redis. A 4xx status code is returned if the key is missing or invalid.

The daily count is boosted with an atomic increment of a hash field.

The client is not much more than a GUI wrapper around some HTTP requests sent using AFNetworking. A previous native iOS client I developed used NSURLRequest directly and I found AFNetworking much simpler to use.

Get the code

The source for the API and the OS X client is available on GitHub as usual and some further technical details are available in the READMEs.

You can keep up to date with my coffee consumption at


Steven Wilkin, professional coffee drinker extraordinaire

There have been times in my life when my job description could well have been best described as being a professional coffee drinker. These days however I’ve found gainful employment but continue to consume vast quantities of the stuff and even use coffee nomenclature to name my new *nix boxes.

During a caffeine-fuelled session with my domain registrar I happened to lookup; it was available, all sense went out the window and my money and myself were swiftly parted.

I wonder if this acquisition will have any effect on the Google Juice of the personal brand I have an eye to developing? And before you ask, yes, SEO information has been trickling it’s way into my RSS reader recently.

The pot crack’d

It was Sunday morning and I went through my usual routine: I got up, flicked on the coffee machine which I had filled with water and ground coffee the night before and went to the bathroom. I decided to get back into my bed for a bit and whilst I was lying there I heard a cracking sound. I feared the worst, thinking: “please not my precious caffeine preparation paraphernalia” and sure enough the black goodness was weeping from the pot and sizzling on the hotplate. Poor photography aside, here’s the fallen soldier:

Cracked - old coffee pot

My brother and his fiancee presented me with the machine Christmas before last, my love of the stuff being what it is, so it had seen well over a year of practically daily use. Not wanting to disrupt my morning routine for the next day I decided to head down to Argos after a swim to pick up a replacement. Here’s the new machine on its maiden run:

Cracked - the replacement coffee machine

For a good while I’ve been thinking about getting a more “professional” filter machine so I decided not to spend big and the model I choose was inexpensive yet fits my needs precisely, fitting in well with the remainder of my coffee equipment. It truly is an obsession :)

Now With Filter Coffee!

Coffee time came around this morning at 11am just like it always does, but when I got to the kitchen there was no sign of the usual paraphernalia. I was placed in a moral dilemma: do I selfishly get busy with the 1 mug french press or dive into the catering-sized drum of Nescafe Original Blend? Thankfully, before I had to make my mind up, the green light was given for the purchase of some new equipment, so Phil and myself picked up some funds from petty cash and hit the Argos around the corner.

We had money to burn and the need for something shiny. The laminated book of dreams was consulted and we decided on a Morphy Richards “Cafe Matlino filter machine; the product number was written down and handed to the girl behind the counter, money changed hands and we awaited our new piece of kit. Within a few brief minutes the prize was ours and we headed back to the office, unpacked the machine and set it up for a water-only brew to cleanse the system. Here’s an action shot from the first pot of coffee produced:

New Filter Coffee Machine

The machine has an array of esoteric buttons, lights and displays which the documentation insists are used to have the brewing process instigated at a predestined time. Personally I prefer the technique prescribed by Terry Tate, Office Linebacker: “yo’ kill the joe yo’ make some mo’!” Namely, having a pot of black gold available at all times during the day. Already my mind is filled with ideas along the lines of the infamous Trojan Room coffee machine, the granddaddy of all web-cams.

As an interesting end note, when I was checking out the Argos site I discovered a potential for Cross Site Scripting, look at the breadcrumb trail on this page!

Secret Santa

Secret Santa - Paul Singing And Strumming It’s that time of the year again and is customary at the VDA we had our Secret Santa jollifications this morning. Once again, Paul proved himself man enough to fill the big guy’s boots and surprised us all by making his entrance with a guitar and serenading us with a rendition of Slade’s Merry Xmas Everybody. Good show old chap!

Next up was the main event: the distribution of gifts, yee ha! About a fortnight ago the names of all participating staff (yes, some choose not to partake in the festivities, humbug!) were put into a hat and we each drew one. I only got my act together yesterday but got creative with the wrapping and printed out a couple of full page images of neurons within the neocortex from the Blue Brain Project, thanks Google Images!

Upon receipt of a copy of Huxley’s Brave New World Sinead instantly guessed I was her Secret Santa and she is either an accomplished actress or she genuinely liked it, result! I was handed this ominous looking package:

Secret Santa - All Wrapped Up

I couldn’t even guess at what it was and when I opened it this was awaiting me:

Secret Santa - Unwrapped

How appropriate! And by the power of Java here is an action shot of my new paraphernalia:

Secret Santa - By The Power Of Java! Also included in the set were some cinnamon sticks, a mini grater and some “French Vanilla” coffee powder: I forgot completely about the cinnamon when I was getting the Joe, but might well give it a go later. I don’t know about the coffee powder though, I only resort to instant when I can’t get the real thing. All in all a very thoughtful gift given my reputation about the office as a coffee fiend. Phil on the other hand got an edible posing pouch…

Bialetti Moka Express

Yesterday the mood took me and I went hunting for some new coffee making appartatus. I didn’t get a replacement glass for my french press which was my original intention, but I did pick up a stove-top espresso maker and have spotted where to get the necessary component for my fallen Bodum, which shall be acquired at some point in the near future.

It was a bit of a mission tracking this piece of equipment down, but just when I had given up I bumped into a work colleague who pointed me in the direction of Habitat who could thankfully satisfy my needs. I walked home via the supermarket and picked up some fine-ground italian coffee to go with my new toy:

Moka And Espresso Grounds

I eagerly read the included instructions, washed and filled the moka and went ahead with making my first, sacrificial, batch of espresso. The smell of the fresh coffee was fantastic and I was a bit disheartened with having to pour it down the sink, but I wasted no time getting setup for another run and wasn’t disappointed with the results.

The process gave me a mug(!) of rich, black, steaming espresso which I drank as fast as I could. I could feel the muscles in my jaws tighten, my stomach got a bit queasy and all I could think was “this is great, I need more!” I resisted the desire for another spin on the roundabout and needless to say, I didn’t feel entirely sleepy when it was time for me to get into bed.

Today I have went through the ritual no less than 4 times and counting my saturday afternoon routine of a quadruple shot americano at Starbucks with the troops, my espresso shot count is easily in the high twenties. And all I can think of is having more.

Beware the “little man with a mustache.”