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

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:

(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!