How to start a Node.js project
Sometimes I write blog posts to remind myself what I’ve learned and sometimes I write them because someone else shares something and I want to remember that better. This post is one of the latter.
2018 in review
I’ve never been one for writing a review of my year. This year I’ve found myself not only reading, but comparing myself to others’ reviews. I realised that this is not particularly helpful, so decided I’d give myself something to compare myself to at the end of 2019. Thus, here is my first year in review.
Service workers: beware Safari's range request
You’ve implemented a service worker to cache some assets. Everything is working well, your service worker is a success, you’re feeling good. But then…
Techniques for animating on the canvas in React
I recently experimented with audio visualisation in React on the Twilio blog. While I meant to teach myself more about the web audio API I found that I picked up a few techniques for animating in canvas within a React project. If you’re creating a canvas animation in React then perhaps this will help you too.
Implementing one time passwords in Crystal
Crystal is still a young language, there aren’t a lot of libraries available yet. For some this could be offputting, but for others this is a chance to learn about a language and provide useful tools for those also starting to use it.
Git commands to keep a fork up to date
I’ve seen the following tweet about git making its way around Twitter recently:
Spring clean your dev machine
Development machines can build up such a lot of cruft. Old versions, oudated programs and unused caches litter the hard drive. It’s good to take time once in a while to clean all of this up and free up some space.
Use the web share API easily with web components
I’m a fan of the web share API but I was not happy with my initial implementation of the API. It was all a bit complex for what is a very simple API. I wanted something more declarative and easier to use with a more generic fallback for when the share API was not available.
CSS: select first-of-class with the subsequent sibling combinator
There are a whole bunch of CSS selectors available to web developers, but sometimes there’s still not enough. I found this recently when building the speaking section of my site and wanted to use the non-existent
:first-of-classpseudo class to apply some styles.
gzip a file in Ruby
At the start of the year I looked into how to better compress the output of a Jekyll site. I’ll write up the results to that soon. For now, here’s how to gzip a file using Ruby.