Skip to content

Instantly share code, notes, and snippets.

View mattonomics's full-sized avatar

Matt Gross mattonomics

  • Bonsai.io (OMC)
  • Lexington, KY
View GitHub Profile
@mattonomics
mattonomics / keybase.md
Created March 23, 2021 15:10
keybase.md

Keybase proof

I hereby claim:

  • I am mattonomics on github.
  • I am matthewgross (https://keybase.io/matthewgross) on keybase.
  • I have a public key ASDtZnaFsxeNj0Wh5eSNHkgxZ566nnHgyF4yXnnFO59PtAo

To claim this, I am signing this object:

@mattonomics
mattonomics / wordpress-search.php
Created July 2, 2018 15:35
WordPress Search – Core Functionality
<?php
/**
* Generates SQL for the WHERE clause based on passed search terms.
*
* @since 3.7.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $q Query variables.
@mattonomics
mattonomics / unblur-mens-health.js
Created March 29, 2017 20:57
Unblur Men's Health
const allParagraphs = document.getElementsByTagName('*');
Object.keys( allParagraphs ).map(function(key){
console.log(allParagraphs[key].className);
if ( allParagraphs[key].className.length > 0 && allParagraphs[key].className.indexOf( 'ad-blocker-custom-blur' ) !== -1 ) {
allParagraphs[key].className = allParagraphs[key].className.replace( 'ad-blocker-custom-blur', '' );
}
});
@mattonomics
mattonomics / heteronyms.txt
Created February 19, 2017 18:29
Heteronym List
abstract|abuse|address|advocate|affect|agape|allied|alternate|analyses|appropriate|attribute|articulate|axes|ay|aye|bases|bass|blessed|bow|buffet|close|combine|compact|complex|compound|concert|conduct|confines|conflict|console|content|contract|convict|crooked|decrease|defense|desert|discard|do|does|dogged|dove|ellipses|entrance|exploit|house|incense|increase|intimate|invalid|laminate|lead|learned|lima|live|merchandise|minute|mobile|moped|mow|multiply|number|object|overall|periodic|polish|present|primer|proceeds|produce|progress|project|putting|ragged|read|rebel|record|refuse|resign|resume|root|row|sake|second|separate|sewer|shower|sin|sow|subject|supposed|tear|tier|transfer|use|unionized|whoop|wicked|wind|wound

Keybase proof

I hereby claim:

  • I am mattonomics on github.
  • I am mattonomics (https://keybase.io/mattonomics) on keybase.
  • I have a public key whose fingerprint is DBC9 5681 5FB8 895B A2E3 B18D 1413 D8B6 CBA0 B230

To claim this, I am signing this object:

# sets the wp-cli php binary to the correct file
export WP_CLI_PHP=/Applications/MAMP/bin/php/php5.3.28/bin/php
# overrides the mamp php path to ensure we use what we want
export MAMP_PHP=/Applications/MAMP/bin/php/php5.3.28/bin
# adds the mamp binaries to the path for mysql winning
export PATH="/Applications/MAMP/Library/bin:${MAMP_PHP}:${PATH}"
export WP_CLI_PHP=/Applications/MAMP/bin/php/php5.3.28/bin/php
export MAMP_PHP=/Applications/MAMP/bin/php/php5.3.28/bin
export PATH="$MAMP_PHP:$PATH"
<?php
// First, we have the strings to test.
$string_to_find = 'brisket';
$string_to_search = '5rWIZiWxvRAqrKEJgx8IS0JZkKxop9Z5rWg7yPZsU8zzBneMR65tgZzPd5LZtfUBNbKpthEI4qSZJC6H3yFCpl3VaA3aYbrisket';
// now we'll test strpos…
echo 'Start time, strpos(): ', ( $strpos_start = microtime( true ) ), "\n\n";
for ( $i = 1; $i <= 1000000; $i++ ) {
if ( strpos( $string_to_search, $string_to_find ) ) {
<?php
add_action('customize_register', 'customize_that_does_not_work');
function customize_that_does_not_work($wp_customize) {
$wp_customize->add_section('testing_wp_customize',array(
'title' => 'Testing WP Customize',
'description' => 'Please Lort let this work.',
));
Array (
[post_type] => post
[posts_per_page] => 5
[ignore_sticky_posts] => 0
[order] => DESC
[orderby] => date
[tax_query] => Array (
[0] => Array (
[taxonomy] => category
[field] => id