Skip to content

Instantly share code, notes, and snippets.

View db-pj's full-sized avatar

PJ Fancher db-pj

View GitHub Profile
<?php
/**
* Tag Assignment Script for BadCredit.org
*
* Analyzes all published posts and assigns one main tag and optionally one subtag
* based on the tag definitions generated by generate-tags.php
*
* Output: CSV file with post assignments in volumes/phpfpm/scripts/tags/output/
*/
<?php
/**
* Tag Generation Script for BadCredit.org
*
* Analyzes all published posts using OpenAI API to generate a comprehensive
* tag taxonomy with main tags and subtags for SEO and content organization.
*
* Output: JSON file in volumes/phpfpm/scripts/tags/output/
*/
Main Tag Subtag Article Count
Bad Credit / Rebuilding 93
Bad Credit / Rebuilding Counseling 4
Bad Credit / Rebuilding Credit Monitoring 9
Bad Credit / Rebuilding Debt 6
Bad Credit / Rebuilding Disputes 1
Bad Credit / Rebuilding Secured 28
Banking & Fintech 294
Banking & Fintech Apps 27
Banking & Fintech Checking 6
<?php
/**
* Article Tag Assignment Script
* Uses ChatGPT and Perplexity APIs to assign tags and subtags to articles
*
* Usage: php assign-tags.php
*/
// =========================================
// CONFIGURATION
{
"main_tags": {
"General Credit Cards": {
"definition": "Articles about general credit card information, comparisons, details about a specific card or credit card company, choosing the right card, pros and cons, basics, and customer service topics including calling the issuer, support representatives, or dealing with customer service wait times."
},
"Cash Back Credit Cards": {
"definition": "Articles specifically about credit cards that offer cash back rewards on purchases, including flat-rate cash back (1%, 2%, 3%, 5%), statement credits, and rebates on spending. This does not include travel miles or points programs. How to maximize cash back rewards."
},
"Credit Card Balance Transfer": {
"definition": "Articles about transferring existing credit card balances to another card, typically featuring 0% intro APR offers, debt consolidation strategies, transfer fees, and moving balances to pay off debt."
@db-pj
db-pj / gist:235947b0d98a042248b57639c956842d
Last active December 6, 2025 15:28
Screaming Frog Command Line
screamingfrogseospider \
--crawl https://www.digitalbrands.com \
--headless \
--config ~/sf.seospiderconfig \
--task-name 'DigitalBrands.com Crawl Report' \
--project-name 'DigitalBrands.com' \
--export-format 'gsheet' \
--google-drive-account '[email protected]' \
--export-custom-summary "Site Crawled,Date,Time,Total URLs Encountered,Total URLs Crawled,Total Internal blocked by robots.txt,Total External blocked by robots.txt,URLs Displayed,Total Internal URLs,Total External URLs,Total Internal Indexable URLs,Total Internal Non-Indexable URLs,JavaScript:All,JavaScript:Uses Old AJAX Crawling Scheme URLs,JavaScript:Uses Old AJAX Crawling Scheme Meta Fragment Tag,JavaScript:Page Title Only in Rendered HTML,JavaScript:Page Title Updated by JavaScript,JavaScript:H1 Only in Rendered HTML,JavaScript:H1 Updated by JavaScript,JavaScript:Meta Description Only in Rendered HTML,JavaScript:Meta Description Updated by JavaScript,JavaScript:Canonical Only in Rendered HTML,JavaScript:Canonical Mismatch,JavaScript:Noindex
  • Kick everyone off current Site
  • Push repo and dump db
  • Switch monsoon.cfg URL
  • Pull repo and import db to new site
  • Switch DOMAIN_PRODUCTION env var on new site
  • Switch IS_PRODUCTION env var on new site
  • logout/login
  • Bring Site Down
  • Switch DNS
  • Unproxy site on Cloudflare
//a[@href='https://pj.passprotect.me/news/']
//a[contains(@href,'how-to/nodejs__dirname/')]
.icon-page {background-image: url('/wp-content/themes/mt-desktop/public/images/_sprites/_credit-cards/[email protected]');background-size: 350px 288px;display: inline-block;}
.s-icon-0-apr:hover, .icon-hover:hover .s-icon-0-apr {width: 70px;height:72px;background-position: -0px -0px;}
.s-icon-0-apr {width: 70px;height:72px;background-position: -70px -0px;}
.s-icon-balance-transfer:hover, .icon-hover:hover .s-icon-balance-transfer {width: 70px;height:72px;background-position: -140px -0px;}
.s-icon-balance-transfer {width: 70px;height:72px;background-position: -0px -72px;}
.s-icon-best-overall:hover, .icon-hover:hover .s-icon-best-overall {width: 70px;height:72px;background-position: -70px -72px;}
.s-icon-best-overall {width: 70px;height:72px;background-position: -140px -72px;}
.s-icon-business:hover, .icon-hover:hover .s-icon-business {width: 70px;height:72px;background-position: -210px -0px;}
.s-icon-business {width: 70px;height:72px;background-position: -210px -72px;}
.s-icon-cash-back:hover, .icon-hover:hover
@db-pj
db-pj / Delete WP generated images.txt
Last active March 1, 2021 23:47
Delete WP generated images
find -type f -regex '.*\-[0-9]+x[0-9]+.\(jpg\|png\|jpeg\|gif\)$' >> images-to-delete.txt
find -type f -regex '.*\-[0-9]+x[0-9]+.\(jpg\|png\|jpeg\|gif\)$' -exec rm -rfv {} \;
Disable Simple Image Sizes
Zero out media image sizes