Skip to content

Instantly share code, notes, and snippets.

View bhubbard's full-sized avatar
:octocat:
Hello

Brandon Hubbard bhubbard

:octocat:
Hello
View GitHub Profile
You are an expert in WordPress design and the Ollie theme's color system. Your task is to help me define a new color palette for an Ollie-based WordPress site. I will provide you with details about the brand, target audience, and desired aesthetic. You will then propose a complete 11-slot color palette, adhering strictly to Ollie's color system guidelines.
**Ollie Color System Overview:**
* **11 Color Slots:** Each color has a specific purpose.
* **Brand Colors (4 slots):**
* `Brand` (primary) and `Brand Alt` (secondary brand color) are for main brand elements like buttons and CTAs.
* `Brand Accent` (for `Brand`) and `Brand Alt Accent` (for `Brand Alt`) are complementary accent colors, designed to work as text colors on their respective main brand colors (or vice-versa for backgrounds). They ensure good readability and contrast.
* **Neutral Colors (7 slots):** For foundational UI elements like backgrounds, text, and borders.
* `Base`: Default page background (typically light).
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/wp-admin/plugins.php",
"steps": [
{
"step": "login",
"username": "admin",
"password": "password"
},
{
<?php
/**
* Plugin Name: Bloomerang Data Exporter
* Description: Exports data from the Bloomerang API and saves it as JSON files in the uploads directory.
* Version: 1.0.0
* Author: Gemini
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: bloomerang-data-exporter
*/
<?php
// phpcs:disable WordPress.WP.AlternativeFunctions.curl_curl_init, WordPress.WP.AlternativeFunctions.curl_curl_exec, WordPress.WP.AlternativeFunctions.curl_curl_setopt, WordPress.WP.AlternativeFunctions.curl_curl_close, WordPress.WP.AlternativeFunctions.curl_curl_error
/**
* Cloudflare KV Object Cache
*
* Drop-in replacement for the WordPress Object Cache.
*
* File: object-cache.php
* Directory: /wp-content/
#!/bin/bash
# A WP-CLI script to install performance and image-related plugins,
# and then regenerate all media library thumbnails.
# --- Configuration ---
# Exit immediately if a command exits with a non-zero status.
set -e
# --- Script Start ---
#!/bin/bash
# A WP-CLI script to install, run, and uninstall the WP-Sweep plugin.
# This automates the process of cleaning the WordPress database.
# --- Configuration ---
# Exit immediately if a command exits with a non-zero status.
set -e
# --- Script Start ---
@bhubbard
bhubbard / Uconnect_mp4.json
Created February 9, 2025 04:50
UConnect Presets for Handbrake
{
"PresetList": [
{
"AlignAVStart": false,
"AudioCopyMask": [
"copy:aac"
],
"AudioEncoderFallback": "av_aac",
"AudioLanguageList": [
"eng"
@bhubbard
bhubbard / wp-cron-retry.php
Created December 10, 2024 22:07
This pattern automatically retries a failed WP Cron job with a configurable number of retry attempts and a delay between retries.
How It Works:
• When the cron job fails, it increments a retry count and schedules a retry attempt after a set delay.
• It will attempt to retry the job a maximum of MY_CRON_JOB_MAX_RETRIES times, with a delay of MY_CRON_JOB_RETRY_DELAY between each retry.
• After successful execution or after reaching the retry limit, the retry count is reset.
@bhubbard
bhubbard / time-window-cron.php
Created December 10, 2024 22:06
This pattern ensures that a WP Cron job only runs during a specific time window (e.g., between midnight and 3 AM).
How It Works:
• The cron job only runs if the current time is within the defined time window (midnight to 3 AM in this example).
• If it is outside the time window, the job is skipped.
@bhubbard
bhubbard / wp-cron-trottling.php
Created December 10, 2024 22:06
This pattern limits the execution frequency of WP Cron jobs, ensuring that they do not run more frequently than a set threshold, even if the scheduled time has passed.
How It Works:
• The cron job runs only if the time since the last run is greater than or equal to the defined throttle interval (in this case, 1 hour).
• It checks this condition before executing the task, ensuring that the job isn’t triggered too frequently.