July 2, 2024
Setting Up Postgres for Rails
If you are setting up a Rails application for development and you need to run Postgres locally, you have two options: 1. Install Postgres using the operating system package manager (e.g. apt get) 2. Start a PostgreSQL container Installing locally is fairly trivial and involves just two commands: sudo apt install postgresql sudo systemc...
Read more
Read more
June 4, 2024
Learn the Web Fundamentals
I got my first job as a software developer was back in 2005 when I was 21. I used to hang around the Microsoft Lab at my university as they had a wealth of programming books and through them I got an interview for a junior ASP.NET developer position at a small company. I think I got the job mostly due to my knowledge of HTML and CSS, s...
Read more
Read more
June 2, 2024
The Responsible Web Developer
One of the arguments for building web front-ends using tools like React is the ability to provide a better user experience. Nowadays, if you follow the advice of "tech influencers," it's a fool's errand to build a web application without a very rich client layer, a backend split into discrete chunks of code running asynchronously, and ...
Read more
Read more
May 2, 2024
In Relentless Pursuit of RESTful Webhooks
I've recently seen a code sample about working with Stripe webhooks in Rails applications and I've noticed the following code in the controller: class StripeController < ApplicationController skip_before_action :verify_authenticity_token, only: [ :webhook ] def webhook # Sample code for handling Stripe webhook events end end First of a...
Read more
Read more
April 17, 2024
Instance Variable Access in Ruby
Instance variables (or instance attributes) in Ruby are prefixed with an @ sign: class Person def initialize(salutation: nil, first_name:, last_name:) @salutation = salutation @first_name = first_name @last_name = last_name end def name [ @salutation, @first_name, @last_name ].compact.join(" ") end end john = Person.new first_name: "Jo...
Read more
Read more
March 12, 2024
Exploring Visual Studio Code
I've decided to explore a potential migration from Emacs to Visual Studio Code, mainly because I've been planning for a while to get up to date with HTML, CSS and JavaScript and VS Code seems to have support for the most recent tools and practices on the front-end side. Here's how the current setup looks like when opening my version of...
Read more
Read more