Things become complicated when public methods of a class call each other. This can be demonstrated fairly easily with some examples:
Maybe Functions
The maybe function is a subtle monster that spreads it’s tentacles across the code-base. It’s alternating functionality of “does/doesn’t do something” makes code hard to understand, maintain and debug.
🔗Example
Here’s a specific example, it’s a “maybe” function as it only returns the friends of a user, if the user is logged in. Basically it introduces a possible return null
.
function maybeGetUser(): User | null { |
The history of writing tech!
There’s been many recent revolutions in writing technologies, and I thought it would be interesting to compare them and the way they affect the author’s ideas.
We can break down the methods of writing into several technological categories. Each new invention builds on the previous technology, improving writing in different ways.
Rest in Peace Frank
Frank was a good dog. I valued his existence and am sad that he is gone. But during his 3 years with me, he taught me so much…
Bug Driven Development - Sometimes it's the best choice
Tests are great, they catch errors before release and verify that the code does what it says it does. However the TDD (Test Driven Development) way of doing things is to write the tests before the implementation of the feature. Which has several drawbacks:
Github Stale Bots: A False Economy
Stale Bot’s are a type of automated bot on Github, which locks issues which are “stale” (as in have no recent activity). This seems like a helpful tool at first, but in reality it’s terrible for all parties involved.
Easiest Static Sites on Dokku!
I love dokku but deploying a simple HTML site is actually quite annoying, so I made dokku-pages
.
🔗1. Install
npm i -g dokku-pages
🔗2. Deploy Dokku Site
dokku-pages deploy -g dokku@mysite.com:app -d dist --minimal
That’s it!
🔗Optimization
And by using the minimal flag you can also save a tonne of space in your dokku instance.
Deploy Command | Dokku Type | Image Size |
---|---|---|
deploy ... |
Herokuish Build Pack | 1.5 GB |
deploy ... --minimal |
Docker Build | 22 MB |
That’s a saving of 98.5%
!
Anyway, hopefully someone else finds this useful.
Round Coffee Table
Ally and I made a table together today (it took 3 weekends in Dad’s shed). We were inspired by a few tables, so this isn’t entirely original but we put our own spin on it.
Reach for the bolt first...
An industrius mechanical engineer is designing a machine and is faced with the problem of attaching a component to another component. What does he do? Well he quickly solves the problem, by selecting several bolts which would hold the two components together… just as he had thousands of times before…
Wave Power Generation From Bicycle Parts
In 2006 [1] Stefan Nyström invented the [2] WaveReaper and released his plans online in 2008. This invention used parts of a bicycle to reap energy from the ocean waves. It surprised me that not much has happened since then (and the website is [4] no longer up), so I thought I’d write a little about it.