~/writing

Software writing with a long memory.

Notes on Ruby, Rails, infrastructure, and the small choices that make code easier to change.

#6fce33Double-click to submit form pattern with Stimulus (revisited)Some months ago, I wrote about something I built, a component to submit forms with a double-click, where the user has to confirm the action, potentially avoiding miss-clicks and doing something irreve#3adf1e"Double-click to submit" pattern with StimulusWhile tinkering around with a home lab and CasaOS, I encountered this pattern where certain actions require a "double click", like this: I wanted to see how hard it was to copy this with Stimulus, an#a12281Traefik with Kamal: Tips and TricksIt took me some time to finally figure out Traefik and some more time to put two and two together, so I'd like to share some things I learned on how to get it to work smoothly with Kamal. Traefik is #44f1c1Production-Grade (ish) Rails deployment on Hetzner with KamalI've been toying around with Kamal for some time now, and I believe I have come up with a nice setup for a reasonably robust deployment. It includes two servers, one for the application and another fo#a08a9fTaming complex Service Objects with dry-rbAs your Rails app grows, MVC feels inadequate. Should I put complex business rules in the models or the controllers? Should I just put everything in Concerns? At this point, most developers fall back #4f8a11Using concurrent-ruby in a Rails applicationConcurrency in Ruby is still a gray zone for many developers. If you know anything about concurrency, you probably know that Ruby is thread-safe by default because the Global VM Lock only uses one thread#3e0608Validating Mandrill webhook signature on Ruby on RailsI'm writing this post partially because I couldn't find anything exactly like this and to keep a log for me, in case I have to deal with this once again. Since Mandrill does not provide a way to auth#36ec95Encapsulation in Ruby on RailsIn Object-Oriented Programming, encapsulation is one of the fundamentals concept. Understand encapsulation will help you write concise and easy to maintain code. But what exactly is encapsulation? If #5504bdA simple solution to scalability problems: Event SourcingIn the past months I've been playing around with Kotlin and Spring's event sourcing engine. To get to know it better, I build a really simple clone of Untappd. If you don't know Untappd, a tl;dr is: F#9d3bc6Deploying Spring Cloud Netflix apps on KubernetesIf you are deploying containers on production, Kubernetes is a no-brainer solution. It takes some time to get familiar with all concepts but once you understand it, piece of cake 🍰. So today I wann#4f4d13Refactoring legacy Ruby on Rails appsI have this idea: Chathub, an app that turns Github's organizations and/or repositories into chat rooms, pretty much like Gitter. I use this idea every time I want to build a new PoC. So I did it in R#b7a211Netflix OSS: A beginner's guide [pt4]When a system grows, you need some kind of monitoring as well. If you have a monolithic app, that is not really a hard task, but when it comes to microservices word, things change. How to keep track #b7a211Netflix OSS: A beginner's guide [pt3]So far, we created an Eureka server, a microservice and registered it in Eureka. You can access this microservice directly through his IP, but later, when you service grow and you need to scale it, p#b7a211Netflix OSS: A beginner's guide [pt2]In the last post, I showed how to create a Eureka server. Now we'll go through the process of creating microservice and register it on Eureka. To begin, you can create a simple project with one enti#b7a211Netflix OSS: A beginner's guide [pt1]In this series of posts, I'll try to get you inside the Netflix stack: understand how it works and get your feet wet in the microservices world. So, to begin, we need to know the first component of