Skip to content

Instantly share code, notes, and snippets.

View bpmore's full-sized avatar

Brent Passmore bpmore

View GitHub Profile
@bpmore
bpmore / audit-your-codebase.md
Created August 18, 2026 13:33 — forked from aarondfrancis/audit-your-codebase.md
A read-only, agent-orchestrated codebase audit prompt for data structures, state modeling, algorithms, and ownership.

Audit this entire codebase for materially useful simplifications in its data structures, state representation, control flow, algorithms, and ownership.

This is an audit-only exercise. Do not edit files, run tests, implement recommendations, commit, or push. Read-only inspection commands are allowed.

You are the coordinator. Continue until the complete codebase has been reviewed and the final audit is validated.

  1. Establish the coverage contract

Inspect the repository and inventory every identifiable subsystem.

╭─── Claude Code v2.1.12 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │ Tips for getting started │
│ Welcome back Jonny! │ Run /init to create a CLAUDE.md file with instructions for Claude │
│ │ │
│ │ ───────────────────────────────────────────────────────────────── │
│ ▐▛███▜▌ │ Recent activity
@bpmore
bpmore / clean-post-meta.txt
Last active January 29, 2021 20:46
Delete All Post Meta Except Thumbnail In WordPress Pages and Posts
//Originally found here: https://www.kvcodes.com/2015/12/delete-all-post-meta-except-thumbnail-in-wordpress-posts/
//Copy from line 3 to the end and paste into your theme's function file.
function kv_delete_all_meta_except_featuredimg(){
$args = array( 'posts_per_page' => -1, 'post_status' => 'any', 'post_type' => array('attachment', 'page','post'));
$articles= get_posts( $args );
foreach($articles as $article){
if($article->post_type == 'attachment'){
$myvals = get_post_meta($article->ID);
foreach($myvals as $key=>$val) {
@bpmore
bpmore / limit_editor_widgets.php
Last active May 2, 2019 03:24
Limit access to WordPress and Genesis widgets for the Editor Role.
<?PHP
// Allow Editors to manage Widgets and Menus
function sp_editor_capabilities() {
$editor = get_role( 'editor' );
if (!$editor->has_cap( 'edit_theme_options' ) ) {
$editor->add_cap( 'edit_theme_options' );
}
@bpmore
bpmore / header_switch.php
Last active April 15, 2019 20:38
Header with image or header with image and page title -- work in progress -- for Genesis WordPress.
<?php
// This adds logo to header, adds page title if using special page template, and...
//
// Here goes the logo in Header
//
add_action( 'genesis_header', 'ursidae_site_image', 5 );
function ursidae_site_image() {
if ( is_page_template( array( 'page_special.php', 'page_other_special.php' ) ) ) {
@bpmore
bpmore / dates.txt
Created March 8, 2018 21:08
National & Global Holiday Calendar: 2018-2019
January 2018
2: Science Fiction Day #ScienceFictionDay
4: National Trivia Day #NationalTriviaDay
5: National Bird Day #NationalBirdDay
8: Clean Off Your Desk Day #CleanOffYourDeskDay
11: Human Trafficking Awareness Day #HumanTraffickingDay
13: National Sticker Day #NationalStickerDay
15: Martin Luther King, Jr. Day #MLKDay
National Hat Day #NationalHatDay
18: Get to Know Your Customers Day (third Thursday of every quarter) #GetToKnowYourCustomersDay
@bpmore
bpmore / last-modified.php
Created May 26, 2017 15:00
Add last modified to WordPress admin for page and post listings
/** Andrew Norcross - Date Modified Display - http://andrewnorcross.com/tutorials/modified-date-display/ */
// Post Columns
add_action ( 'manage_posts_custom_column', 'rkv_post_columns_data', 10, 2 );
add_filter ( 'manage_edit-post_columns', 'rkv_post_columns_display' );
function rkv_post_columns_data( $column, $post_id ) {
switch ( $column ) {
case 'modified':
$m_orig = get_post_field( 'post_modified', $post_id, 'raw' );
$m_stamp = strtotime( $m_orig );
$modified = date('n/j/y @ g:i a', $m_stamp );
@bpmore
bpmore / remove-post-title-link-for-category.php
Last active April 25, 2017 20:58
Remove the link from post titles in a specified category or taxonomy.
//* Remove the link from each post titles in a specific category
add_filter( 'genesis_post_title_output', 'uca_post_title_output', 15 );
function uca_post_title_output( $title ) {
if ( in_category( 'uncategorized' ) || in_category( 'category-2' )) {
$title = sprintf( '<h2 class="entry-title">%s</h2> ', apply_filters( 'genesis_post_title_text', get_the_title() ) );
return $title;
}
return $title;
}
@bpmore
bpmore / kill-fusion.php
Created April 6, 2017 03:11
remove fusion builder shortcodes
<?php
add_filter('the_content', 'remove_fusion_shortcodes', 20, 1);
function remove_fusion_shortcodes( $content ) {
$content = preg_replace('/\[\/?fusion.*?\]/', '', $content);
return $content;
}
?>
**Tested with WP All Import and Export**
@bpmore
bpmore / gf-cal
Last active August 6, 2019 04:25
gravity forms calendar picker
Make the date picker start 2 weeks from current date.
Find this in your form:
<input name="input_26" id="input_2_26" type="text" value="" class="datepicker medium mdy datepicker_with_icon hasDatepicker">
The id above equals the formID and fieldID below.
<script type="text/javascript">
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
if ( formId == 2 && fieldId == 26 ) {