Clojure cli and deps.edn

19.04.2019 17:11

When I started to learn Clojure, there was two options: lein and boot. They were kind of the two big options to managing dependencies and building your project. Lein is this huge monolith that includes more or less everything you need and want, but you kind of need to build your project around how it works. And then you have boot that everyone likes better, but most people still use lein because it just works.

Then Cognitect released Deps.edn and the clj / clojure cli stuff. Edn is like JSON but more lispy, and deps.edn is a way you can define three different things: paths, deps and aliases. Paths are where you code is located, deps are your dependencies and aliases are just a way to write aliases for clojure/clj commands per project or globally. Where clj foobar expands to a longer clj command with a lot of options. Kind of similar to what you can do with the scripts stuff in node projects.

The cool thing about deps.edn is that you can add the file to a directory, add a few deps, run clj and it installs them and they are ready to be loaded from the repl. The reason this is interesting is because it only takes care of a few minor parts of what your projects neeed in a way where you can pick other tools to take care of the rest based on what you need. And because both boot and lein have their own ways of dealing with what deps.edn does it will be harder for them to adopt to this.

The way I look at it is that deps.edn provide all the “glue” that ties it all together. And then you just need to add what you need on top if it to get what you need, to build, pack and lint etc.

In my bag

18.04.2019 19:45

I’ve been meaning to post this for a really long time. But every time I’ve gotten to it something new I planned to have in it was on the way to me. This is not just in my bag, but also stuff I have on me, in my pockets etc.

In my pockets / on my person

  • Glasses. Cheap Specsavers storebrand. They basically look like something Elvis Costello would have worn.
  • Apple Watch: Series 4: space gray with a sports loop.
  • Trove Wallet. Red and blue.
  • iPhone 8 Plus, space gray with a popsocket.
  • Keys: just a plain key bring with one of Luna’s old dog tags on it.
  • A piece of cloth to clean my glasses.
  • Bellroy Field Notes case, with Field Notes, some Index Cards and a Golden Bear pencil in the spine
  • A YStudio Fountain pen is always in my pocket.

In my Bag.

  • Misc cables: USB-C to USB-C, USB-A to micro-USB, Lightning USB-C, USB-A Apple Watch charger.
  • Mophie XXL powerbank.
  • Nintendo Switch
  • Kindle Paperwhite 2008.
  • Nock Co Seed A5 case, with a LT1917 Bulletjournal notebook and a Lamy 1.
  • Nock Co Pencil Case with a lot of Golden Bears. I use it to bring sharp pencils to work and bring dull ones back. Usually around 12 in it.
  • Audio-technica ATH-M50x headphones
  • A few Lightning to jack dongles.
  • LT A few lines a day 5 year journal.
  • My work ID/key card, paracetanol, fishermans friends.
  • My 24H Water bottle. Keeps my icewater cold for at least 24 hours.
  • Contigo coffee mug. I’m going to replace this with a more durable one in not too long.

Bullet Journaling with Dashplus

14.04.2019 18:06

For as long as I have been using notebooks for managing my life, close to ten years by now, I have used Patrick Rhone’s Dashplus during most of that. It does more or less the same as the bullet journal notation. I have decided that I’m going to do my Bullet Journaling with Dash/plus instead of the standard notation. I changed this a couple of months ago. Why? No particular reason, they are very similar and there are no advatages to one over the other. But there is one huge advantage to dash/plus for me, I have used it for so long that it would take me a really long time to unlearn it. p

Emacs, flycheck and eslint

14.04.2019 18:04

The first thing I did was to disable eshint and standard.

Then make sure you have a .eslintrc or .eslintrc.js file in your repo; one of them is sufficient.

The next step is to install eslint and all your plugins, configs etc globally (yarn global add or npm i -g). There are ways to get it to work with per project installs, but this is way easier.

Then make sure eslint works. just run eslint –print-config . until it prints the config. Then run M-x flycheck-validate-setup (double check this command) and make sure it work, and restart emacs. And that should be it.

Likes from my Instapaper

12.04.2019 23:22

A while since last time, I wanted to automate this process a little bit. Then I didn’t hear back from Instapaper about a API token and I went for a less ideal solution. It is a lot better though. Long story short, I wrote a node script that parses a exported csv files. I’ll probably get it up on Github soon, I just need to clean it up. And I’ll probably get back to doing this weekly now that it takes much closer to a few minutes, than 15.


11.04.2019 19:27

  • Julian Assange is a piece of shit.
  • He has not been convicted of anything except “failure to surrender to the court”
  • I have no opinion about what WikiLeaks do today, but I was and still am a big supported of what they did back in 2010
  • Extraditation is a legal concept I have a lot of problems with, and is just a giant mess.
  • Especially when a country you’re not a citizen of or wasn’t in when the ‘crime’ occoured.
  • I get that Ecuador had problems with his behaviour, but anyone would get crazy by basically being in house arrest for close to 7 years.

Some minor adjustments to how I use my Seed

07.04.2019 20:43

I started out using both of the pen loops in the Seed, but I have since stopped doing that. I still carry two pens. But I keep on in the pocket on the outside instead. The reasons is that if I use both of them I have to use the inner most pen. Most of the time that is what I want to do, but sometimes I am using some other pen and it is kind of clumsy to have to take the inner most pen out to be able to write in my notebook.

Micro arcitecture

07.04.2019 20:42

When I say micro arcitectures I mean everything from micro frontends, to services and packages. This means that instead of having a utilities package and a ui-compontents package you may have 10-100 of smalelr packages instead of one large.

Or that you build a smaller app that may contain maybe 20 smaller apps instead of one huge.

There are reasons for this. But it is not because it gives you better performance or because it is easier. It is not.

When you break things up, you do this because you want to update things idenpenent of each other.

If you can push out an update to the login page when it is ready, and then you move over to the registration page and so on.

And on the packages side, you do it to have more flexibility. Let’s say there is a bug in the button package in the latest version. But all the others works fine. If you had a monopackage structure you’d have to wait. But with a micro package system you could just update everything except that.

But there are some things you need to remember if you are looking at this. This is for situations where you are a lot of developers, where build times are limiting how often you can relase. Or that things are so big that it is a real pain to deal with.

I have gone back and forth on this a lot. If smaller companies should do it at all. And I think it depends.

I think everyone should get into and get setup to build smaller packages, and to make smaller components that can be shipped independent of each other sooner than later. And then unless you are really big I’d start thinking about spinning off everything that feels like it is really different from the rest as its own thing.

What I use Emacs for

05.04.2019 22:03

This is a short list of the stuff I use Emacs for.

  • General text editing and notetaking
  • All my blog posts are written in Markdown using Emacs
  • Notes are written as text files
  • Programming in JavaScript, React, C#, ClojureScript, Cucumber tests, Bash scripts, PowerShell scripts and probably a lot more.

Why I love the Golden Bear

31.03.2019 22:59

I just finished a pack of Blackwings, and I’m back with the Golden Bear. And I really love this pencil.

Having a soft pencil feels really good, but my personal favourite is something a little bit firmer close to a HB. And the GB is just that.

It is not expensive at all. You could get 15 blackwings or 144 Golden Bears.

The thing I love about it is that it is a really good pencil, similar quality to the Blackwings, but it is not as nice. The result is that it is a lot cheaper. That means that it is easy to just carry a lot of them without it feeling very expensive.