Archive: page 2
Explore the advantages of cross-compiling in Docker whilst working through a specific case involving a Node.js project using pkg, aiming for a Linux ARM64 architecture in the Docker build. Read more ⇒
DIY hybrid valve headphone amplifier (SSMH)
I made some circuit diagrams for the various versions of the Starving Student Millet Hybrid amplifier, which is a tube/valve headphone amplifier you can build yourself relatively easily for fun. Read more ⇒
Here are some of the window management shortcuts that I have discovered and found very useful having moved to working on a Windows 10 machine. Read more ⇒
The release of Jest 26 brought a new timer faking interface, which now supports Date mocks. I couldn’t readily find any documentation for this feature so, here is how I used in a project recently. Read more ⇒
Old versions of WSL can lead to issues with file system permissions with Node. Upgrading the version of WSL can solve this issue for you. Read more ⇒
Rope working fids make it easier to splice ropes, but they can be expensive to buy for a small DIY project. Here are some ideas of how to make your own fids and the required dimensions of each fid size. Read more ⇒
To make the construction and maintenance of more advanced types easier it can be helpful to write some tests that ensure their correct function. This sounds a little easier than it turns out to be. As part of the ecosystem for TypeScript Microsoft have written and released the dtslint tool. It can be used to link and compile TypeScript types for static analysis and mostly serves to keep the @types/* packages in line. Read more ⇒
As TypeScript applications get more complex so do the types required to describe it. There are a number of built-in types that can be used for this purpose or combined to create more specialised types. What I term modifying types such as Partial and Required are included in the language and I will quickly cover these first to warm up for the deeper types we’ll address later. This article will quickly move on to focus on the slightly more advanced types beginning with Extract. Read more ⇒
TypeScript constructors and generic types
I have recently found myself needing a type for class constructors that is at once generic and tight enough to ensure a genuine constructor. This is useful in situations where you must handle a variety of classes - those that come from other libraries or applications that you cannot control. When writing your own dependency injection container or some other generalised library you cannot know what class constructors might be passed in. Read more ⇒
The lambda calculus for developers
This will be a quick introduction to the lambda calculus syntax, alpha (α) equivalence and beta (β) reduction. What does a lambda look like? I am going to use the identity function as an example for the simplicity it provides. This can be expressed as a lambda function with the notation λx.x. It is a function that when given an argument outputs that argument as its return value. You can also have multiple arguments with a lambda like λxy. Read more ⇒