Programming Protips

Small posts meant to document the solutions to problems I've encountered while writing code and deploying apps.

Build a simple object validation utility with TypeScript

TypeScript has become incredibly powerful, and its type system lets you build a great deal of similarly powerful functions, tools and utilities. In this post, learn how to build a simple object validation utility that uses TypeScript's type system to provide compiler safety for the validation rules and the resulting objects.

Slimming a Docker container from nearly 8gb to under 200mb

As web developers, we're no strangers to massively bloated containers. While many apps quickly bulk up in size once you start adding Node and frontend packages, even a dotnet app with no node_modules can still get pretty hefty once the dotnet SDK and package dependencies have been installed. This post covers the steps I used to slim a container from nearly 8gb in size to less than 200mb.

Keeping models in sync with Reinforced.Typings

Keeping types in sync between the server and the frontend has been something I've obsessed over for most of my dev career. Rediscovering the Reinforced.Typings package has helped me tremendously in apps that have a .NET backend and a TypeScript frontend

Elmish's program.mkSimple versus program.mkProgram

Having spent over a year with F# and Fable at this point, I've avoided Elmish for the entire time, until recently. I found model-view-update architecture a little strange, but what really tripped me up was not understanding the difference between ELmish's program.mkSimple and program.mkProgram.