Bennett Hardwick

Blog

Rewriting Facebook's "Recoil" React library from scratch in 100 lines

September 09, 2020 - 1796 words - 9 mins
Recoil is a slick new React library written by some people at Facebook that work on a tool called “Comparison View." It came about because of ergonomics and performance issues with context and useState. It’s a very clever library, and almost everyone will find a use for it - check out this explainer video if you want to learn more. Read More…

Creating a blazing fast static website without Gatsby or JavaScript

June 09, 2020 - 1242 words - 6 mins
Gatsby, React, and static websites are all rage at the moment. Though they aren’t without their flaws, for the most part, I’ve been riding the bandwagon. Over the last year I’ve been working daily helping maintain a large Gatsby site, working on a Gatsby personal site and enjoying flexing my Gatsby merch . Read More…

Don't use boxed trait objects for struct internals

December 24, 2019 - 1279 words - 7 mins
When writing a struct with the intention of it being reused, it’s important not to use boxed trait objects to represent interior data. Namely, this is because turning an object into a Box<dyn Trait> loses a lot of type information about the object which is difficult to get back should the developer consuming your struct need it. Read More…

Writing safe, efficient and parallel Node.js extensions with Rust, Neon and Rayon

November 26, 2019 - 1197 words - 6 mins
When writing server applications with Node.js, sometimes JavaScript just doesn’t cut it and you need to employ native code. This could be because of a few different reasons: You need to complete a CPU-bound task Because JavaScript runs inside a VM, every operation will take longer than the native equivalent. Read More…

Using Vim as a web development IDE

June 23, 2019 - 1174 words - 6 mins
Two weeks ago I decided to make the jump - finally changing from Microsoft’s Visual Studio Code (Code) editor to Vim. Despite months and months of strenuous golfing , there was always something in my road when I tried to change editors. Read More…

Why you should be force pushing your branches

May 27, 2019 - 834 words - 4 mins
A lot of people hate force pushing. I hear the same argument over and over again, that needing to force push to a branch means you’ve done something wrong. I detest this! In fact, I’d argue that needing to force push to a branch means you’ve done everything right! Read More…

8 Vim tips and tricks for advanced beginners

January 06, 2019 - 1977 words - 10 mins
A few weeks ago, I saw this post by Robert Hearton which outlined a few programming projects for advanced-beginners. It talked about the idea of the “valley of despair”, and offered up some ways that might help you get out of it. Read More…

How to complete the Advent of Code 2018 challenges with Rust

December 07, 2018 - 1011 words - 5 mins
Over the past month or so I’ve been learning the Rust programming language. When I heard that Advent of Code was starting up again, I figured it would be a great opportunity to put some of the skills I’d learned to the test. Read More…

How to hack (QUT CAB441 cheat sheet)

October 29, 2018 - 2671 words - 13 mins
Purpose of this post This cheat sheet is the main resource coming in with me into my CAB441 Network Security exam. As we have access to the internet, it was encouraged to create a sheet that would be readily accessible and CTRL-F-able. Read More…

Changing from X.org and i3wm to Sway and Wayland

October 06, 2018 - 1199 words - 6 mins
I decided to move my Arch Linux i3wm configuration over to Sway today. Partly because I was bored, but mainly because everything has been feeling really sluggish lately. I started to notice problems when using VS Code. I couldn’t really describe what was going on, but when I typed it just didn’t quite feel like I was typing in real time. Read More…

Speeding up Arch Linux AUR build times

April 17, 2018 - 274 words - 2 mins
I have a T440s that runs Arch Linux. It’s the computer that I use at University and I spend a lot of time programming on it. One of the things that I hate about it however, is the amount of time it takes to build a package from the AUR. Read More…

Fixing broken Japanese fonts on Arch Linux

March 30, 2018 - 435 words - 3 mins
Setting up fonts for Japanese and other non-latin languages can be a bit difficult on Arch Linux. I find that every time I configure a new system I forget how to make it work perfectly, and I end up wasting hours trying to find the right answers. Read More…

JavaScript by reference AKA opening up a box of function side effects

March 30, 2018 - 421 words - 2 mins
I’ve been using JavaScript for quite a long time. Up until now, I felt like I was some kind of expert - no project was too large or too small for me to complete! I was unstoppable! That was until I found out that objects and arrays are created by reference, and my world collapsed. Read More…

Making Typescript packages JavaScript friendly

February 06, 2018 - 579 words - 3 mins
I don’t know about you, but when I first started using Typescript it was an absolute game changer for me. Even for simple projects, where I’d be writing less than 100 lines of JavaScript, I’d always opt-in to using Typescript instead. Read More…

Parameters go backwards in C

October 31, 2017 - 345 words - 2 mins
The funny thing about C, is that it gets harder the longer you spend trying to learn it. In the beginning, C seems like an incredibly simple language. Hell, there’s only 32 keywords! But as soon as you nail the basics, it’s difficulty increases exponentially. Read More…