Skip to content

Instantly share code, notes, and snippets.

@mike-moreau
mike-moreau / prose.css
Created March 12, 2025 15:36
TailwindCSS 4 Typography Plugin Replacement Utility
@layer base {
:root {
--tw-prose-body: var(--color-gray-900);
--tw-prose-headings: var(--color-brand-blue);
--tw-prose-lead: var(--color-gray-900);
--tw-prose-links: var(--color-brand-cyan-a11y-any);
--tw-prose-bold: var(--tw-prose-body);
--tw-prose-counters: var(--tw-prose-body);
--tw-prose-bullets: var(--color-brand-gold);
--tw-prose-hr: var(--color-gray-400);
@mike-moreau
mike-moreau / biome.json
Created January 10, 2025 17:52
Biome Config File
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
@mike-moreau
mike-moreau / layout.twig
Created December 16, 2024 19:46
Non-blocking web font rendering for performance based on Craft CMS .env vars
{# Non-blocking Web Fonts - check to ensure display:swap is also used #}
{% if getenv('ADOBE_FONTS_URL') %}
<link rel="preconnect" href="https://use.typekit.net" crossorigin>
<link rel="preconnect" href="https://p.typekit.net" crossorigin>
<link rel="preload" href="{{ getenv('ADOBE_FONTS_URL') }}" as="style">
<link rel="stylesheet" href="{{ getenv('ADOBE_FONTS_URL') }}" media="print" onload="this.media = 'all'" />
<noscript>
<link rel="stylesheet" href="{{ getenv('ADOBE_FONTS_URL') }}">
</noscript>
{% endif %}
@mike-moreau
mike-moreau / how-to-look-up-dns.sh
Last active December 14, 2024 03:07
How to look up DNS from Terminal
# Look up DNS records in Terminal - dig or nslookup
$ dig example.com ANY
$ host example.com
$ nslookup -type=any example.com
$ nslookup -type=A example.com
$ nslookup -type=CNAME example.com
$ nslookup -type=TXT example.com
$ nslookup -type=MX example.com
@mike-moreau
mike-moreau / deploy.sh
Last active January 24, 2025 21:34
An example deployment script for Craft CMS projects not using a deployment service.
#!/bin/bash
# Run this script from the project root:
# Usage: deploy.sh <branch-name:string> [build-assets=true]
# Example - Deploy staging (with assets building by default): `bash ./deploy.sh staging`
# Example - Deploy main without building assets: `bash ./deploy.sh main false`
# Check if a branch name argument is provided
if [ $# -eq 0 ]; then
echo "Error: Branch name argument is required"
@mike-moreau
mike-moreau / ckeditor-field-config.json
Last active January 13, 2025 23:22
Baseline Craft 5 CKEditor Field JSON Config
{
"htmlSupport": {
"allow": [
{
"attributes": true,
"classes": [
"button",
"button-primary"
],
"name": "a"
@mike-moreau
mike-moreau / webfonts.css
Created January 26, 2022 16:03
Locally hosted web fonts, same family name with different weights
/*
* convert typekit to @font-face with locally hosted fonts using the same “font-family” with different weights and styles
*/
@font-face {
font-family: "fenwick";
src: url('../font/FenwickLtRegular/font.woff2') format('woff2'), url('../font/FenwickLtRegular/font.woff') format('woff');
font-weight: 300;
font-style: normal;
}
@mike-moreau
mike-moreau / LocalValetDriver.php
Created November 2, 2021 16:31
Laravel Valet Driver to Server Sites from dist folder
<?php
class LocalValetDriver extends LaravelValetDriver
{
private $site_folder = '/dist';
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
@mike-moreau
mike-moreau / seomatic.php
Last active October 26, 2021 14:41
CraftCMS Seomatic Plugin Multi-site environment config
<?php
/**
* Multi Environment / Multi Site SEOmatic Configuration
* File: `config/seomatic.php`
*
* @see https://nystudio107.com/docs/seomatic/configuring.html#multi-environment-config-settings
*/
use craft\helpers\ConfigHelper;