Syntax notes on Ruby ecosystem

Syntax notes on Ruby ecosystem Some notes, on syntax in the Ruby ecosystem, namely Ruby itself, ERB and Rails. Ruby Comments # single line comment =begin Multi Line Comment The =begin and =end must be at the beginning of the line =end # or just # do multiline # like this Too bad multiline comments are a bit clunky ERB ERB (Embedded Ruby) is a templating system for embedding Ruby code within a text document like HTML. ...

July 12, 2024 · 1 min · 197 words · Ryan Dorward

Drupal: Hidden fields in programaticly defined entities

It can be useful to define custom entities programatically for streamlined CRUD webapps using Drupal. One nice thing about doing it this way is that you can keep all your entity definitions in the code, so deployment is easier - no clicking around on the various environments to keep things synced or akward db sync scripts. Sometimes a custom entity needs to have a hidden field that should not be exposed in the user-facing create/edit form. It might have a value that’s handled programatically, like a timestamp for when the entity was published, or in my case, a special kind of “owner” that differs from the entity creator. ...

June 13, 2024 · 2 min · 225 words · Ryan Dorward

Drupal: Image styles in Tokens

I was hitting a roadblock trying to get a sites metatags nice for social sharing, using the Metatags module. In the past I’ve written code to manually generate the meta tags, but thought this time around I would see if I could not reinvent the wheel. I started to regret my decision when it seemed like tokens for images don’t allow you to serve up derivative images using Image styles. This meant that the only option was to present the image that was uploaded in the raw form - not always what you want. In my case it seemed like some of the source images used by my client were so large that Formerly Twitter ™ was failing to scrape the image because of a timeout or some other limit on their end. ...

May 30, 2024 · 2 min · 301 words · Ryan Dorward

React and sass in Wordpress

Setting up the groundwork for React and Sass development in a WordPress environment

March 15, 2024 · 6 min · 1134 words · Ryan Dorward

Cache Variance in Drupal Templates

A little trick for declaring cache variance directly in Drupal templates

January 15, 2024 · 2 min · 246 words · Ryan Dorward

Make your Drupal Theme Fly: Tailwind, Hot Reloading, and SCSS

Integrating Tailwind, LiveReload, and SCSS, with Drupal Theme Development

December 12, 2023 · 13 min · 2655 words · Ryan Dorward

Drupal ListStringItem pt.2: Getting the translated value

Drupal the programatic way - display the translated value of a dropdown or radio select field

April 7, 2023 · 2 min · 372 words · Ryan Dorward

Drupal ListStringItem pt.1: Getting the human-readable value programatically

Drupal the programatic way - display the human readable value of a dropdown or radio select field

April 6, 2023 · 2 min · 383 words · Ryan Dorward

Dockerized Rails app

Walkthrough of a basic Rails setup using Docker

March 24, 2023 · 3 min · 467 words · Ryan Dorward

Markdown Cheatsheet, Hugo-flavoured

Examples showing how Markdown behaves in Hugo

March 19, 2023 · 3 min · 582 words · Ryan Dorward

How to set up a free Blog using Hugo

A walkthrough tutorial of how to set up a blog like this one

March 17, 2023 · 7 min · 1375 words · Ryan Dorward

Hugo vs. Gatsby vs. Jekyll: Choosing the right framework for a blog

How I came to choose Hugo for my blogging framework

March 16, 2023 · 2 min · 412 words · Ryan Dorward

Why Start a blog?

Why I took up blogging like it’s 2004

March 15, 2023 · 2 min · 235 words · Ryan Dorward