RSSAmplifier

Blog

Zikani's Blog

Zikani's Blog

code.zikani.meRSS feed ↗20 posts

Latest posts

How to populate a PostgreSQL test container in Go for integration testing

In this article I will show you how to setup a minimal test using testcontainers-go. We are going to extend some ideas from my last article on generating fake data to to insert random data into the te

Generating test data in JSON, CSV and SQL formats using Go and Faker

Sometimes, you may need to generate fake data for use for testing behavior of your systems or for load or volume testing, for example to test that pagination behavior works well with hundreds or hundr

Machine Learning based SPAM detection using ONNX in Java

In this article I go over how I implemented a Spring Boot API for Spam Detection using an advanced anti-spam model from the Hugging Face onnx-community and Microsoft’s ONNX Runtime for Java. We will package the API up as a Docker image which we can r...

Using the Zig built LightPanda browser for web automation via playwright-go

I am working on a browser automation thingy and want to try supporting LightPanda as I am interested in seeing if it may be a good lightweight alternative to Chromium for CI (Continuous Integration) tests. Komaso (that’s Chichewa, you can read it as ...

Preparation Isn’t Enough: Preempting Your Future Self

Whenever you work on anything, it's typically to address a present or future need or activity. As much as that is the case, most tasks that people work on were defined or specified in the past. Thinki

Pipelined PostgreSQL Queries in Go

In this article we will see how to leverage Postgres support for pipelining queries which “allows applications to send a query without having to read the result of the previously sent query”. This allows you for example to perform batch updates which...

Using git-monorepo to merge existing Git repositories into a monorepo

In this article, we will look at how to use a tool I built named git-monorepo to merge existing Git repositories into a monorepo while maintaining the complete history from each repository. This can be useful if you want to reduce repository-sprawl a...

How to use EmbeddingGemma to generate embeddings in Go

Embeddings or Vector Embeddings are the numeric representation of text or other data that enables a lot of Machine learning tasks like classification and clustering. If you are familiar with the concept of embeddings or have some interest in machine ...

Make educated guesses, even if they turn out to be wrong

One observation I have made working with fellow developers, especially those with less experience or just getting started is the lack of confidence to make educated/informed guesses about things. I encourage junior developers I work with to learn how...

Masking and anonymizing people's names in text using Go for increased privacy

I am working on a personal CRM/Note taking app and wanted to show my friends how it works to get some feedback and ideas from them, just in case I consider making it more widely accessible tool or maybe even Open Source. As I was thinking about how t...

Storing encrypted data in Postgres with Go

In this article, we will see how to store a Go object (struct) as as encrypted data in a database. We will assume Postgres for this article, but the technique should work with other databases as well. To show the versatility of the technique, we will...

Building a Go microservice for calculating cash-out or admin fees

In this article we will see how to implement a micro-service to calculate administrative fees. We will use the concept of cash out fees for a fictional mobile money service operator, using Go armed with only the standard library for the HTTP server a...

Should African DevOps engineers treat servers as Cattle or Pets?

When I first heard the expression, “Don’t treat servers as Pets, treat them more like Cattle” it immediately made sense to me, based on what I knew about the value of Cattle and Pets, then I heard the real explanation that made me pause … and chuckle...

Tingoyenera kukhaladi mavenda

This article is written in Chichewa. I wanted to try something different. Here goes nothing Mawu oti venda nthawi zambiri amatikumbutsa anyamata ndi amayi a mtawuni kapena kumsika omwe amagulitsa zinthu zosiyanasiyana monga nsapato, katundu wa magets...

Generating random project names using Chichewa words

Modern day developers are no strangers to automatically generated project names, these have become common and you may run into them if you use for example: Vercel for deploying projects Fly.io Docker (Desktop) ... and many other modern tools that...

Is the Kitchen Sink the best place to think?

This article was authored at the kitchen sink. As a young Malawian bachelor (some rude people would say senior bachelor), I often find myself at the kitchen sink doing dishes. Not only because it's the one skill I am confident at in the kitchen when ...

Generating PDF from Markdown with Go

In this quick-n-dirty article, we will see how to generate a PDF from a user-submitted markdown with Go. We will build a simple service using the standard library's net/http for the backend and EasyMDE, a browser editor, for handling markdown on the ...

Implementing a Custom ID generator for Hibernate entities in Java

If you have used Hibernate before you know that you can specify that an Entity class should have it's @Id fields set via @GeneratedValue - typically you use either a sequence or identity strategy to automatically generate, say, auto-incrementing inte...

A few PostgreSQL tricks

In this article, we will look at some cool, practical query tricks you can use in projects that use PostgreSQL as the DBMS: Order results but select a specific first-row This trick allows you to write a query with an order-by clause which allows you ...

Keeping @JsonProperty and Bean Validation field error messages in sync in a Spring Boot project

Damn, this one bit me very recently. So imagine you have a Java API and because of whatever reasons you agreed that the JSON properties for the requests should be in snake_case_form. Cool, cool, that just wants a simple Jackson @JsonProperty annotati...