Posts

  • "Forking" Promise in Javascript

    Avoid duplicate backend fetches or expensive operations by “forking” a promise.

  • No Integer Wrap Around in Postgres

    Integers in Postgres do not wrap around. Instead they throw an “integer out of range” error.

  • Classic Web Worker in Vite JS Dev Environment

    By default, when running in dev mode, Vite loads Web Worker script in module mode [1]. While this is compiled away in production build, it presents a problem if you’re developing with legacy web worker scripts that must run classic mode.

  • Simple Counter Could Save You 100% or More on Car Repair

    My dashcam has an unfortunate design flaw that caused it to fail to record a recent accident. More frightening is how easy it is for anyone to make the same mistake.

  • Kubernetes Horizontal Pod Autoscaler in Terraform

    A conflict arises when using kubernetes_horizontal_pod_autoscaler in Terraform along with a replication controller or deplyoment. This post shows how to resolve this using Terraform lifecycle.

  • Hermetic Python with Bazel

    This post walks through how to hermetically build a python interpreter in bazel and set up the toolchain.

  • Protobufs in Python with Bazel

    Currently, there’s no canonical implementation of py_proto_library in bazel. This post shows how to build protobufs for python using the version from the protobuf team.

  • Sleepy or Thoughtful?

    I told my parents about this blog today. My mom has an interesting interpretation on the name - perhaps koalas are actually thinking very deeply when they look asleep!

  • Scholar Meets Soldier

    秀才遇到兵, 有理說不清 is a Chinese idiom that summarizes one of my greatest fears. Translated literally, it means “a scholar meets a foot soldier - cannot reason with the soldier.” The implication is that it’s impossible to communicate with an ignorant person, since soldiers in ancient China were usually not well-educated. Recently, I learned about an equivalent phrase in English, stated eloquently by Martin Luther King Jr. as “Nothing in all the world is more dangerous than sincere ignorance and conscientious stupidity.”

  • Lesson from a Rice Cooker

    In addition to eucalyptus leaves, rice is also a staple for me. Today I gained a new understanding about a feature on my rice cooker that also shed some light on how my own brain thinks and how new technology can be non-intuitive for existing users.

  • Go Modules in Bazel

    Recently, I wanted to import a go library into my bazel workspace that uses a moduled version of another library that already exists as an unmoduled version in the workspace. Here’s how I made gazelle generate right dependencies.

  • Hello World!

    I have wanted to start a blog for a long time now and the COVID-19 shelter-in-place order gave me plenty of time to finally get started.

subscribe via RSS