Skip to content

Instantly share code, notes, and snippets.

View jaygilmore's full-sized avatar
🕳️
🐇

Jay Gilmore jaygilmore

🕳️
🐇
View GitHub Profile
@jaygilmore
jaygilmore / nginx-wordpress.conf
Created October 22, 2024 15:31 — forked from nfsarmento/nginx-wordpress.conf
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@jaygilmore
jaygilmore / SiteSummary
Created October 18, 2024 12:30
Pretty Site Summary dashboard widget - original by W. Shawn Wilkerson - MODX Revolution
<?php
// SiteSummary snippet for Dashboard widget
// W. Shawn Wilkerson
$o = '<table class="classy" style="width:100%;"><thead><tr style="background:#DDE3EA;color:#000;">';
$o .= '<th style="width:50%;padding:8px 0;text-align:center;">Resources</th>';
$o .= '<th style="width:50%;padding:8px 0;text-align:center;">Elements</th>';
$o .= '</tr></thead><tbody><tr><td style="padding:0 1em;">';
$o .= 'Published Resources: ' . $modx->getCount('modResource', array('published' => '1'));
$o .= '<br>Unpublished Resources: ' . $modx->getCount('modResource', array('published' => '0'));
@jaygilmore
jaygilmore / Messages
Created October 18, 2024 12:30
Dashboard Widget to display the number of internal Manager messages the user has - MODX Revoluition
// Dashboard widget to show number of Manager messages
$id = $modx->user->get('id');
$output = 'No messages.';
$total = $modx->getCount('modUserMessage',array(
'recipient' => $id,
));
if($total) {
$output = 'You have ' . $total . ' messages';
$unread = $modx->getCount('modUserMessage',array(
'recipient' => $id,
@jaygilmore
jaygilmore / hex2rgba.php
Created October 18, 2024 12:29
Hex2Rgbp Custom Output Modifier Snippet
<?php
# hex2rgba
# converts hex value from ColorPicker TV to rgba value
# NOTE that the ColorPicker TV must use the default output option
# based on function from http://mekshq.com/how-to-convert-hexadecimal-color-code-to-rgb-or-rgba-using-php/
if (!function_exists('hex2rgba')) {
function hex2rgba($color, $opacity = false) {
$default = 'rgb(0,0,0)';
@jaygilmore
jaygilmore / recalculateURIs.php
Created October 25, 2017 19:41 — forked from opengeek/recalculateURIs.php
Script to recalculate all unfrozen URI values for MODX Resources in 2.1.x+
<?php
include 'config.core.php';
include MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
@jaygilmore
jaygilmore / text.class.php
Last active November 14, 2016 20:05 — forked from pepebe/new_gist_file.php
Fix fatal error "Fatal Error: Cannot redeclare class modTemplateVarInputRenderText..."
<?php
/*
Quick fix for this problem until I have the time to look for the cause.
"Fatal Error: Cannot redeclare class modTemplateVarInputRenderText...
...in core/model/modx/processors/element/tv/renders/mgr/input/text.class.php onl line 10"
*/
/**
* @package modx

Tiny Content Framework

About the Project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Contribute

There’s more to come, and I’d love to hear what you think. Give me feedback on Twitter (@nicoleslaw) or by email ([email protected]). We all benefit from sharing our ideas and creating standards. Onward.