Skip to content

Instantly share code, notes, and snippets.

View AugustMiller's full-sized avatar
🌳

August Miller AugustMiller

🌳
View GitHub Profile
@AugustMiller
AugustMiller / MyModule.php
Last active June 6, 2021 00:57
Craft Commerce: Add user to a group when they make a purchase
<?php
namespace modules\mymodule;
use Craft;
use craft\elements\User;
use craft\helpers\ArrayHelper;
use yii\base\Event;
@AugustMiller
AugustMiller / line-item-controls.twig
Created November 2, 2020 19:11
Increment or decrement quantity of product in cart
{% set incrementable = incrementable ?? true %}
{% set decrementable = decrementable ?? true %}
<div class="line-item__controls">
{% if incrementable or decrementable %}
<div class="line-item__quantity">
<form
method="POST"
data-ajax>
{{ csrfInput() }}
@AugustMiller
AugustMiller / project-config-on-teams.md
Last active August 26, 2021 20:28
Using Craft’s Project Config on a Distributed Team

Project Config

Project Config is a powerful tool for managing the schema of a Craft application.

However, as with any text stored in version control, it can and will cause merge conflicts when multiple team members make changes to the same system settings.

These problems are exacerbated by Craft's strategy of rebuilding the entire config/project directory whenever a change is made. Of course, this helps keep the files and properties organized and up-to-date—but it can also squash changes under certain circumstances.

The Problem Scenario

@AugustMiller
AugustMiller / settings.json
Created October 19, 2021 20:17
VS Code Settings
{
"editor.fontSize": 14,
"editor.cursorWidth": 2,
"editor.lineHeight": 25,
"editor.renderWhitespace": "all",
"files.insertFinalNewline": true,
"editor.wordWrap": "on",
"workbench.colorTheme": "BirdsofParadise",
"editor.rulers": [
80
@AugustMiller
AugustMiller / googly.js
Created October 9, 2024 23:32
Googly Eyes
let source = null;
window.addEventListener('mousedown', function (e) {
e.preventDefault();
source = e;
});
window.addEventListener('mouseup', function (e) {
const delta = Math.sqrt(Math.pow(source.pageX - e.pageX, 2) + Math.pow(source.pageY - e.pageY, 2));
const $eyes = document.createElement('img');
@AugustMiller
AugustMiller / callsign.js
Created March 25, 2025 18:28
Raycast Script for fetching callsigns from Hamcall.dev
#!/usr/bin/env node
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Callsign
// @raycast.mode compact
// @raycast.argument1 { "type": "text", "placeholder": "ID" }
// Optional parameters:
// @raycast.icon 📡
@AugustMiller
AugustMiller / eld-land-cycle-rulings.md
Last active October 20, 2025 17:49
Throne of Eldraine Land Cycle Rulings Issues