
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.
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.