Image for post
Image for post
Photo by Tejasvi Ganjoo on Unsplash

Circe is a Scala library for decoding (reading) and encoding (writing) JSON. I’m a big fan of it’s simplicity, flexibility, and conciseness. This guide walks through a simple use case that illustrates Circe’s basic usage, creating a custom encoder and decoder, and common gotchas.

Below, I’ve created a simple JSON schema. The schema is composed of catalogs, which are named grouping of files, and blobs, which are composed of a URL pointer to a file and its checksum. Every object will have a UUID to uniquely identify it.

JSON Data Model

An example JSON object is below:

Scala Data Model

Circe can model JSON using…


Image for post
Image for post
Nerd Cave. Copyright Brian Schlining 2020

Security is imperative when writing web apps; but security and authentication are hard to do right. When developing client/server applications, I want to take advantage of solutions that are written by teams that really know how to do security well. For a recent project, I used the combination of Firebase for user authentication and JWT for securing the server-side APIs.

In this article, the server is a REST API written in Micronaut. All authentication and security is done using bearer tokens. The security flow is simple:

  1. A web or mobile app authenticates a user against Firebase and retrieves an id…


Java has about a googol available libraries for your software enjoyment. Most of them deployed to Maven repositories. If want a fast way to try them out, you can quickly…


Image for post
Image for post
Photo by Shahadat Rahman on Unsplash

Scripting is the art of creating a small, simple program to execute some task. Probably the most common examples are the bash scripts used to launch a program on macOS or Linux. If you find yourself typing the same set of commands over and over to accomplish a task, you may decide to wrap those in a simple script to save the tedious typing and mental real-estate needed to hold the sequence and syntax of the commands in your head. …


Image for post
Image for post
From https://cibotech.github.io/evilplot/plots.html

Jupyter notebooks are becoming a popular tool in data scientist’s toolboxes. As a free, open-source, interactive web notebook, researchers can combine software, explanatory text, and computational results in a single easy-to-follow document. Their interactive nature allows for users to execute code, quickly see the resulting output, and iteratively modify the notebook. This creates a living document allowing researchers to have an exploratory “conversation” with their data.

While Python is the default programming language used in Jupyter, Jupyter’s architecture supports back-end “kernels”, with different kernels providing support for additional programming languages. …


Image for post
Image for post
Photo by Scott Webb on Unsplash

In the Beginning

Once upon a time, I needed to call a microservice that could return a lot of data. So much data, that the request would often timeout. The usual solution to this is to request smaller chunks of data, also called pages. A page request takes two parameters, often called limit and offset. Limit is the number of items to be returned. Offset is the number of items to be skipped before beginning to return items

This being programming, solving one problem creates others. In my case, two problems appeared. First, this being the internet, an occasional page request would fail…


I recently purchased the book Classic Computer Science Problems in Python to help me brush up on my python. As I’m working through the Python code in the book, I’m taking some time to also port the Python to Scala. Below is an example the illustrates trivial compression for efficiently storing genes. A little science refresher, genes are typically made of Five nucleobases — adenine (A), cytosine ©, guanine (G), thymine (T), and uracil (U). Uracil (U) and thymine (T) are very similar except uracil is found in RNA, thymine (T) replaces uracil in DNA.

Below I’ll show the example…


When I wrote my last article discussing how I set up my new Mac, I realized that I’ve been using the same shell prompt for a long, long time. It’s pretty boring, looks pretty much the same in both my Bash and Fish shells, but has worked just fine for me.

Image for post
Image for post
My boring prompt

But it made me curious, I spend a large portion of my work day in a terminal, maybe it was time for me to revisit my simple prompt and modernize it.

And so I began my descent down the rabbit hole of shell customization …


I just got a shiny, new, fully-loaded Mac Book Pro.

Image for post
Image for post
Woot!

As I set it up, I’m inspired to point out a few more tools and configuration tweaks that are important for my development set up. This list is an addendum to my original post at “My macOS Development Environment of 2018”.

Productivity Tools

  • Magnet — A window manger for macOS. With a keystroke you can position a window exactly where you want it on your desktop. For heavy computer users, any tool to help cut down on mouse usage is greatly appreciated and this Magnet does exactly that. There are free alternatives…


As a person who writes a lot of code, I spend a great deal of time working from the command line. When browsing directories in the Mac’s Finder, it saves a lot of time to have a button that will open a terminal window into whatever directory is selected in the Finder.

A little AppleScript can makes this happen, so I’ve put together a script to integrate iTerm2 with the Finder. The code for the script is:

iTermHere.scpt

Steps to Create the App

  1. Open Script Editor
  2. Paste in the code above for iTermHere.scpt
  3. Save the script somewhere. The location doesn’t matter, but I usually…

Brian Schlining

Polyglot coder. Deep-sea Researcher. Zazen aficionado. I think squids are pretty cool.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store