Author: Richard

Using Typeahead.js without Bloodhound

programming

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-5f976c534e572200650908/]  

Naming service classes in Rails

programming / rails

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 […]

Will VC eat itself

startups

There was a post on TechCrunch a few days ago about the big lie in startups and how you can’t run a startup without lying about a million things. When I really think about all these funded startups it upsets me, mainly because I’ve tried to bootstrap all my endeavours. That does make me sound bitter, and I am if I’m honest about it. If you start a company, get funding and fail you’re still often […]

Nginx proxy_pass a folder to WordPress

servers

After a rash of security updates for WordPress, I finally buckled down to move our install of WordPress off to it’s own server. This would be easy if we were running the blog on it’s own domain, but it was actually living under /blog on our main domain for SEO reasons. Running nginx as a reverse proxy to WordPress on a different machine was not an easy task. A lot of guides did not seem […]

Business Design Principles

computing

Facebook’s Four Business Design Principles is an excellent reference that should be at the core of every business tool. Help people learn and grow Balance efficiency and effectiveness Bring clarity to complexity Be accurate and predictable The majority of my time these days is spent writing tools for business as opposed to consumer facing sites and trying to find the balance between ease of use and providing all the elements necessary to complete a task […]

BEM CSS

programming

All too often I find that CSS quickly becomes a real tangle of clashing styles and names. No matter how hard I try something always ends up breaking the styles of something else. Moving to SASS helped a lot but I find on the flip side I end up with styling that’s overly nested. I’ve recently come across BEM which is CSS methodology for naming classes. BEM stands for Blocks, Elements, Modifiers. I’ve previously looked into SMACSS […]

Who designs car parks?

annoyances

Riddled with tight gaps and high kerbs they are the often the most anti-car friendly places on earth. I am convinced that the people who design car parks must be sadists. I have yet to see a car park wall that isn’t covered in different colour streaks from all the mis-judged turns. Why not have sloped kerbs so that you don’t scuff your wheels or bodywork if you misjudge the spacing? Why not give a little bit […]

I’m a pirate but I’m open to options

computing

Pirating TV shows, music, games and applications is just so ubiquitous these days. Where as once it took some degree of knowledge, now everyone seems to do it. I don’t believe people pirate things because they want to steal but because there are no reasonable alternatives. For instance, since getting a Spotify Premium account, I haven’t downloaded any music. I dislike pirating shows as I feel that by doing so I’m not really showing any […]

Better sort by rating with Spree and spree_reviews

computing / programming

The blog post How Not To Sort By Average Rating continually pops up and got me thinking about how we currently implement sort by rating. We currently use spree_reviews for capturing ratings and it takes a very simplistic approach to storing the average rating for a product: This exact scenario is mentioned in the blog post above: Why it is wrong: Average rating works fine if you always have a ton of ratings, but suppose […]

Into the abyss

quotes

Beware that, when fighting monsters, you yourself do not become a monster… for when you gaze long into the abyss. The abyss gazes also into you. Friedrich Nietzsche

Zen and Happiness

life

There is no need to start happiness after 20 years. You can be happy right now, even when you are not a Partner or don’t drive a Porsche. Things change to easily. You can get sick. You can get fired. You can burn out (if you follow all these items I guess likeliness is low). Until these bad things happen, just work as well as you can and have fun with doing it. No reason […]

The technical debt of your former self

computing / programming

As we mature and become better developers there’s a funny case of code we previously wrote taking on a certain amount of technical debt purely because we have more experience and knowledge on how to tackle the same problems. We’ve all been there, having gone back to look at code we thought was great at the time to only wonder what the hell we were thinking, or gone back to reduce a long method to […]

First things first

life

I have a small check list of things I aim to do every day. This includes things like meditate, write, vlog, foam roll/stretch etc. The problem is I put off the majority of them until late at night and on most occasions end up skipping them in favour of going to bed. While I get to say I got some of the things done, I’m still treating them as an after thought to the rest […]

Not so remote

computing / work

Fostering a team feeling when everyone is remote can be extremely difficult. It’s easy to feel like you are working in a total silo, and can be made worse if everyone is spread across distant timezones. Being able to function as a team is a key component to project success. Feeling isolated and alone when problems come up can make work frustrating and stressful at times. Here are a few ways to try and overcome […]