Skip to content

Instantly share code, notes, and snippets.

View jeremyfelt's full-sized avatar
🍕
Look at that pizza emoji!

Jeremy Felt jeremyfelt

🍕
Look at that pizza emoji!
View GitHub Profile
@jeremyfelt
jeremyfelt / google-dfp-acm-config.php
Created August 23, 2012 21:23
Google DFP JS Explanation
<?php
/**
* Basic configuration for multiple DFP JS ad tags in Ad Code Manager
*
* Our ad units are named 'test_ad_300x250' and 'test_ad_728x90'
* Our DFP ID is 12345678
* Our ad slot IDs will be automatically created
*
*/
@jeremyfelt
jeremyfelt / open-source-search-compare.md
Last active January 3, 2025 13:33
Comparing open source search solutions
@jeremyfelt
jeremyfelt / powerful-code-snippets.php
Last active November 1, 2024 14:27
Pullman WordPress Meetup - Powerful Code Snippets
<?php
// Powerful Code Snippets (will there be 10?)
add_action( 'init', 'puwwp_register_post_type' );
/**
* Registering a custom post type provides many out of
* the box defaults new types of content.
*/
function puwwp_register_post_type() {
$labels = array(); // array of labels
@jeremyfelt
jeremyfelt / LocalValetDriver.php
Created October 24, 2024 17:14
latest local valet driver
<?php
use Valet\Drivers\Specific\WordPressValetDriver;
/**
* Class LocalValetDriver
*
* This class demonstrates how we might go about proxying any missing local images to a remote host. i.e; the production
* site. This has been created with WordPress in mind but could be adjusted to work with any other system.
*/
@jeremyfelt
jeremyfelt / restore-blocks.php
Last active December 21, 2022 15:33
Restore Shortnotes blocks
<?php
add_action( 'init', function() {
remove_filter( 'allowed_block_types', 'ShortNotes\PostType\Note\filter_allowed_block_types' );
} );
@jeremyfelt
jeremyfelt / ubuntu-wifi-diag.txt
Last active September 11, 2022 21:28
Figuring out my wifi issues in Ubuntu
> cat kern.log
Jan 2 13:03:25 jeremy-wsu NetworkManager[21883]: <info> [1483391005.6506] device (wlp58s0): supplicant interface state: 4-way handshake -> completed
Jan 2 13:05:25 jeremy-wsu kernel: [330686.828062] wlp58s0: disconnect from AP 58:6d:8f:99:8b:f4 for new auth to 58:6d:8f:99:8b:f5
> lspci -k -nn | grep -A 3 -i net
3a:00.0 Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)
Subsystem: Intel Corporation Wireless 8260 [8086:0050]
Kernel driver in use: iwlwifi
@jeremyfelt
jeremyfelt / launch.json
Last active June 3, 2022 23:08
VS Code debug configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
}
]
@jeremyfelt
jeremyfelt / gist:2625350
Created May 7, 2012 01:37
Post type argument test results
'rewrite' => true
'public' => true 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => false 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => false /cpt-slug/cpt-post-slug 404 Error
'public' => false 'publicly_queryable' => true /cpt-slug-cpt-post-slug 404 Error
'rewrite' => false
'public' => true 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => true /?p=ID&post_type=cpt-slug Loads fine
'public' => false 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
@jeremyfelt
jeremyfelt / hacky-characters.js
Created January 12, 2022 15:50
My hacky little script to identify common character pairs in the Wordle word list.
// See https://jeremyfelt.com/2022/01/12/a-wordle-character-pair-strategy/
const words = []; // Populate with word list.
const wordScores = [];
const pairPositions = [];
const positionText =[ "first", "second", "third", "last" ];
words.forEach( word => {
let position = 0;