This post isn't about the (awesome) book, it's about the immense ease and pleasure of interactive with data using Clojure.

Have you ever lost some tabs due to some browser hijinks (and a bit of goofing up)? I have recently. Rather than accept it, I decided to do some research and figure out that Firefox keeps all of this data in the deep dark corners of some json files. Knowing that, I fired up a repl with lein try and began work.

  ;; lein try
  (require '[ :as json])

  (def home (System/getenv "HOME") "/.mozilla/firefox/something.default")
  (def sessions ["sessionstore.bak"

  (def data (->> (nth sessions 0)
                 (str home "/")

  (->> data
       (map #(->> % :entries (map :url)))
       (map last)

After a bit of playing around I had this and tabs were restored.