Skip to content

Instantly share code, notes, and snippets.

View jkudish's full-sized avatar

Joey Kudish jkudish

View GitHub Profile
@jkudish
jkudish / displaylink-installer-.sh
Created August 13, 2015 04:56
displaylink-installer.sh modified for Fedora 22
<?php
//Locate the attachment post's ID in the database based on the GUID.
function getIDfromGUID( $existing_image ){
global $wpdb;
return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=attachment AND guid=%s", $existing_image ) );
}
$existing_image = "http://guidevoyage.org.dev/wp-content/uploads/2012/02/Fontaine-de-Trevi.jpg";
<?php
require_once dirname( __FILE__ ) . '/wp-load.php';
//$existing_image = 'http://guidevoyage.org.dev' . '/wp-content/uploads/2010/12/122010_0314_LamdinadeSo1.png';
//Locate the attachment post's ID in the database based on the GUID.
function getIDfromGUID( $full_image_url ){
global $wpdb;
@jkudish
jkudish / dusk.sh
Created March 28, 2017 17:45
How I run dusk on Codeship
export DUSK_START_CHROMEDRIVER=false
export DUSK_APP_PORT=8000
export DUSK_CHROME_BINARY=/usr/bin/chromium-browser
nohup bash -c "./vendor/laravel/dusk/bin/chromedriver-linux 2>&1 &"
nohup bash -c "php artisan serve --env=dusk.testing 2>&1 &" && sleep 4
php artisan dusk
@jkudish
jkudish / edd-bug.php
Created November 28, 2023 03:26
Minimum code to reproduce a bug in EDD's database query when performing an Order query containing a date_query and a product_id at the same time
<?php
/**
* Plugin Name: Edd Database Bug Reproduction
* Plugin URI:
* Description: Reproduce a bug in EDD's database query.
* Author: Joey Kudish
* Author URI: https://github.com/jkudish
* Text Domain: edd-database-bug
* Domain Path: /languages
* Version: 0.1.0