Consume HTTP APIs lazily

TL;DR: Using lazy sequences for API consumption has advantages in memory consumption and promotes interactive development. HTTP APIs are ubiquitous and consuming them is a programming task coming up quite regularly (at least for me). Therefore I found the following idiom pretty useful, which turns a paginated, remote data source (in this case the GitHub jobs API) into a lazy sequence: (defn- fetch-lazy-jobs-seq! ([] (fetch-lazy-jobs-seq! 0)) ([page] (let [jobs-url (fn [page](format "https://jobs. [Read More]

Making REPL driven development easy with leiningen

TL;DR: Leiningen provides facilities that make using a REPL driven workflow a breeze. You should consider using them on your projects for a more pleasant development experience. Make your system reloadable First of all the application should be reloadable, that means restartable in the REPL without restarting the entire process. If the app can shutdown and start quickly, this makes development way faster, less error prone and more pleasing experience. [Read More]

Releasing clojure libs

Releasing libraries is a tedious but important task.There is lots to do and lots to screw up: Tagging the release state Making a clean build Signing the artifacts Pushing them to some repository Bumping the version to the next snapshot iteration And so on and so forth… Having a dark past in the java world I looked for something like the maven release plugin for leiningen, which automates the whole process quite nicely. [Read More]

Create bugs with overtone

These days I stumbled upon some code committed by a very competent but sadly no longer present colleague and was baffled to see this: catch (Throwable t (log/error t "horrible things happend)) This left me puzzled and after looking for clues why this had been done (and not finding any) I decided to remove this exception dodger and move on. Turns out I created a bug. Why? Because this code was called in a job scheduler from the very popular overtone/at-at library. [Read More]