February 20, 2023

Error handling with Either in Java and Kotlin

TLDR Either is either Left or Right with values inside. Either is a union type. It's a concept that is language agnostic. It's right biased. Left is used to transport/represent errors. Right is used to transport/represent the successful data. =flatMap= and =map= are used to chain them together. bind is sugar over =flatMap= and =map= to make the code more sequential and easier to read. It short circuits if it gets a Left. Read more

August 4, 2022

Emacs on Macos Monterey

Intro Got a new computer from work, this is some quick notes on how my Emacs setup looks. Run Emacs as daemon with LaunchAgent. Fetch mails periodically with mbsync via LaunchAgent. Install brew install --cask emacs brew install mu brew install isync brew install gpg brew ls --verbose emacs brew ls --verbose mu Mu4a Replace USERNAME with your info. mkdir -p ~/.mail/work ~/.mail/gmail mu init --maildir=~/.mail --my-address=USERNAME@gmail.com --my-address=USERNAME@work.com mu index mbsync -Va mu index Mbsync config cat ~/. Read more

January 23, 2021

Learn RxJava with Emacs Org mode

Intro RxJava is a Java library that can be used to create non blocking reactive systems in Java. The mindset of non blocking and how to work with RxJava was a bit hard for me to grasp, and still is! I am by no means a skilled RxJava user. But I have found a tool that helps me on the journey to become a better one. And of course this is Org mode and Emacs. Read more

July 22, 2020

Emacs Orgmode Source Code Blocks 2

Intro This is the third post in a series about Emacs Org mode and the second about source code blocks. The last post about source code blocks (blocks from now on) covered org document variables, named blocks and combining blocks. This post will focus on how and where block result output will end up. It won't cover all of the arguments and features as I don't use all of them. Read more

July 20, 2020

Learn AWK with Emacs

Intro This post describes my workflow for learning the AWK programming language using Emacs, Org mode and Org-drill. The workflow may work for other programming languages. The post won't cover details on how to use Emacs, Org mode or Org-drill. It's intention is to provide a general overview of a workflow. A git repo is available with flash cards, note book and some text files here. Content I just read a few chapters in the "The AWK programming language" book and found AWK to be awesome and I want to learn more of the language. Read more

June 21, 2020

Emacs Org mode tables

Intro This is the second post in the serie of how I use Emacs Org mode (from now on org) and it will cover usage of org tables. Some of the content assumes basic knowledge about org. If you are new to org I can recommend this two videos; hrs and kitchin. Org tables are like spreadsheets with super powers. Tables can be used to keep information organized, as input to source blocks (more about that in the first post, "Emacs Org mode source blocks") or used in calculations. Read more

June 15, 2020

Emacs Org mode source blocks

Post updates [2020-06-23] New section. "Combine source blocks" Intro It's time to start documenting how I use Emacs Org mode (from now on org) and it will contain a serie of posts. This is the first post and it will cover source blocks. Some of the content assumes basic knowledge about org. If you are new to org I can recommend this two videos; hrs and kitchin. One of the features I've been using very frequently is source blocks. Read more

May 22, 2020

Quick overview of Clojure spec, test.check and transducers

Into A quick and dirty overview on some of the capabilities of Clojure spec, test.check and transducers. With focus on generative data. Describing models with spec and then use test.check to generate entities from that model. Bulletproof transducers with the generated data. Wont cover or explain details, instead show how it can be used. Some examples where generated data can be used: Provide generated data through a Rest API endpoint and serve it a JSON. Read more

May 17, 2020

Entity event log in Datomic

TL;DR Create an event log from Datomic transactions that's related to an entity. Look at transaction metadata, diffs and the entity from different angles. Intro I am pretty new to Datomic and writing a small Clojure app. In my domain models I have a model called event-log. This model is used to keep track of changes (mutations) in the system. It have the following attributes: author, datetime, entity, id, type. Read more

Powered by Hugo & Kiss.