Skip to content

Instantly share code, notes, and snippets.

View oddevan's full-sized avatar

Evan Hildreth oddevan

View GitHub Profile
<?php
add_action( 'rest_api_init', function () {
register_rest_route( 'oddevan/v1', '/devArtProxy/', array(
'methods' => 'GET',
'callback' => __NAMESPACE__ . '\proxy_deviantart_oembed',
'permission_callback' => __NAMESPACE__ . '\proxy_deviantart_oembed_security',
) );
} );
<!-- wp:paragraph -->
<p>The Fallen will continue to claw at the walls of our City, unless we strike them down. Beneath the ruins of the Cosmodrome, in the shadow of an old colony ship, we've located the House of Devils' Lair and the High Servitor feeding them their strength. We must destroy this machine god, and send their souls screaming back to hell.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Something dark stirs in the depths of the Hellmouth. We can feel it. A Hive abomination bred for unthinkable evil. We must pierce the veil of their Summoning Pits and destroy this creature before the Hive unleash it upon us all.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Far below the Ishtar Academy, the Vex have set something in motion, a world-eating machine transforming Venus into another link in their intergalactic chain. This Nexus must be stopped and the Mind that controls it, destroyed.</p>

Alright, let’s do this one last time. My name is Peter Parker. I was bitten by a radioactive spider and for ten years I’ve been the one and only Spider-Man. I’m pretty sure you know the rest. I saved a bunch of people, fell in love, saved the city, and then I saved the city again and again and again... And uh... I did this. We don’t really talk about this.

Look, I’m a comic book, I’m a cereal, did a Christmas album. I have an excellent theme song. And a so-so popsicle. I mean, I’ve looked worse. But after everything, I still love being Spider-Man. I mean, who wouldn’t? So no matter how many hits I take, I always find a way to come back. Because the only thing standing between this city and oblivion is me. There’s only one Spider-Man. And you’re looking at him.

<?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'] );
<?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 {
<?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 [
<?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
}
<?php
/*
Plugin Name: Embed DeviantART
Description: Allow embeds from deviantART pages
Author: Evan Hildreth
Version: 1.0
*/
function eph_register_deviantart() {
@oddevan
oddevan / ubuntu-lemp-certbot.sh
Last active November 26, 2018 03:25
An interactive script to set up an Ubuntu 18.04 LTS image with LEMP, store web page files in user's home directory, and install/run certbot
#!/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
@oddevan
oddevan / page-cordcut-compare.php
Created July 20, 2017 00:21
A fragment of a custom WordPress page to take the information from `eph-ccdb-suite.php` and display it in a comparison page.
<?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',