When you have sports coaching, whether that be for martial arts or golf etc, often the coach will look at your technique and say “you’re doing it all wrong!”. And then you find that each coach has their own theory on how it should be done, even claiming other coaches don’t know what they’re talking about. But when you look at all these different theories and techniques, when you put them into practice, at that […]
Hello and welcome! My name is Richard Hart. I specialise in helping organisations build great products with technology. This is my personal site where I write a mix of blog posts and notes on various topics. In many cases these are un-finished thoughts and ideas. This stems from the ideas of having a digital garden and learning in public. Leadership Find Your Leadership Style
The best developers I have worked with have all been incredible in self-directed learning. And yet a common pattern that I see more junior developers get stuck on is not knowing what to learn to progress their skills as a developer. I spend a lot of time reading, whether that be blog posts or books, watching talks or listening to podcasts, I have never found myself short of topics to look into more or things […]
While trying to setup a new Rails 5.2 app in Intellij it would continually be detected as a web project and give no way of adding the Ruby on Rails module. The solution is to delete the node_modules folder before creating the new project.
Working with a SOAP API with Spring Boot WS. I was getting the following error trying to create the request. I was originally directly using the JAXB generated classes to form my requests: The correct way is to use the provided JAXB ObjectFactory: But to prevent marshalling errors you need to wrap your object in a JAXBElement object: [crayon-5f374bc612a1d968923919/]
One of my bad habits is constantly buying computing books. This wouldn’t be so bad if I read them, but I have amassed a huge backlog of books that will most probably never be read and which ends up being a waste of money. A couple of posts I read recently have led me to the decision that I should stop, or at least drastically cut down on, buying computing books. The first post talked […]
Trying out chruby and ruby-install and installing Ruby 2.2.2 with ruby-install was giving be the error: [crayon-5f374bc614950101184805/] Setting the LDFLAGS env var solved this for me: [crayon-5f374bc614959146138156/]
To run Alacritty without spawning a new terminal window you can use Automator to create a new application wrapper. Create a new application document and choose Run Shell Script as the action. Then simply add the path to your built Alacritty and save the document to your Applications folder.
Made this mistake today while writing some code to delete data out of Redis. [crayon-5f374bc6149c1446393896/] The mistake was in the final method keep_keys. Every check to see if a key should be rejected I was adding an element to the flattened_keys array over and over again, causing my deletion to slow down over time. A simple change to memoize the keep keys made the process go from never finishing to, completing in a few seconds. […]
Copying files to a Synology NAS was painfully slow with Carbon Copy Cloner. Following the official help of ejecting the volume in Finder made all the difference. Syncs now happen as fast as they should do.
Text in iTerm looked a little fuzzy after moving to a non-retina 4K monitor. I discovered that setting thin strokes to always be on has made text look a lot crisper.
Being able to recommend products to shoppers is a vital part of any online store. The “Customers Who Bought This Item Also Bought” section can lead to a lot of extra sales if done well. The Jaccard Index is a way of measuring similarity between items. Using some custom SQL we can extract the values we need: [crayon-5f374bc614a28807819367/] With these values we can then calculate the affinity between sold products: [crayon-5f374bc614a2c971730198/]
Since my last post about generating random email addresses in TextExpander, I’ve move from using Ruby to Applescript to do so. Here is my script which essentially does the same thing. [crayon-5f374bc614a94127242818/]
A great library for adding typeahead support to your site is Twitter’s Typeahead.js. Even better is the excellent Bloodhound suggestion engine which comes with it. Sometimes though if you’re dealing with a remote suggestion engine like Elasticsearch’s completion suggester you don’t need to run remote results once again through another suggestion engine. Bypassing Bloodhound is as simple as hooking your own source function into your Typeahead definition. [crayon-5f374bc614adc763391441/]
One of the core ideas of Rails is convention over configurations. Models go in app/models, controllers go in app/controllers and views go in app/views. The danger is that we stick to those conventions no matter what and we end up either with fat controllers, fat models or even worse a mixture of both. Many times we don’t take enough advantage of Ruby’s object oriented nature and the ability to extract functionality out into separate classes. Doing […]