Dan Poltawski's Blog

geek, moodler, drummer

Notifying the End of Phpunit Executions on OSX

Whilst integrating issues into Moodle it’s a multiple times per day occurrence to run phpunit tests on the whole Moodle codebase. Each day we add more and more tests and so the time taken to run these tests increases gradually. I’m not one for sword fighting on wheely chairs, so whilst waiting for phpunit tests to run I’ll generally move onto another task, then frequently i’d forget completely that the phpunit run was going on in the background and not know what the phpunit output was showing me, need to run the tests again and fall into the same trap!

In order to resolve this situation I was inspired by Brett Terpstra’s post about using the ruby gem terminal-notifier to send messages to Mountain Lion’s notification center and decided to use this to remind me of phpunit executions.

After installing terminal-notifier and using Bret’s finished.rb script I added a bash function for phpunit:

function phpunit() {
    vendor/bin/phpunit $@
    if [[ $? == 0 ]]; then
        finished "phpunit OK"
    else
        finished "phpunit FAILED"
    fi
}

In order that I don’t miss a phpunit run I’ve configured the notifications to be ‘Alert style notifications’ (configured in OS X Preferences > Notifications > terminal-notifier) which works great, the only remaining issue is there does not seem to be a way to dismiss alerts using keyboard shortcuts.

Moved to Octopress

It’s becoming a bad habbit, but I’ve switched the blog engine for this blog again. I’ve moved from wordpress to Octopress (which itself is a wrapper around jekyll).

I’m sorry if you received all the posts duplicated in your RSS reader (or indeed if you don’t see anything). I tried to configure redirects and the RSS feed to prevent duplicates from appearing, but it appears this is a dark art, and I failed (at least with Google Reader).

I was getting sick of maintaining wordpress - it’s not that difficult, but as I don’t update this blog that much, spending more time keeping the software up to date is more of a chore. Octopress is a static blogging engine, I author the posts as text files (in markdown) and it generates static html files for the blog. This means I don’t have to worry about software maintenance and also don’t need a fancy server stack to host it.

Should iRun - the Tech

This is the second of two posts on creating my first app Should iRun. You can find the first post here.

Obtaining timetable information

To recap from my first post - the idea of Should iRun is to provide quick access to departure times of trains passing through stations close by. To make this idea into reality, I first needed to gain access to timetable information in an electronic format. Fortunately, I discovered that Transperth provide access to their timetables in Google Transit [GTFS] format and with a license which allows it to be used by my app. Kudos to transperth for releasing information to the public and not just to Google.

Armed with the GTFS timetable data, I had two choices for the way I could construct the application:

  • Provide a central web service which stores serves the timetables to my application over the network
  • Package the timetable information and ship it as part of the application.

I decided it would be best to ship the data with my application. As a goal for my app is to be as fast as possible, it turns out to be an obvious choice:- At rush hour times the cellular network in Perth can become congested and slow to retrieve data - so looking up the timetable information would be slow and frustrating using the data connection. With the timetables pre-populated on the device they can be looked up instantly.

Creating My First iOS App - Should iRun

This is the first of two posts on creating my first app Should iRun

Motivation

As a developer with a heavy interest in technology i’ve been interested in writing an application for iOS for a number of years. Many of the websites, podcasts and people I follow on the twitter are mobile application developers. Two or three years ago i’d started doing Standford course CS193p from home and completed the assignments to learn objective-C and the iOS SDK. But alas without any particular application idea in mind that is about where it finished.

The Idea

Since moving to Perth i’ve spend most of my time traveling by train or bike. Without getting into the detail of Perth’s public transport problems, one particular downside which often affects me is that the trains only run every 30mins after 7pm. My 4km journey from the city to my apartment turns from a 7 minute journey to a 37 minute journey. Often when out and about I would leave the comfort of the place I was at to catch the train, only to arrive at the station just as my train was leaving and wait in the station for 30mins. In order to avoid this problem, I searched for a website or iOS application to provide me information about the timetables. None really fit my needs, they were slow to navigate and not suitable for my need to quickly check this information on the go.

And so my first real iOS application idea was born. I wanted an application which would use my current location, lookup the timetable information and show me immediately the next trains at the nearest stations, allowing me to work out if I should go for the train….or buy another beer! :)