to-jdbc-uri 0.4.1 released

We just released a new version of to-jdbc-uri, 0.4.1. A very important change in this one is that we are consolidating all our libraries into the com.carouselapps group ID, so you need to switch from including it like this:

to including it like this:

Aside from that, this release supports RedHat OpenShift style of URL that use the …

Don’t forget to clear your client side state when logging a user out

When a user logs out from our web site, we are used to clearing the session and that’s it. When you are developing a single page application, you are likely to keep a lot of state on the client side, and that should be cleared too. For Ninja Tools, that meant going from the traditional re-frame initialize-db:

to having …

Automatically converting case between SQL and Clojure

SQL, at least PostgreSQL, likes using snake case for table names, such as user_name, while in Clojure, kebab case is preferred, such as user-name. When you use the library Yesql you are likely to end up with keywords in snake case unless you do some conversion. In our toy project, Ninja Tools, I wanted to perform these conversions automatically. To achieve this …

2

Bidi vs Silk

In previous blog posts I mention that Bidi and Silk are essentially equivalent. I don’t believe this anymore. I now prefer Silk and I can show you why with a little example. First, let’s define some routes:

When it comes to defining routes, I find both a bit cryptic. Bidi feels a bit easier to read but I found it …

6

Isomorphic JavaScript (with ClojureScript) for pre-rendering single-page-applications, part 2

Photo of Servers

In part 1 I covered the basic problem that SPA (single page applications) face and how pre-rendering can help. I showed how to integrate Nashorn into a Clojure app. In this second part, we’ll get to actually do the rendering as well as improving performance. Without further ado, part 2 of isomorphic ClojureScript. Rendering the application Now to the fun …

Using New Relic with Clojure

This post describes how I got New Relic to run with my Clojure project. I’m using Heroku but most of what I say here should be applicable in other environments and I’ll try to point you in the right direction when it doesn’t. Please, feel free to comment with improvements or corrections. There are already a few articles out there about …

jar-copier 0.1.0 released

jar-copier is a Leiningen plug in to copy jars from your dependencies to your source tree. It’s a very small simple utility that proved to be necessary to have a sane setup with Java agents (New Relic for example). It’s very simple to use. Put [jar-copier "0.1.0"]  into the :plugins  vector on your project.clj. To run this plug in, execute:

Limiting threads (workers) with Jetty in Clojure

While trying to understand the behaviour of my implementation of server side JavaScript execution for pre-rendering SPAs (Single Page Applications), something I’ll write about later on, I quickly run out of memory on Heroku. What I believe was going on is that my Heroku machine was trying to handle too many requests at the same time. The change to allow …