Author Archives: ronaldpringadi

A Quick Tour of Mustache Templating in PHP (and Everywhere Else)

If you’ve worked in a large PHP codebase like Moodle, you’ve bumped into files ending in .mustache and wondered what those double curly braces are doing. 🐘 The short version: Mustache is a logic-less templating language, and the syntax you … Continue reading

Posted in PHP, Web Development | Tagged , , | Leave a comment

Adding a Moodle cron sidecar to moodle-docker via local.yml

The moodle-docker stack is designed primarily for automated testing — Behat, PHPUnit, and so on — which is why it doesn’t ship a cron container. A background scheduler would interfere with deterministic test runs, so the README’s only nod to … Continue reading

Posted in Moodle | Tagged , , | Comments Off on Adding a Moodle cron sidecar to moodle-docker via local.yml

Creating a new theme and changing font on Moodle 5

I wanted to swap the default font in a Moodle 5 install. Specifically: keep Boost, the stock Moodle theme, but use Inter from Google Fonts instead of the Bootstrap system stack. The official path is “make a child theme of … Continue reading

Posted in Moodle | Tagged , , , , | Comments Off on Creating a new theme and changing font on Moodle 5

Local HTTPS for dev sites with Caddy, mkcert, and a reverse-proxy gotcha

Running a local web app over plain HTTP is fine until something forces your hand — a third-party SDK that refuses to load on http://, a cookie that needs the Secure flag, or an app like Moodle that nags you … Continue reading

Posted in DevOps | Tagged , , , | Comments Off on Local HTTPS for dev sites with Caddy, mkcert, and a reverse-proxy gotcha

Running multiple Moodle instances side-by-side with moodle-docker

The moodle-docker project gives you a one-command Moodle dev stack — Apache, PHP, the database of your choice, mail catcher, the lot. What its README mentions only in passing is that you can run several Moodle instances on the same … Continue reading

Posted in DevOps, Moodle | Tagged , , | Comments Off on Running multiple Moodle instances side-by-side with moodle-docker

Multi tenancy in Laravel using stancl/tenancy

I spent a day inside stancl/tenancy (the database-per-tenant Laravel package) shipping a real change to a multi-tenant Software-as-a-Service (SaaS) application, and a few things finally clicked for me — none of which were obvious from the documentation alone. 💡 Here … Continue reading

Posted in Laravel, PHP | Tagged , , , , | Comments Off on Multi tenancy in Laravel using stancl/tenancy

Moodle Plugin Development: version.php, install.xml, upgrade.php, and tasks.php Explained

Moodle is one of the largest Learning Management System (LMS) platforms in the world, and one of its quietly excellent superpowers is its plugin architecture. Every feature you can add — a new activity, a block, a report, an authentication … Continue reading

Posted in PHP | Tagged , , , | Comments Off on Moodle Plugin Development: version.php, install.xml, upgrade.php, and tasks.php Explained

Block Countries by IP on Debian Trixie with nftables and xtables-addons

Debian Trixie uses nftables as its default firewall. If you’re used to iptables, the commands still work — but they go through an iptables-nft compatibility shim that translates them to nftables rules under the hood. For country-based IP blocking, the … Continue reading

Posted in Linux | Tagged , , , | Comments Off on Block Countries by IP on Debian Trixie with nftables and xtables-addons

How to Set Up Google Analytics 4 (GA4) — Step-by-Step Guide

If you’ve been putting off setting up Google Analytics because you’re still on the old “Universal Analytics” (UA) — it’s time to act. UA is officially dead: Standard UA properties stopped collecting data on July 1, 2023 UA 360 (premium) … Continue reading

Posted in Analytics | Tagged , | Comments Off on How to Set Up Google Analytics 4 (GA4) — Step-by-Step Guide

Using PHP with Mustache: Practical Examples and Gotchas

If you want clean templates in PHP without pulling in a full framework, Mustache is a great fit. It keeps logic out of views, which forces you to prepare data in PHP first and makes templates easier to scan later. … Continue reading

Posted in PHP | Tagged , | Comments Off on Using PHP with Mustache: Practical Examples and Gotchas