Basic auth in Clojure

This week I wanted to implement a simple authentication mechanism for a small website. I didn't want to add any complicated login mechanism, and I wanted to customize the site based on who logged in. Here's how I did it so I using a basic auth and ring middleware.

Ten weeks in a row

About three months ago I set out to write a post every week. This marks the tenth week of posting in a row. I did this as part of an online version of Iron Blogger together with a bunch of other Hacker Schoolers. What follows are lessons I learned, as well as some general thoughts on it.

How to beat confirmation bias in any given domain

Confirmation bias is a disease where the afflicted is looking for information that confirms his or her hypothesis rather than trying to contradict it. At present time, it is estimated that the whole of humanity is effected by it. Why is confirmation bias a problem? For one thing, looking for confirming evidence doesn't make you learn new things about the world. Since the world is pretty big, and humans are generally small, this is a problem.

Two types of errors

I wanted to run Datomic Pro on a cheap test server with 1GB RAM. The default settings for Datomic Pro are a bit too memory-intensive for this. This is a tale of two very similar errors that I had and how I fixed them. What's interesting is the difference between the two.

Rex and Albert: meet Romeo and OJ

In Thinking, Fast and Slow Kahneman introduces System 1 and System 2. Unlike the left-brain / right-brain pseudoscience, this distinction has some merit. It represents much of what we know about how the brain processes things. System 1 stands for the slow and deliberate, while System 2 stands for the automatic and unconscious. These systems have very anonymous names because we don't know very much about them; in scientific terms, it's just two different responses, which underlies, among other things, much of behavioral economics. To avoid confusing them, some people have come up with the clever names Rex and Albert. Rex conjures up images of a T-Rex, whereas Albert hopefully (after having heard it the first time, at least) makes you think of one of the most foremost physicist of all time. I'll let you guess which System belongs to which. Now who's Romeo and OJ?

Anatomy of a Om component

Om is a Clojurescript library to represent UIs[1]. It interfaces with React.js, which is what Facebook built and is using to make their app. By using a efficient algorithm for computing DOM Diffs, inspired by Doom 3's game engine render loop, the complexity of keeping track of app state is reduced significantly without performance costs. This is a very brief overview of a Om component.