When to commit Generated code to version control
Generated code, ideally, should not be committed to version control. Committing generated code can sometimes speed up testing and code generation but it is a design smell. It is better to cache...
View ArticleHermetic docker images with Hugging Face machine learning models
Hugging Face is GitHub for machine learning models. Their on-the-fly model download scheme, however, is difficult from a DevOps perspective. Here’s how to disable it. One huge problem with downloading...
View ArticleHow to setup Go packages under monorepo
Let’s say you want to have two Go packages pkg1 and pkg2 in a monorepo setup. Here’s what a good project structure would look like. Here’s my recommended project structure in that case src/pkg1 | |-...
View ArticleCommon pitfalls of GitHub Actions
If you create GitHub Actions via GitHub’s UI by going to the URL of the form https://github.com///actions/new, it provides templates for setting up the build. However, the template is broken. There are...
View ArticleTest changes to CircleCI config locally
Rather than pushing the code to a remote branch and then testing via Circle CI servers, it is best to run the tests locally first and make them work. Here’s how you can do that. Install circleci CLI...
View ArticleReact Native
There are tons of hyped-up claims surrounding React Native that are worth addressing. The reasons why companies run for React Native are usually, We already use Javascript for the website and now, we...
View ArticleAndroid: Catching NDK crashes
On Android catching Java exceptions is easy via UncaughtExceptionHandler. Catching NDK crashes is a bit more convoluted. Since the native stack is probably corrupted, you want the crash handler to run...
View ArticleDocker: Be careful about the scratch image
After I wrote my previous post, some suggested that I can cut down the image size further by using a “scratch” image. And that’s true, “scratch i”s a reserved 0-sized image with nothing in it. And...
View ArticleIndeterminate Progress bar is an inferior UX design
60 milliseconds is when we notice something isn’t immediate. Any user interaction, that involves sending data over the network or doing heavy computation on it, usually takes way longer than 60...
View ArticleHow many source-code repositories should a startup have
Recently, this question came up during the discussion. “How many source-code repositories should a startup have?” There are two extreme answers, a single monorepo for all the code or repository for...
View ArticleThe two-step approach to big code modifications
We all have to make significant code changes from time to time. Most of these code changes are large. Consider the scenario that you merged one such significant change, and then other team members made...
View ArticleIncremental testing: save time and money on CI for monorepo
To use monorepo or not is an eternal debate. Each has its pros and cons. Let’s say you decide to go with monorepo, one major issue you will face over time is slow testing. Imagine a monorepo,...
View ArticleHow to deploy side projects as web services for free
In 2020, the web is still the most accessible permission-less platform. For the past few months, I have been playing and building side-projects to simplify my life. I started with a Calendar Bot for...
View ArticleDocker 101: A basic web-server displaying hello world
A basic webserver Docker containers are small OS images in themselves which one can deploy and run without worrying about dependencies or interoperability. All the dependencies are packed in the same...
View ArticleConsoles by Google
A single developer has to sometimes deal with 7 different consoles by the same company… Google Analytics console – to see website analytics Google Cloud console – to access Google Cloud Platform Google...
View ArticleThe first two statements of your BASH script should be…
#!/usr/bin/env bash set -euo pipefailThe first statement is a Mac, GNU/Linux, and BSD portable way of finding the location of the bash interpreter. The second statement combines “set -e” which ensures...
View ArticleKeep your dotfiles bug-free with Continuous Integration
Just like many software engineers, I maintain my config files for GNU/Linux and Mac OS in a git repository. Given that, I wrote a fair bit of them in interpreted code, notably, Bash, it is a bit hard...
View ArticleStanford CS251: Cryptocurrencies, blockchains, and smart contracts
Lectures Introduction Creating a Digital currency Bitcoin Overview Bitcoin Blockchain Bitcoin Mining Bitcoin Miner interactions and Game Theory Cryptocurrencies: Community, Economics, and Politics...
View ArticleAndroid: Fragment related pitfalls and how to avoid them
Don’t use platform fragments (android.app.Fragment), they have been deprecated and can trigger version-specific bugs. Use the support library fragments (android.support.v4.app.Fragment) instead. A...
View ArticleAndroid: Handling JPEG images with Exif orientation flags
A JPEG file can have Exif metadata which can provide the rotation/translation field information for a raw JPEG image. So, a landscape raw JPEG image could actually be a portrait because it’s EXIF...
View Article