Alex Ho
Alex Ho

Software Developer

Gravity Supply Chain

I am a software engineer and half a DevOps engineer with interests in UI/UX development, API, software architecture and infrastructure design. C# and Javascript are the programming languages used in my day jobs. I love building some small CLI tools to make my work more efficient and those developer tools are written in Go and open-sourced. Besides hands-on work, improving hiring processes and building scalable development teams are some of the interests I have in recent years.

Cycling and trail runing are some of my hobbies and I like exercising in general.

Interests
  • Microservice architecture
  • Event-driven architecture
  • Docker and Kubernetes
  • Hiring and scaling development team
Education
  • BEng in Computer Engineering

    Hong Kong University of Science and Technology

  • HD in Electrical and Information Engineering

    The Hong Kong Polytechnic University

  • Sun Hing Holdings Ltd. Scholarship

    The Hong Kong Polytechnic University

Recent blogs

Offline retrieval-augmented generation (RAG)

GitHub Copilot was my first experience with generative artificial intelligence (AI). I was impressed by its ability to make code suggestions and to generate unit tests. Translation between code comments and code was pretty seamless even the technology was based on ChatGPT-3.5 in 2022.

OAuth and PKCE

OAuth is a common mechanism used to communicate with APIs and its Authorization Code Grant is the most-used grant type. In writing a CLI application to talk to these APIs, the interactions look like the following.

Bubble Tea

My software development work is mostly done in a terminal. So I suppose it is natural that most of my tools are using a command-line interface. Besides writing bash scripts, there are situations where I need to write CLI programs myself from time to time. In my day job of writing enterprise applications, I almost use C# and JavaScript exclusively. However, when it comes to writing CLI tools, Go is the language I preferred. There are many CLI frameworks written in Go but cobra is the one I used most. It is also a framework used by many tools like kubectl.

gum

I have been a full-time vim user for 5 years. Naturally, I’m also a heavy command line user and, even more naturally, I automate most of my workflows using commands in bash (sorry zsh). Writing scripts to automate stuff is fun. But there are times that I want to do stuff interactively with the shell especially workflow involving a number of parameters. One of the ways to go about it is writing a Go program. However, it could be too time-consuming even if I am proficient with writing Go. All I need is to glue different commands together. fzf is super handy when it comes to selections and it fits the use case of tmux very well. When it comes to things like asking for user input, presenting lines of data in a table or applying styles or formatting to output, there are not many good tools can be used with shell. Luckily, gum from charm.sh can solve most of the problems mentioned here. It is an executable written in Go (and it also means it can be used in all major operating systems). charm.sh has a number of CLI tools created but we will focus only on gum in this post.

More thoughts on Mastodon

This post is more like a continuation of Another social media app - Mastodon I wrote back in early November 2022. As of the time of writing, I have been on Mastodon (hachyderm.io) for 3 months now. I’m mostly happy with my experience so far and there are many positives. Although I have not made the complete migration from Twitter at the moment, I foresee that moment will not be too far in the future.