Using the Cloudinary APIs from Clojure

24.07.2018 02:00

There are a few advantages to Clojure running on the JVM. One of the biggest is that we can use any Java library in our Clojure projects. Two other is that we can take advantage of all the awesome server infrastructure stuff that exist for Java services and that we can build a .jar file that runs everywhere with a Java Runtime installed.

Most of the time you want to use something that is packaged to be nice to use in Clojure. But you don’t always have that option, and it is really nice to just import some Java libraries when that occurs. The way you do this is that you add the dependency to lean like any other dependency. Lein will look in both Clojars and Maven for packages you add. And then you load the classes or packages you need using “(:import)” instead of “(:require)” in your code. Now you can just do something like (.methodName className) or (.methodName objectName). I’m going to write more about this in the future.

I have put together this GitHub repo, with some code showing the basics of interacting with the Cloudinary API’s from Clojure using the Java SDK.

Erasors on top or not?

23.07.2018 02:00

Some pencils come with erasers on top, while others don’t. I would personally prefer to not have them there at all, because I just pull them off and sharpen both sides of the pencil. But for those who use them: is it that difficult to make a pencil with one that actually works?

Fine I get it that you have to cut some corners if you make cheap pencils, but when we pay around $2 per pencil I think we should be able to expect the fucking thing to work.


23.07.2018 02:00

Minimalism is a subject I have been obsessed with since I was an avid listener of the Enough Podcast. My impression is that a lot of people have a misleading impression about what it means. You probably think about some Steve Jobs like person sitting in an empty apartment drinking tea and meditating.

The idea is not to have nothing, the idea is to have less. If you take everything you own, and you question everything, and get rid of everything that doesn’t fulfil one of two purposes: you need it; it makes your life better in a meaningful way. For example I need a few pairs of shoes, but I do not need 100 of them. I do not need a large computer screen, but it improves my life in certain situations in a meaningful way. Like for example making it easier to work at home.


21.07.2018 02:00

I can’t wait until Flickr and the Yahoo account crap are gone.

Clojure on the Apple Runtime.

20.07.2018 02:00

You can write iOS apps using various different programming languages. You have Swift and Objective-C; and you various ways you can do it with Javascript. There are ways where you can use C#, and of course game engines are used to make the same game for many different platforms.

But I’d love to see Apple extend this. One of the awesome things about .NET and Java(the real kind, not the Android thing) is that the virtual machine or the run time is designed in a way where you can use Java libraries in other programming languages running there, without having to implement specific packages allowing it.

I want to write native iOS and Mac apps using Clojure. Someone else might want to do so using Ruby or even PHP. I have no idea if this is possible with the current iOS or Android runtime, but I’d love it if we moved against a world where all the app development stuff wasn’t so tied two a couple of programming languages on each platform.

Top 3

20.07.2018 02:00

My top 3 favourite pencils, in order:

  1. The Blackwing 602
  2. The Field Notes Pencil
  3. The Golden Bear.

The 602 is the better pencil because of how smooth it is to write with, and how comfortable it is to hold, while the Field Notes pencil is even more comfortable to hold but not as smooth to write with. And the Golden Bear is a great pencil, but a much more crude and basic pencil. At the end of the day however, I prefer the Golden Bear because it is much less expensive and I can buy it in bulk. For the price of One and half box of 602’s I can get 144 Golden Bears.


19.07.2018 02:00

A REPL or read eval print loop is what we called an interactive prompt back in the day when I learnt Python and Ruby.

It is a awesome tool when it is combined with the right language. For example, I love it with node or Clojure; but I hated it with Python. And it doesn’t make that much sense with C# or Java.

For a REPL to make sense you need to be able to test small chunks of code. Like this function or this expression; or my typical thing, “would this work” or how the fuck was that syntax again?

In other words, if your language require a lot of “foreplay” to run code, like declaring a namespace and a class etc (I’m looking at you Java and C#) it will probably not be the right thing. But if you can evaluate code without much fuss it is. Another thing that is really important is that you need to be able to just paste code into there. This is something that always drove me nuts about the Python REPL. It is so interactive that everything gets fucked up when you paste crap.

REPL’s are awesome, and can make your development really fast, if combined with the right language.

Life without Dropbox

18.07.2018 02:00

It have gone a while since I got rid of my Dropbox account now. The majority of my Dropbox use was syncing my folder of text files between my laptops and my phone. And I almost never used it on my phone.

Then I started to look into alternatives. The obvious one is to use Git. And that’s what I did.

I have a cron job both on my MacBook and my ThinkPad that pulls, commits and pushes every minute. If there are any changes. And I use Working Copy on my iPhone; for the rare times when I actually need access to my notes when I only have my phone.

It works great, bu the iOS experience could be better. But the solution as a whole is awesome. I can work with my notes anywhere that have git and a text editor. I’m not locked in to any syncing solution or any app. If git isn’t my preferred solution anymore I could change to what the next thing is fairly fast.

Keyboard Maestro

17.07.2018 02:00

I do not know how many times I have downloaded and done a trial of Keyboard Maestro without “getting into it”.

Keyboard Maestro is a power tool that this blog post wont fully cover. But think of it as a tool to do various stuff on a given event. That can be a keyboard trigger, you connect to wifi or that you click “run this macro”. What you do can be all different kinds of stuff, you should take a look at it to get a proper overview. But the stuff I currently use it for is when I want to override default app shortcuts by running Apple Script that does kind of the same thing, but not entirely. Or my work around for the lack of proper batch operations in Lightroom CC. The short version is that I want to “Auto tune” a large collection of images. Typically after I import something etc. The way you have to do this is to open a image, click the button, move one to the right and then repeat. I made a keyboard maestro macro that loops over it a pre defined number of times.

It still takes a long time, but it frees me to drink coffee or beer while watching my MacBook slaving away.

This is the tool you want if you want to do some really geeky shit on your Mac.

Edit for iOS

16.07.2018 02:00

Edit is a great iOS writing app that is about as minimal is it could be.

It reminds me a lot about a app that Patrick Rhone had a role in back in the Minimal Mac / Enough days called Pop (Piece of paper).

The basic idea is that you have an app that is just a large text input area. And that’s it. No sync, no files, or anything like that. This is Edit. And it looks fantastic, has some really cool buttons to make it easy to mark everything and copy it somewhere else.

It might sound very similar to Draft. But they are two different tools for me. Edit is where I write something a little longer on my phone, that probably will require a few “sessions”. While Draft is where I take quick notes and capture stuff.

Edit is very simple and minimal. It might not be your kind of thing, but I love it.