Skip to content

Instantly share code, notes, and snippets.

View DrewAPicture's full-sized avatar

Drew Jaynes DrewAPicture

View GitHub Profile
@DrewAPicture
DrewAPicture / CLAUDE.md
Created March 20, 2026 06:13
Git Safety Protocol for Claude

⚠️ Critical Safety Rules

Git Operations — Preserve Uncommitted Work

MANDATORY: Always run git status --porcelain before any git operation that affects the working tree.

Users may have valuable uncommitted changes from previous sessions. Before running git checkout, git switch, git merge, git rebase, git reset, or git clean:

  1. Run git status --porcelain
  2. If the output is non-empty — stop and inform the user. Do not proceed.
Please ensure the design is beautiful, clean, and modern.
Follow design best practices:
- Use consistent spacing
- Clear visual hierarchy
- Readable typography.
Prioritize simplicity and ease of use.
Make sure the layout is well-structured, visually appealing, and mobile responsive.
@DrewAPicture
DrewAPicture / travel_itinerary_prompt.yaml
Created August 19, 2025 15:10
Travel Itinerary Prompt
trip_name: TripName
travelers:
- Name1
- Name2
flights:
- id: 1
passengers: [Name1, Name2] # List of travelers from above
airline: TBD
@DrewAPicture
DrewAPicture / progress-bar.blade.php
Created November 16, 2023 10:41 — forked from gwleuverink/progress-bar.blade.php
Progress bar blade component
@props([
'percentage' => 0,
'failed' => false
])
@php
$done = $failed || $percentage == 100;
@endphp
<div {{ $attributes->merge(['class' => ' space-y-1'])->whereDoesntStartWith('wire:poll') }}
<?php
/**
* Plugin With Checks Bootstrap
*
* @package Plugin With Checks
* @subpackage Core
* @copyright Copyright (c) 2021, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0.0
*/
<?php
/**
* Attempts to log a referral when a new vendor is registered via an affiliate in FES.
*
* @see The 'edd_post_insert_' . $type hook, where $type is 'vendor'.
*
* @param int. $vendor_id Newly-created vendor ID.
* @param array $data Vendor data.
*/
function affwp_edd_fes_vendor_registration_referral( $vendor_id, $data ) {
<?php
/**
* Automatically locates and loads files based on their namespaces and their
* file names whenever they are instantiated.
*
* @package WerdsWords
*/
spl_autoload_register(function( $filename ) {
// First, separate the components of the incoming file.
@DrewAPicture
DrewAPicture / class-affiliate-meta-db.php
Last active December 24, 2018 05:53
Demonstration for how AffiliateWP registers a table to be compatible with the core metadata API.
<?php
/**
* Core class used to implement affiliate meta.
*
* @since 1.6
*
* @see Affiliate_WP_DB
*/
class Affiliate_WP_Affiliate_Meta_DB extends Affiliate_WP_DB {
@DrewAPicture
DrewAPicture / sb-signup-url-preview.js
Created August 17, 2018 16:29
SellBird registration URL live-preview JS.
$( '#store-name' ).on( 'keyup', function( event ) {
var toConvert = $( this ).val(),
converted = toConvert.replace( /\s+/g, '-' ).toLowerCase(),
description = $( this ).next( '.form-text' );
description.text( 'e.g. ' + converted + '.sellbird.com' );
} );
var bookmarkLauncherSetup = (function() {
var bookmarks = {}, url;
bookmarks['r'] = 'https://www.reddit.com/r/popular';
bookmarks['f'] = 'https://facebook.com';
bookmarks['a'] = 'https://smile.amazon.com';
bookmarks['h'] = 'https://secure.helpscout.net/members/login/';
bookmarks['i'] = 'http://www.imdb.com/';
bookmarks['m'] = 'http://mutrunk.dev/wp-admin';
bookmarks['t'] = 'http://twitter.com/home';