Skip to content

Instantly share code, notes, and snippets.

View mkschell's full-sized avatar

Mike Schell mkschell

  • MODX, LLC
  • Bancroft, Ontario, Canada
View GitHub Profile
@frankdugan3
frankdugan3 / app.css
Last active June 11, 2025 16:04
Phoenix Tailwind v4
/* default is to use prefers-color-scheme */
/* if you want dark mode via class: */
@custom-variant dark (&:where(.dark, .dark *));
@custom-variant phx-click-loading (.phx-click-loading&, .phx-click-loading &);
@custom-variant phx-submit-loading (.phx-submit-loading&, .phx-submit-loading &);
@custom-variant phx-change-loading (.phx-change-loading&, .phx-change-loading &);
@plugin "./heroicons.tailwind.plugin.js";
@mkschell
mkschell / nginx.conf
Created November 2, 2013 12:10
phpThumbStatCache rewrite rules for MODX Cloud
location ~ ^/i/(.*) {
error_log /c0324/log/image.log notice;
rewrite_log on;
set $phptfn $1;
rewrite ^(.*?)\/w\/(\d+)\/(.*)$ $1/$3?w=$2&$args;
rewrite ^(.*?)\/h\/(\d+)\/(.*)$ $1/$3?h=$2&$args;
rewrite ^(.*?)\/new\/(\d+)\/(.*)$ $1/$3?new=$2&$args;
rewrite ^(.*?)\/wp\/(\d+)\/(.*)$ $1/$3?wp=$2&$args;
rewrite ^(.*?)\/hp\/(\d+)\/(.*)$ $1/$3?hp=$2&$args;
rewrite ^(.*?)\/w1\/(\d+)\/(.*)$ $1/$3?w1=$2&$args;
@mkschell
mkschell / babelContextRouter.plugin.php
Last active October 19, 2023 07:08
MODX Cloud web rules example for Babel with two languages.In this example, German is the default language with resources in the 'web' context; English is the secondary language, set up in the 'en' context.This technique is based on the "SEO Friendly Multilingual Websites" article archived here: https://web.archive.org/web/20180927220103/http://w…
<?php
if($modx->context->get('key') != "mgr"){
/* grab the current langauge from the cultureKey request var */
switch ($_REQUEST['cultureKey']) {
case 'en':
/* switch the context */
$modx->switchContext('en');
break;
default:
/* Set the default context here */
<?php
$simplx_debugger_js = $modx->getChunk('simplx.debugger.js');
$simplx_rpc_js = $modx->getChunk('simplx.jsonrpc.js');
$modx->regClientStartupHTMLBlock($simplx_rpc_js);
$modx->regClientStartupHTMLBlock($simplx_debugger_js);