

Discover more from hrbrmstr's Daily Drop
Drop #294 (2023-07-12): Multi-threaded Edition v0.8.0
DIY SVG Sparklines 101; Get Woke; [Co]Lima
I'm pressing the “easy button” for today's Drop — choosing the “multi-threaded” grab bag — since we're headed to NYC for the NY R conference, today. Drop keyboard time has been subsumed by talk prep time, though I’ve admittedly also been goofing off building stuff in the AT protocol ecosystem.
Unless I get too spooked from being around humans in a big city/conference the Thursday and Friday Drops should be out right on schedule.
DIY SVG Sparklines 101
Sparkline charts are simple charts that are designed to show a general trend without details. Alex Plescan, the author of “Easy SVG sparklines”, uses them to visually indicate how many emails an inbox has received over time (he works for Mailgrip, a service that turns email newsletters — like this one! — into RSS feeds if they do not have one of their own).
The post explains how to create minimal sparkline SVGs by hand with Elixir code. Elixir code is very straightforward to grok, so please don't be dissuaded from checking it out just because it uses a language you might not be familiar with.
Alex shows how to draw a line using SVG commands and then scales it by setting a viewBox
. A fill is added to the line and the area is closed to fill in the gap. He shows the entire process, from the basics of three core SVG commands to the finished work.
The server renders the sparklines by defining a route that returns an SVG based on data points passed to it. The code uses the points to generate the SVG path and closed path commands. This eliminates the need to add more javascript to a page (at the expense of a network round-trip).
’Tis a very well-composed post that was both fun to read and gave me some ideas to riff from (hopefully it does the same for you!).
Get Woke
Woke is a tool that detects non-inclusive language in source code and suggests more inclusive alternatives. The goal is to help create an inclusive work or collaboration environment by identifying and replacing terms that may not be welcoming to all.
These days, the word “woke” is a fairly dangerous term to use in unknown mixed company. Which is unfortunate, as the term just refers to having an awareness of social issues like racial prejudice, and this tool aims to help spread that awareness within software development communities.
Companies and communities alike are increasingly focusing on using inclusive language to foster a diverse and supportive culture of collaboration. The Woke tool aims to help developers identify and fix any non-inclusive language issues within their code, regardless of programming languages or tooling environments used.
[Co]Lima
I suspect every reader saw “Lima: Linux virtual machines” on Julia's blog, and some of you may even remember a casual reference to it in a previous Drop.
OrbStack (something I still need to spend a full section or Drop on) has been working quite well in the VM/container space for me on macOS. But, Lima/Colima fill that same gap for free (OrbStack does have a spiffy GUI, though).
Lima and Colima are both tools that can be used for running virtual machines and containers on macOS. Lima is a project that allows you to launch Linux virtual machines with automatic file sharing and port forwarding. It is considered as a sort of unofficial “containerd for Mac” and is known for its speed and handy features for developers.
On the other hand, Colima is built on top of Lima and provides container runtimes on macOS (and Linux) with a minimal setup. It is designed to be a higher-level usage of Lima, utilizing it to provide Docker, Containerd, and/or (ugh) Kubernetes.
Colima installs the Docker container runtime in a Lima virtual machine, configures the Docker CLI on macOS, and handles port forwarding and volume mounts. This makes it a more convenient and full Docker Desktop alternative, showing a lot of potential for developers who want a simple and efficient way to work with containers on macOS. It competes with OrbStack in this regard, so I do not have Colima installed, but will likely switch over to it once I see OrbStack's pricing.
In terms of performance, both Lima and Colima are based on the macOS HVF (Hardware Virtualization Framework), so there might not be much difference in terms of CPU and memory performance. However, shared folder performance has always been a bottleneck for Docker on macOS. So, it's worth noting that Docker Desktop uses gRPC FUSE while Colima/Lima uses sshfs to share folders (which may be problematic since that project has been archived). Some users have reported that Colima is faster than Docker Desktop when running a local Kubernetes cluster using Minikube. Then again, those folks are monsters, so what do they know?
If you are looking for a tool to run virtual machines and containers on macOS, both Lima and Colima are viable options. However, if you want a more convenient and full-featured Docker Desktop alternative that provides Docker, Containerd, and/or Kubernetes, Colima might be the better choice due to its higher-level usage of Lima and additional features.
(Oh, and the name comes from LInux MAchines, according to slide 7).
FIN
There's still time to join (IRL or virtual) the NY R Conference sessions Thu/Fri. Hit me up if you need a discount code, and come find me if you're already attending! ☮