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.
An example JSON object is below:
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:
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. …
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.
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
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.
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.
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”.
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:
Polyglot coder. Deep-sea Researcher. Zazen aficionado. I think squids are pretty cool.