Tutorials.

My Docker, docker-compose & jenkins setup for working on wordpress themes and plugins

First published on 2022-12-02

Hello all! In this article, I outline my local docker setup for developing wordpress plugins and themes. I use docker to run local mysql (multiple versions) and php (multiple versions) as well as manage the wordpress installed plugins. Furthermore, I use the same setup for deploying to production, so it is particularly useful.

The majority of configuration resides in Dockerfile and docker-compose.yml, however, I also have a few scripts and naming formalisms that facilitate development and rational thinking.

How to split images in a folder into 2x2 pages

Do you have a lot of images from AI in a 2x2 grid? Do you want to separate them into singles, but it's just so time consuming? Fear not, with imagemagick you can do it in one line, like so:

 

find . -maxdepth 1 -iname '*png' -exec \
 convert {} -crop 2x2@ {}_%d.jpg \;

Ruby on Rails naming conventions

Ruby on Rails, often referred to as Rails, follows a set of naming conventions to maintain consistency and readability in code. I generally like RoR conventions and follow them. Here's a summary of some key naming conventions in Ruby on Rails:

Class Names: Class names in Rails are typically in CamelCase (also known as PascalCase), starting with an uppercase letter. For example, User, ProductCategory, or OrderDetail.

Some notes on naming conventions

Singular or plural?

This can be a much larger conversation, really. In the Ruby on Rails (RoR) framework, what is plural and what is singular is very specific.

I'd like to additionally note, that since I apply Occam's Razor to everything, and simplify everything, then generally speaking my names are singular, because plularily can be removed. This helps me easier find names in the future.

A good-looking CSS-only chip

.chipW { background: #ddd; padding: 50px; } .chip { display: inline; border-radius: 1em 0 0 1em; margin-right: 32px; padding: 0.2em 0.2em 0.2em 0.6em; height: 32px; background: white; position: relative; } .chip::before { content: ""; display: block; position: absolute; right: -16px; top: 0; width: 16px; height: 32px; border-top: 17px solid white; border-right: 12px solid transparent; } .chip::after { content: ""; display: block; position: absolute; right: -16px; bottom: 0; width: 16px; height: 32px; border-bottom: 17px solid white;

How to use scss (sass) with Drupal

In this article, I'm doing to talk about how I enabled my Drupal theme to have scss.

I'm on a mac, so these instructions are specifically for mac os x.

Drupal is a php framework. Sass is (somewhat surprisingly) a ruby program. While I am a ruby expert, I believe javascript is much closer to css than ruby is, so I'm expecting the scss compiler to be written in node.

In fact, this task has little to do with Drupal or PHP. We will be spending most of the time in a node environment.

Teaser Text

How to use scss (sass) with Drupal