Stop running git config every time you clone a repository

The remote extension that Visual Studio Code provides makes developing inside a Docker container more convenient than ever.

Git config is not part of the container definition

However, during my usage, I found configuring Git identities a bit annoying since every time a container is built or re-built, I need to the following to be able to commit changes:

We can automate with local environment variables

The naive solution is to run the commands as part of the Dockerfile, but we don’t necessarily want to do that because (a) it exposes the name and email to the internet and (b) people will step each other on the toes if the repository has multiple contributors.

The…


Never struggle with broken infrastructure again

Running machine learning algorithms on GPUs is a common practice. Although there are cloud ML services like Paperspace and Colab, the most convenient/flexible way to prototype is still a local machine.

Stop it, use a container 🦺

Since the beginning of machine learning libraries (e.g., TensorFlow, Torch and Caffe), dealing with Nvidia libraries has been a headache for many data scientists:

  • The Nvidia driver/library and the hardware/OS can be incompatible which happens a lot on consumer-facing laptops/desktops.
  • The Nvidia libraries can have a version mismatch with the ML libraries which means you can’t let the system update libraries automatically.
  • ML processes and other processes can compete…


Say goodbye to release management and focus on building the features

Semantic-release is a tool to automate commit messages to version calculation to publishing flow for Node.js projects.

Combined with GitHub actions, developers can simply push code and the workflow will automatically calculate versions and publish the package to registries.

It’s super convenient. So convenient that it makes me feel bad for my Ruby projects 😂

However, after researching and tinkering, it turns out that it can be easily customized for Ruby projects.

Step 1: install Semantic-Release

The semantic-release tool can be installed as npm packages:

Note: it’s much easier to initialize a dummy Node.js project inside the Ruby project than installing semantic-release globally.

Step 2: configure plugins


Never forget to publish the latest GitHub Actions

What are GitHub Actions?

GitHub Actions are code-defined workflows that can be triggered by GitHub events to monitor repository health.

What are TS/JS GitHub Actions?

GitHub Actions need code to define the workflow and configuration to define the environment to execute the code.

There are three types of GitHub Actions:

  • TS GitHub Actions which define workflow with TypeScript and use a Node.js runtime as the execution environment.
  • Docker GitHub Actions which define both the workflow and environment with a Dockerfile.
  • Composition GitHub Actions which is a combination of multiple GitHub Actions.

TS GitHub Actions are commonly preferred when possible because it’s:

  • Portable: it runs on all operating systems whereas…


Look up GitHub faster with just gh

GitHub logo and search bar

As a developer, I spend a lot of time jumping between GitHub repositories, open source projects, and Stack Overflow questions.

It’s frustrating to start every new tab by searching on Google, looking through bookmarks, or typing the full URL.

In companies, developers commonly use some form of a “go to” link service internally to easily navigate. For example, developers will define gh to represent GitHub or q for Stack Overflow.

Similar services can be handy outside work as well.

There are a few solutions, but they are flexible enough for my use cases.

For example, golink is only enterprise-facing and…


Build an attention-free monorepo project

Monorepo refers to the practice of containing all sub-projects inside a single repository (by contrast, polyrepo assigns each sub-project its own repository).

Monorepo offers many benefits including:

  • Better code review: a single pull request can cover both the changes and the updates that go into their dependents. It encourages shared responsibilities (don’t just make changes, also fix the messes they cause).
  • Better deployment: a pull request is a deployment. Simple.
  • Better testing: a single suite of testing covers all components of a product.

To learn more about monorepo, there are many posts on this topic, and I will list a…


More productivity and less wait time

People huddled around a laptop.

Setting Up Monorepo Was Hard… Until 2020

Monorepo refers to the strategy of having all subprojects located in a single repository. By contrast, with polyrepo, each subproject has its own repository.

Monorepo brings many benefits, including better collaboration and shared responsibilities. There are many interesting articles discussing the pros and cons of monorepo. One of my favorites is Monorepo: please do! by Adam Jacob.

Just a few years back, setting up a monorepo project was complicated due to the incompatibility of frameworks. …


Use as your last resort for TensorFlow installation when nothing works

TensorFlow is a framework for building machine learning projects that is pretty easy to use. However, that doesn’t mean it’s always easy to set up, especially when you are playing with the bleeding edge features.

This post if for future reference

During the last few years, I have run into situations where TensorFlow won’t work in certain environments multiple times. Every time that happens, I had to spend hours searching the internet for fragmented information and extra hours to put the pieces together. This time, I decided to write up a detailed tutorial to save future situations where nothing works.

What went wrong this time?

Earlier today I was building a…


I don’t duplicate files, but when I do, I duplicate with style

In software development, in theory, we want to reduce duplicated information as much as possible and limit everything to a single source of truth to help improve maintainability.

However, in practice, it’s almost impossible to completely eliminate duplication since systems/frameworks are always incompatible in some ways.

Potential situations for duplication

Example 1

Mobile app projects can have a client app and a server, sharing the version information. …


Make your repository end-to-end automated

GitHub automation infra is ramping up

In recent months, GitHub has launched many tools for automation.

For example, Dependabot (through acquisition), an automated dependency management tool, GitHub Action, GitHub’s native CI/CD platform, and code scanning, an automated tool for vulnerability discovery.

This is great for independent open-source contributors because most of us can’t afford a DevOps team to maintain the side projects.

We still need to fill the gap generic tools can’t cover

However, every project comes in different shapes, so the generic tools can only partially cover the workflow.

Luckily, we developers won’t let the stock solution limit us.

If there is no automation that fits the requirements, then build one.

Steps to build a GitHub automation app

I will demonstrate how to…

Tianhao Zhou

A boba a day keeps bugs away. LinkedIn: https://www.linkedin.com/in/tianhaoz

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store