While services like SendGrid are easy to use and offer a plethora of features like bounce and open rate monitoring, they are not the cheapest option. Gmail's SMTP service on the other hand, although not as feature rich, is more affordable. In this post we will cover setting up Gmail SMTP with postal.
clojure.pprint/pprint can be used to print Clojure data structures in a pleasing, easy-to-understand format. However, sometimes you are not printing directly to *out*, for example when using third party logging libraries/services. Thankfully, we can also use clojure.pprint/pprint generate a pretty string by wrapping it in with-out-str.
Honeysql is an amazing library that lets you write SQL using clojure data structures. This makes SQL much more composable as you no longer need to smash strings together. That being said, when using it with postgresql there are some features that don't work out of the box. Thankfully, honeysql is very easy to extend. This post will show you how to add support for alter column and add constraint.
Namespaced keywords let you add a namespace to a keyword :id -> :user/id, this is a really nice feature that prevents collisions when merging two maps. For example merging {:account/id "foo"} with {:user/id "bar"}) would give you {:account/id "foo" :user/id "bar"}. This lets you avoid unnecessary data nesting and keep your data flat. However, by the time this data gets to the edge of your system, where it meets something that expects json, you will often want to remove these namespaces. This post shows you how to write a middleware that automates the removal of namespaces from keywords.
Have you ever deployed something to production only to have it break because of a missing environment variable? You can eliminate this risk with a simple macro.
Over the past 4 years I've had the fortune of working full time in Clojure. The backend for the Relish mobile app is built in Clojure. It runs on Heroku and we use lein as our build tool. This has been a great development experience. But, for the next Clojure project I wanted to try tools.deps and tools.build. Unfortunately, there isn't an official Heroku buildpack and none of the unofficial alternatives were quite what I was looking for. In the end I decided to roll my own to get comfortable with Heroku's build pack API.
Recently I stumbled over an old Java project from 2011. I wanted to see if I could get it to run. However, the original program had a bunch of IDE related build files that I no longer understood. What if I used Clojure to build the project? The fruit of that journey is covered in this blog post.
Say you are making a digital advent calendar app. You want users to get a special reward on the days that they open your app. But only once per day and only on the days they open the app. This sounds straight forward. What about time zones? What about users who open the app on the 1st of December at 23:55 and then on the 2nd of December at 00:03? Time is tricky.
Emacs is an interactive, self-documenting and extensible elisp interpreter. This makes it surprisingly enjoyable to extend. It goes something like this: you notice some friction when using a command, you use Emacs' self-documenting features to learn about the command, you investigate the source, you write some elisp, you evaluate it and you try the new and improved command out (all without ever having to restart Emacs).
I've always wanted to build Emacs from source as it lets you try new features. Native compilation in particular was something I wanted to explore. Native compilation leverages libgccjit to compile Emacs lisp code to native code making Emacs very snappy.