NOS Tour de France live verslag op mobiel

Gepubliceerd op: zondag 17 juli 2011 om 15:06
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: Wednesday 09 March 2011 at 21:25

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: Monday 23 August 2010 at 21:26

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: Thursday 19 August 2010 at 19:41
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.

Curious?

  • 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: Tuesday 20 April 2010 at 16:22
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:

(defproject..
  :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!"

Enjoy!

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

Gepubliceerd op: zondag 18 januari 2009 om 07:23
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 →