Fencing Tokens: A Naive Example

After browsing through Designing Data Intensive Applications by Martin Kleppmann a few times, I kept coming back to the fencing token example. I’ve messed around with it for a while and have gone back and forth when trying to figure out how complex of an example to provide, but finally settled on starting out with a very simple example instead of the one outlined in the book. Firstly, because it is more approachable and secondly, it gives a good jumping off point to expand on later....

February 3, 2023

On Reading Difficult Books

tldr: limiting the books one reads by their ability to consistently entertain makes little sense and similar advice should be largely ignored I’ve seen some posts/advice pop up multiple times over the past month that recommend dropping books that you don’t enjoy and understood the direction they were going in, but don’t really agree. If reading is purely a leisure activity for someone then it makes sense that they might come to the conclusion that they should, as a rule, drop a book as soon as they lose interest or get bored....

November 4, 2022

How to Automage Messages on iMessage Using Bash and AppleScript

I recently threw together a simple and rough script that can be used to send many messages to a friend in rapid succession on a mac: MESSAGE=$1 TIMES=$2 BUDDY=$3 echo "$MESSAGE" for ((i=0; i < $TIMES; i++)) do osascript -e 'tell application "Messages" to send '"${MESSAGE}"' to buddy "'${BUDDY}'"' done just make sure to put the above in an executable file, and you can pass the arguments as such: ./FILENAME.sh '"uh oh, something might be broken"' 1000 1234567890 This will send the message “uh oh, something might be broken” to the phone number 123-456-7890* one thousand times in rapid succession....

October 27, 2022

Simple Unix Command For Creating Todos

alias newtodo="date '+%d-%m-%Y' | xargs -I filename touch filename.md" The above command creates a new markdown file in the current directory named with the current date (ex. invoking it today creates ./26-10-2022.md). I have been wading into using todo lists every day whether it be on paper or digitally and have settled on a simple digital format. The above alias has helped me reduce the barriers for creating a new list each day without automating away the physical act of creating something....

October 26, 2022

Using Temporal With Scala: Money Transfer

Note: the code for this post can be found here I recently stumbled across temporal and thought it sounded pretty cool. After checking out their repositories I decided to see if I could get an example working in scala since a java sdk is offered. I chose the Money Transfer example since that seemed the most interesting after a quick glance. First, let’s translate over Account.java since it’s just an interface with two methods....

August 2, 2022

Switching to Kagi

I have been using kagi in combination with DuckDuckGo for search lately and just recently decided to try kagi out as my daily driver after being impressed with the results. For those who don’t know anything about the relatively new engine, here is their own answer to “What is Kagi Search?": Kagi Search is a quick, user-centric, 100% privacy-respecting search engine with results augmented by non-commercial indexes and personalized searches....

July 28, 2022

Python 3.10, mypy, pytest, and Gitlab CI

Note: the full code for this post can be found here I’ve been messing with python 3.10 features recently in my free time, but wanted to dig deeper into setting up something more substantial by including mypy and some automatic validation using gitlab pipelines. I’ve been a long time fan of python, and it is one of my most comfortable languages at this point so spending more time getting “up to date” sounded like fun....

July 2, 2022

Swapping Tables With Dependencies in Postgres: Part 2

So after briefly looking into how views are stored, let’s do the same for functions. Hopefully, any references aren’t mutated whenever an ALTER statement is executed. First, let’s create a function that grabs the same info we were trying to grab in the earlier post: -- create a function to grab the detailed_message info CREATE FUNCTION fn_detailed_message() RETURNS TABLE( id int, content varchar, sent timestamp, received timestamp, recipient_first_name varchar, recipient_last_name varchar, recipient_phone_number varchar ) AS $$ SELECT message....

June 30, 2022

Swapping Tables With Dependencies in Postgres: Part 1

CREDIT: before getting into the post(s), the solution in Part 2 didn’t come from me or even my team. I spent a lot of time trying to figure out why exactly we were doing things this way though, so I thought I’d write up what I found… At one point when messing with transferring data into a postgres database I ran into a hard wall that had to do with how postgres implements tables and dependent views....

May 14, 2022