Semira sings songs

Published at: 4.IX.2012 23:40 CEST

My pet store application is a music streaming website and has been so for over 15 years. Every 3 to 4 years I rebuild it using whatever tool is the sharpest in my shop at that time. I’ve build it using Perl, Java, Ruby and (the most recent incarnation) Clojure.

The feature set changed a lot over time; the early versions simply browsed directory structures, later versions extracted meta data from the audio files and, later on, used that to provide structure. Some versions had playlists, a news sections and even downloads. The latest version goes back to the basics; being able to search, browse and play music. But it does a bit more than that: it works on Android and iOS too.

So please welcome Semira to the world of Open Source Software!

source on github

I tried (Clojure on) OpenShift and I like it

Published at: 22.VI.2012 22:25 CEST
Categories: clojure, ec2, hosting, openshift

Yesterday I tried to deploy a Clojure web application on Redhat’s OpenShift and after some tries it runs! The rhc CLI tool is a bit quirky (gives a lot of warnings about usage of deprecated API) and the DIY repo comes with a demo application you need to get rid of first (merged an existing application into an orphan branch and pushed over the remote master branch with -f) but it does work as expected. It is not as smooth as heroku (yet) but, apart from the rough edges I feel it’s a platform to keep an eye on.

I especially like the openness of the inner workings. There is no magical “slug” compilation or “process” launching. When you create an application it sets up a git repository and something like a chroot environment for you on a shared Amazon EC2 instance and off you go. Your repository will have some script hooks to build, start and stop your server processes. It’s all very clear and without hocus pocus. Read through the architecture overview on the wiki for more information on how it works or dig into the source code of the platform on github for the fine details.

Thanks to the Phillip Meier for his blog post on getting a Clojure app running on Openshift and, ofcourse, Redhat for providing their PaaS as an opensource platform and letting developers test drive it for free. BTW, pricing information will be available “this summer”..

Oh, and for details on running a Clojure webapp on OpenShift look at this commit.

Game of memory in clojurescript

Published at: 27.II.2012 17:10 CET
Categories: clojure, javascript

Waiting for ever and ever for a pre-ordered tablet I realized it would make a great platform for simple HTML/JavaScript games. So I wrote a very basic game of memory of my kids:

The code’s on github.

NOS Tour de France live verslag op mobiel

Gepubliceerd op: 17.VII.2011 15:06 CEST
Categorieën: android, clojure, wielrennen

Omdat de dekking van mijn provider nogal slecht is, ik daarom te vaak geen radio 1 kan ontvangen op mijn telefoon en de NOS Tour de France live pagina mobiel onvriendelijk is, heb ik tijdelijk een kleine webapplicatie gelanceerd welke het live verslag van de NOS pagina serveert. Dit verslag wordt elke 15 seconden automatisch geupdate.

Zo, ik kan weer rustig in de trein zitten tijdens de etappe finales.

nos-tour-commentaar (broncode)

Update: De tour is alweer afgelopen en deze webapplicatie draait dus niet meer.

Partial content for ring

Published at: 9.III.2011 21:25 CET

When streaming audio or video or serving largish files over HTTP you’ll eventually want to provide seeking resp. continue download capabilities to your application. I’ve cooked up some ring middleware to respond to partial content requests and mangle your application responses accordingly. It works well with the commonly used ring.middleware.file wrapper but do read the fine print.

Et voilá: ring-partial-content

Basic authentication for ring (and compojure etc.)

Published at: 23.VIII.2010 21:26 CEST

I’ve always liked HTTP authentication (like basic and digest) over login pages because they look so.. technically savvy. Finally somebody who bothered to read an RFC to implement it and make me feel warm and welcome like peers do.

Okay, I must admit, it takes a customer just a couple of moments to request a logout button, which is a real pain to implement, if possible at all. And I wouldn’t want to login on something I care about from a public computer either. But it is very nice for web services!

Anyway here’s my implementation as ring middleware: ring-basic-authentication

elein.el: leiningen functions for emacs

Published at: 19.VIII.2010 19:41 CEST
Categories: clojure, english
Comments: 3 pieces

I’ve bundled my emacs leiningen convenience functions into a package and dropped it on github for other people to use. It’s a collection of interactive commands for common lein tasks used within a project; elein-clean, elein-deps etc.

Mosts of the commands basically run lein using the emacs compile function, with the exception of elein-swank and elein-reswank. These also handle (re)connecting slime.


  • download elein.el
  • copy it somewhere in you emacs load-path
  • (require 'elein)
  • open up a file in a leiningenize project
  • M-x elein-version

I hope somebody finds this useful.

Announcing clj-base64

Published at: 20.IV.2010 16:22 CEST
Categories: clojars, clojure, english
Comments: 2 pieces

I’ve justed released a small clojure library called clj-base64 for encoding and decoding data using the Base64 coding scheme. The code’s at github (and gitorious) and a pom and jar have been pushed to clojars.

Lein it up:

  :dependencies [..
                 [clj-base64 "0.0.0-SNAPSHOT"]]..

And use it:

(use 'remvee.base64)
(encode-str "I 8> clojure!")        ; => "SSA4PiBjbG9qdXJlIQ=="
(decode-str "SSA4PiBjbG9qdXJlIQ==") ; => "I 8> clojure!"


(.setText tv "Hello Android from Clojure!")

Gepubliceerd op: 18.I.2009 07:23 CET
Categorieën: android, clojure, java, programming
Reacties: 1 stuk

Ongeduldig heb ik met de Android emulator zitten spelen. M’n dev phone is onderweg en ik kan natuurlijk niet wachten tot ik ermee aan de slag kan.

Aardig aan het Android platform is dat het gebruik maakt van Java. Wat is jammer aan Android is dat het geen gebruik maakt van een JVM maar van de Dalvik VM. Klinkt rampzalig maar valt erg mee, Android blijkt een heel groot deel van het Java Standard Edition class libraries te implementeren. Dat stemt hoopvol en geeft het gevoel dat, in theorie, alle andere JVM talen (zoals Groovy, JRuby, Kawa en Clojure) ook te gebruiken zijn op z’n Android telefoon.

Natuurlijk is het allemaal maar theorie en in wat voor bizarre wereld zouden we leven als dat ook echt zou kunnen?! :) Toch maakte Per Bothner me nieuwsgierig met zijn AndroidHelloScheme post en ben ik aan de slag gegaan om ook een Clojure variant te maken.

Lees verder →