Notes on code, tech, startups, health and music.

Au Revoir Sprockets, Hello Propshaft!

What is the Asset pipeline? In short, the asset pipeline in Rails helps us deliver JavaScript, CSS and images in the most performant and reliable way we can without being too onerous for developers to maintain. The “pipeline” in this context being the set of tools and processes applied to our asset source files during the build process to prepare them for optimized delivery. There have been many ways to do this over the years,...

Track Deployments in Appsignal with Kamal

Application Monitoring In a previous article I shared a quick tip on how to track deployments with honeybadger.io. Had some likes, retweets and nice comments on twitter (X) after sharing it, like this from Mikael Henriksson that had replies from both Joshua Wood the co-founder of Honeybadger.io, and Roy Tomeij the co-founder of Appsignal! Appsignal OK! So, eager to please - and also grateful for the stroopwafel cart at Rails World from fellow Foundation members...

Track Deployments in Honeybadger with Kamal

Application Monitoring Making sure you’re tracking errors, performance, uptime etc in your app is important even for the solo dev. In my career I’ve had experience with countless tools and platforms, but in recent years been a big fan of Sentry.io. I like the interface and it works great for Rails apps. This time though I wanted to try out something new, and had heard about Honeybadger.io as a great (and free) option for very...

SSL Handshake Failed 525

Error As I’ve done every day for the last year or so, I opened up my 1500cals app to log my morning coffee to be greeted with a white screen with an error message! My first thought was I was pleased the error screen looked nice and was informative, but “525 error” wasn’t one I could instantly recognize, unlike the usual suspects like 501, 404, 503 etc I pulled up the web version of the...

One Year, 32 Posts

One Year! I just realised, after setting up this personal site with the idea to write some articles, a year has passed already and 32 posts published! It’s not something I’ve done a lot in the past, other than mostly write ups of events I had hosted or attended for Cookpad over at sourcediving.com. So, having written a couple of posts in January 23, and not shared them at all, I set myself a goal...

Automated Database Backups with Kamal

Intro I wrote about my experience with Kamal last month and have since kicked off another project and successfully deployed to Hetzner with Kamal. These are small, personal projects of course, so very limited on terms of exercising scale, but equally they are things I’d typically be deploying to Heroku or Fly.io in the past, so deploying to my own servers is a real win! I built a small app to help managing pitches, scopes...

Sorting Lists with Ranked Model

Intro I tweeted earlier this week that one unexpected benefit of writing very detailed technical how-to articles on this blog is that I can refer back to my own posts and they’re EXACTLY what I need :D I kicked off a new personal project last weekend (more about that later), and having so much fun! The modern Rails stack is insanely good these days and a joy to work with. But wait… I need to...

Deploying with Kamal

Intro I’ve been hosting 1500cals.com on fly.io as I wrote about previously, and frankly, its really great. Particularly to get a Rails app up and hosted in minutes, harkening back to the old Heroku days when it was the defacto answer for almost instant free Rails hosting. However, last year when DHH introduced Kamal my interest was piqued! He described it as A simple yet battle-tested deployment tool extracted from our cloud exit, which features...

A First Look at Solid Queue and Mission Control Jobs

Background Jobs Background jobs are something most web developers need to start reaching for whenever there’s a long running task, or something outside the scope of a typical web request. One classic example, and the one we’ll use as an example today, is sending email. Of course Rails makes it easy to send emails with ActionMailer, and you can send an email asynchronously to a user in response to them clicking a ‘forgot email’ link...

Rails - The One Person Framework

History I’ll make no bones about it. I love Ruby and I love Rails! I was lucky to see DHH’s seminal Ruby on Rails demo video How to build a blog engine in 15 minutes in 2005 while I was working at a startup in San Francisco. At the time I was leading a team building J2ME, Brew and WAP mobile ringtone apps, with the backend all implemented with Java Servlets and JSP running on...

From Idea to App Store in 2 hours!

OK, I’ll admit it, “From Idea to App Store in 2 hours” was mainly to get you to click and a riff on my friend - and Turbo Native expert - Joe Masilotti’s excellent post “Idea to App Store in 7 days”, but hear me out. This is a true story about the power of Ruby on Rails and Turbo Native apps which was made even more apparent to me this weekend! Since my little...

Looking back on 2023

2023 was a big year. I built and launched an app, continued focus on a healthy diet, kept up with running 3 times a week, started a new job, learned a lot, traveled a lot, met lots of great people, old and new friends… a great year all in all! Here are some highlights, mainly for me to reminisce and remember. 1. Maintain focus on health Having totally changed my diet in 2022 and lost...

1500cals in the iOS App Store!

1500cals is now in the iOS App Store! Quick Announcement: I’m thrilled to announce that just in time for those New Years resolutions, 1500cals passed certification with Apple first time, and is now available to all for FREE in the iOS App Store! Check it our and download it here: https://apps.apple.com/us/app/1500cals/id6470238113 I started building this just for myself to solve the annoyances I had with other calorie counting weight loss apps on my journey to...

1500cals iOS App Launched!

New iOS App Very excited to announce 1500cals for iOS is now available via Test Flight! I previously wrote about my journey to lose 50kg (110lbs) last year, the tools I used and then about the new app I was building to help plan meals and track exercise. I built this app for myself as I really wanted to use all the great features in Rails 7, Stimulus and Hotwire. The other key piece in...

New App Alpha!

Putting it out there When I wrote about the app I’ve been working on last month it was really good to step back a bit from coding and take stock enough to document and share my thoughts and progress. I wasn’t really sure what to expect in terms of feedback though. Despite having shown it quite a few folks I happened to meet in person, and had lots of positive comments, I’d not had the...

Reflections on Writing

Reflection I don’t really remember why I decided to start publishing articles on this site, but it’s been 10 months now and 20 posts later so I thought it would be interesting to reflect. My real motivation was to write up some technical notes purely for my own use. I tend to document things and take notes in BBEdit, and end up with a ramshackle bunch of un-named snippets of code, links and thoughts, and...

New App Sneak Peek

What’s New? I’ve written before about my weight loss journey last year where I lost 50kg through mostly watching what I ate and starting to exercise. The main “trick” I uncovered is simply to plan meals ahead. It sounds boring, it sounds annoying, but really its such a tiny effort for such outsized and life changing rewards that it should be a no-brainer. The existing tools I found were more focused on tracking after eating...

Spectacular Rails World

Rails World 2023 I’m just home from the inaugural Rails World conference in Amsterdam, and the word that keeps popping in my head to describe it is simply “Spectacular”. In my role at Cookpad I’ve been fortunate to be the driving force behind our sponsorship and support of over 50 Ruby and Rails events around the world in the last ~10 years, and it’s something I’m immensely proud of, but what I just experienced was...

Get Started with Strada! A First Look on iOS

Tada! I mean, Strada! If you’ve been following along, you may know I’ve been getting quite interested in Turbo Native iOS for Rails. If you haven’t been following along.. why not! Anyhow, to recap, Turbo Native enables rapid development of hybrid apps, by wrapping a Rails 7 turbo-enabled webapp in a native iOS or Android shell. It really is fantastic and exposes so much more than just a simple web browser. The big news yesterday...

Active Storage CDN with Cloudfront and Subdomain in Rails

What we will be doing This post assumes you’re using Active Storage in a Rails app and want to switch to using a CDN. I’m writing it down because I spent all day figuring this out yesterday, and couldn’t find a definitive “how-to” article anywhere! In this article we will: Switch Active Storage to “Proxy Mode” Get an SSL cert for your sub-domain if you need one. Add a Cloudfront distribution in front of your...

Password-less SwiftUI Native Auth with Turbo iOS

Overview This post continues on from my last, where we implemented Password-less Authentication in Rails, which powers the backend to the app in this post. You can get the finished Source Code on GitHub or if you prefer, follow along below from scratch. What we’ll build In this article we’ll build a Turbo Native iOS app in Swift that wraps our Password-less Authentication Rails app from Part 1, enhancing it with native Swift UI authentication...

Password-less Auth with Rails

Overview I much prefer websites and apps that offer a way to sign in without needing a password purely from a usability standpoint, but there are some great benefits for developers too, for example: automatically confirm the user’s email address no need for sign in and sign up flows no need to implement “forgot password” Based on this, for a recent project I implemented password-less authentication for the web. Since this project benefits from HealthKit...

iOS Development Diary Part 2

Recap I’ve had a lot more free time in the last few weeks so really doubled down on my iOS adventures with Swift, Rails 7 and Turbo Native! In my first article about this journey, I left off somewhere deep in a quagmire of confusion and architectural patterns MVC, MVVM, MVVM-C patterns, and to be honest, it wasn’t too fruitful. Emerging from the Rabbit Hole In the end I was looking for something that didn’t...

Commitments vs Goals

Commitments vs Goals Recently a friend shared a blog post with me that resonated so strongly I wanted to highlight it here. The article focuses on the “words” we use and how they shape behaviour. This really fits how I’ve been thinking and achieving my goals on my weight loss and health journey over the last 18 months. When we say “my goal is to lose 20 kilos” or whatever it may be, it really...

Hollywood Calling - Vampires Anonymous

Another post from a distant memory of my time as a sound engineer, tour manager and musician in the 90’s Setting the Scene Way back in 1999 I was still living in California, having moved there while working with legendary british band The Specials, and after they split I kept working with their singer and good friend Neville Staple. He wanted to keep touring and to stay in Long Beach, so had formed a band...

iOS Development Diary Part 1

How Did We Get Here? I’ve been obsessed with writing computer programs since I was 12, and been gainfully employed doing so professionally for the last 20+ years using the likes of C, PHP, Perl, Java, JSPs and Ruby. I’ve really settled on my preferred toolkit and platforms, and what I enjoy the most is building products and services for the web, bringing them to life and to global audiences. I’ve gotten pretty good at...

Learning to Fly... with Fly.io

Deploying a Rails app I’ve historically always reached for Heroku to deploy little apps and side projects when I wanted to push them out for others to see and use. When Heroku ended their “free” plan, several new platforms seemed to emerge or old alternatives gained renewed interest, such as render, hatchbox, fly, digital ocean and many others. In this post I’m going to focus on Fly.io which I’ve used a couple of times and...

Three Mics for Ray Charles

Posts in #music are from my previous career as a live and studio sound engineer in the 90’s. Feel free to skip ahead if you’re only here for the tech :) The Sun Theatre, Anaheim, CA. June 4th 1999 Way back in 1999/2000 I was the House Sound Engineer at the Sun Theatre in Anaheim California (now called “The Grove of Anaheim”). It was pretty new, launched in 1998 as what WikiPedia calls the “ill-fated”...

Turbo Native Quick Start

Rails 7 and Hotwire As I mentioned in a previous post, Rails 7 is a real inflection point in terms of capabilities out of the box, the efficiencies and frankly a joyful development experience. You truly can get the speed and interactivity of a single-page web application without having to write any JavaScript. High-fidelity hybrid apps Turbo Native is a further part of the Hotwire ecosystem that enables development of hybrid apps, by wrapping a...

Dynamic Search with Hotwire

Hotwire is an incredible framework for making rich, responsive, and snappy client experiences with the minimum of complexity. It leans on Rails standard concepts of convention over configuration and omakase to deliver a simple developer experience without any trade off to performance or capabilities. In this example I’ll describe how I added a very simple dynamic search feature to a side project I’ve been working on, with a trivial amount of code and effort. The...

The World's First Alexa Widget

With the public release of Alexa Widgets announced for developers this week, I thought it would be a good time to write a little about my experience working with the fine folks at Amazon on the world’s first third party Alexa widget that we developed and deployed at Cookpad 16 months before this public release back in December 2021. Update: Amazon published an interview I did with them about widgets on their blog Three questions...

How I lost 110 pounds (50kg) in 9 Months!

First an important caveat: I’m obviously not a doctor, so before you make any drastic changes to diet or exercise, talk to yours. It all started with the results of a health check. I was really overweight after years of sitting behind my computer every day, not exercising, eating biscuits. I learned I was “pre-diabetic” with an HbA1c of 43 mmol/mol but I could turn this around completely if I lost a lot of weight....

Couch to 700k... and Counting

I’d seen the Couch to 5k program recommended a few times while working on improving my diet, and got as far as downloading the app (iOS/ Android) more than once. It took a couple of weeks to actually try it, and I have to admit, the first week or two were gruelling. It really seemed impossible that I would ever be able to run 5k, given how I felt after the 60 second runs of...

Rails 7 - Talk about a Revolution

Love, Love Me Do I loved Rails the instant I watched DHH’s “How to build a blog in 15 minutes with Rails” around 2005. To set the scene, at the time I was working at a ringtone startup in San Francisco (remember ringtones?!). The business was doing amazingly well - our first million dollar ringtone was 50 Cent P.I.M.P. in all its polyphonic glory - and we had a small dev team delivering a pretty...

Alexa Custom OAuth Account Linking with Rails

Custom skills with Amazon Echo devices provide a great way for users to interact with your product or service by voice. This is something particularly true at Cookpad where users are cooking, so their hands are often busy or messy with ingredients. Voice provides an excellent way to interact with a recipe while cooking. Conversely, searching by voice is really not a great experience. We’re all used to searching websites and perusing lists of results,...

Enhancing Your Alexa Skill with GPT

Alexa and GPT There are a myriad of possibilities that seem to be available with the explosion of Chat GPT, and like everyone else, I wanted to see what I could do with it as soon as I got access to the API. Use Case My first idea was to try and implement a way to ask Alexa for substitutions in the currently selected recipe. This is a really useful feature and simple enough to...