The Benefits of a Component Library, for Non-Technical Readers

Introduction Component libraries are a tool that have been around for nearly a decade in the frontend world, yet it is still not a tool widely adopted in many organisations. Software engineers who work directly on the frontend have a better opportunity to understand – with nuance – the usefulness of component libraries in terms of longer-term productivity. This article is an attempt to convince non-technical folk of the same. The comes with the belief that with more understanding, comes more willingness to bite the bullet, and see the use of component libraries as an investment, more than a cost....

May 13, 2024 · Joel Tok

Nx is a Standardisation Tool

The way Nx is Marketed Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI. The above is a description of Nx taken directly from the nx.dev homepage. To me the keywords in this mission-statement-like paragraph are “build system” and “monorepo”. When I first read this, I came away with the idea that it was a way to create and enable monorepos, and automatically handle CI/CD....

March 17, 2024 · Joel Tok

Debugging Docker

Introduction Docker is a powerful container deployment and management tool, but its abstractions might sometimes cause a headache when faced with the need to debug issues with docker applications. I wrote this blog post to alleviate some of mine, structured as a sort-of checklist. When working with Docker, it is useful to think in terms of these 3 aspects of dockerisation: build, container and the docker runtime (or daemon) itself....

September 1, 2022 · Joel Tok

React Hook Form – Blur on submit

Problem I’ve been working with the deliciously productive React Hooks API recently, and have been using React Hook Form as my go to form abstraction. There was one issue I faced lately however that bothered the heck out of me: When the user hits enter on the keyboard, for some mysterious reason I was not able to get the input to blur. Even if there was no validation errors, and the data was successfully saved, the input just....

July 19, 2022 · Joel Tok

Camunda – Service Task Benchmarks

Given that we want to execute certain service tasks in Camunda directly, is there a noticeable difference in performance when using different implementations? What is Camunda? And what is a Service Task For those unfamiliar with the platform, Camunda is an open-sourced engine that allows you to design processes using visual diagrams. These visual diagrams are represented using a specification called BPMN, or Business Process Model Notation. BPMN Diagrams provide an alternative to designing and implementing processes in code....

November 21, 2021 · Joel Tok

LocalStack with Gitlab CI

LocalStack is an open-sourced server application that lets developers emulate Amazon AWS Services on their local development environment. It can be used as part of one’s development environment, but also as a way to support the running of E2E tests, first in the local environment, then in the CI pipeline. LocalStack in the local environment E2E tests are usually run in the local environment first, and in this case all we need to do is simply make LocalStack available for use on localhost....

September 9, 2021 · Joel Tok

Memory Optimisation – Python DataFrames vs Lists and Dictionaries (JSON-like)

Introduction In this post, we want to evaluate the memory footprint in Python 3 of data stored in various tabular formats. In particular, we want to compare DataFrames, to JSON-like data structures like List of Dictionaries, and Dictionaries of Lists. The above are 3 different ways to store table-like data. Table-like data is basically data represented by rows and columns. In this examination, we will ignore any questions regarding efficient read/write or lookups....

June 7, 2021 · Joel Tok

How to Save, Load and Use ML Models in Metaflow

I became very intrigued with Metaflow because of its DAG (Directed Acyclic Graph) approach to building ML models, which seems rather intuitive when you think of a machine learning model as a series of processing steps. However, I did have one big concern when it came to Metaflow – production deployment. As it currently stands, production deployment with Metaflow seems highly coupled to AWS. This is a problem to me, because my personal preference is to self-host using my own dev-ops setup....

April 15, 2021 · Joel Tok

Building an Event Bus in Python with asyncio

Dec 2022 Edit – Due to a significant amount of interest, readers can find a ready-made PyPI package here. Introduction Building efficient event buses requires strong support for parallel processing. This is because scalable event buses usually require multiple events be fired in parallel, and these events should not block each other’s execution during extended input-output (I/O) operations. Python is by default single-threaded, using a single core for processing. This means that building an event bus in python used to require the heavy use of multithreading, with its attendant complexities and pitfalls....

March 15, 2021 · Joel Tok

Python 3 — Run async function synchronously

Problem How do we run an asynchronous function in a synchronous script? Python’s await async syntax can be a real life-saver when it comes to running highly concurrent code in a performant manner. However, sometimes we just want to call an asynchronous function synchronously. Maybe we have a small application where performance is not a big issue, or we just want to reuse some async functions in an experimental script. In such situations we do not want to rewrite the whole implementation to use only an asynchronous approach....

February 15, 2021 · Joel Tok