This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function import_cards() { | |
\WP_CLI::log( 'Querying pokemontcg.io...' ); | |
$cards = Pokemon::Card( [ 'verify' => false ] )->where( [ 'setCode' => 'sm9', 'pageSize' => 1000 ] )->all(); | |
foreach ( $cards as $card_obj ) { | |
$card = $card_obj->toArray(); | |
$hash_text = $card['name'] . implode( ' ', $card['text'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace oddEvan\TrainerDB\Content\Taxonomy; | |
use WebDevStudios\OopsWP\Structure\Content\Taxonomy; | |
class CardHash extends Taxonomy { | |
protected $slug = 'card_hash'; | |
protected $object_types = [ 'card' ]; | |
protected function get_labels() : array { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace oddEvan\TrainerDB\Content\PostType; | |
use WebDevStudios\OopsWP\Structure\Content\PostType; | |
class Card extends PostType { | |
protected $slug = 'card'; | |
protected function get_labels() : array { | |
return [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace EPH\DAEmbed; | |
function register_providers() { | |
$callback = __NAMESPACE__ . '\handle_deviantart'; | |
wp_embed_register_handler( 'deviantart-main', '#https://www.deviantart.com/*+#', $callback, 10 ); | |
// Include other handlers as needed | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Embed DeviantART | |
Description: Allow embeds from deviantART pages | |
Author: Evan Hildreth | |
Version: 1.0 | |
*/ | |
function eph_register_deviantart() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# THIS IS AN INTERACTIVE SCRIPT | |
# | |
# Installs a LEMP stack onto an Ubuntu 18.04 LTS image: | |
# | |
# - Creates sudo user with given username and password | |
# - Updates all packages | |
# - Installs Nginx, MySQL, and PHP | |
# - Runs mysql_secure_installation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function eph_get_child_tiers( $parent_id ) { | |
$child_tiers = array(); | |
$child_tier_query = new WP_Query( array( | |
'post_parent' => $parent_id, | |
'post_type' => array( 'eph_ccdb_service' ), | |
'nopaging' => true, | |
'order' => 'ASC', | |
'orderby' => 'title', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: CCDB Suite | |
Plugin URI: http://eph.me/cordcutdb | |
Description: Custom post types, taxonomies, and custom fields to enable Cordcut DB. | |
Author: Evan Hildreth | |
Version: 1.0 | |
Author URI: http://eph.me/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This is designed to get a CentOS 7 system up and running | |
# from absolutely nothing. It will install the LAMP stack | |
# as well as RVM and Phusion Passenger | |
# Run this as root | |
yum update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
io = File.open('RFL_DB.dat') | |
io.read(4) #Burn the first 4 bytes | |
(1..100).each do |k| | |
mii = io.read(74) | |
break unless mii; | |
IO.binwrite("#{k}.miigx", mii); | |
end |