Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan McCue rmccue

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am rmccue on github.
  • I am rmccue (https://keybase.io/rmccue) on keybase.
  • I have a public key ASB1nf87pm0h0dkgm8ejxGL8KyOkkwbcA-7udP-D7I8qHwo

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am rmccue on github.
  • I am rmccue (https://keybase.io/rmccue) on keybase.
  • I have a public key ASCILnUMWLsVHRN6vU_QWIVD43Gdi69Du7-v8Rp0bKrFUgo

To claim this, I am signing this object:

View react-dom.js
// Resolve custom components by calling .render() recursively.
const resolveComponents = element => {
// If the "component" is a string, it's static text.
if ( typeof element === 'string' ) {
return element;
}
// If the type is a string, it's already in DOM node form.
if ( typeof element.type === 'string' ) {
return element;
View Blackbox.html
<a href="blackbox://🔒">lock</a>
<a href="blackbox://🔓">unlock</a>
<a href="blackbox://🔐">key</a>
View api-strict-mode.php
<?php
/**
* Plugin Name: WP REST API Strict Mode
* Description: Triggers an error when unregistered parameters are used.
* Author: Ryan McCue
* Author URI: http://rmccue.io/
* Version: 0.1
*
* Requires https://core.trac.wordpress.org/ticket/35507
*/
@rmccue
rmccue / gist:99df1e545bd8bf45c9b8
Last active Aug 29, 2015
Demo code from WC talk - Requires v2 of the REST API
View gist:99df1e545bd8bf45c9b8
<?php
/**
* Grab latest post title by an author!
*
* @param array $data Options for the function.
* @return string|null Post title for the latest,
 * or null if none.
*/
function my_awesome_func( $data ) {
$posts = get_posts( array(
@rmccue
rmccue / README.md
Created Nov 4, 2014
Commit message syntax highlighting in Vim with submodules
View README.md

Ever tried committing inside a git submodule, only to find that Vim doesn't syntax highlight your commit message? Worry no more!

Simply save the following file as ~/.vim/filetype.vim

View gist:4a0dadc68aa4e75c851f
<?php
namespace HM\Hotfix;
add_action( 'deleted_option', __NAMESPACE__ . '\\workaround_28701' );
/**
* Workaround cache deletion issue
*
* Ensures that the singular
View gist:e03d99d04e1db8ab06a6
<?php
/**
* Plugin Name: HM Autoloader
* Description: Provides a standard autoloader utility for the site to use
* Author: Human Made Limited
* Author URI: http://hmn.md/
*/
namespace HM;
@rmccue
rmccue / gist:61b683b61011b96149bb
Created Jun 11, 2014
Experiments in skipping the main WP query
View gist:61b683b61011b96149bb
<?php
add_action( 'setup_theme', function () {
global $wp;
class RM_FakeWP extends WP {
public $skip_query = false;
function main($query_args = '') {
$this->init();