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
<!-- CSS Stylesheet --> | |
<link rel='stylesheet' type='text/css' href='css/draggable.css' /> | |
<!-- The things we are dragging --> | |
<div class='thing'><label>Thing 1</label></div> | |
<div class='thing'><label>Thing 2</label></div> | |
<div class='thing'><label>Thing 3</label></div> | |
<!-- jQuery and jQuery-UI --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> |
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 | |
/** | |
* Filter the roles table items on the Users > Roles screen | |
* | |
* @param array $roles List of role "slugs" being shown in the table | |
* @param string $role_view View type for current screen (e.g. all, mine, active, etc) | |
* | |
* @return array The filtered $roles array | |
*/ | |
add_filter( 'members_manage_roles_items', 'my_manage_roles_items', 10, 2 ); |
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 | |
/** | |
* Attempting to register a post type within a plugin, without using a hook, | |
* results in a fatal error | |
*/ | |
$args = array( | |
... etc ... | |
); | |
register_post_type( 'my_post_type', $args ); |
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 | |
/** | |
* The `Helping_Friendly_Post` class is an exercise in thinking about extending the `WP_Post` class | |
* | |
* @see https://github.com/mhull/helping-friendly-plugin/blob/master/lib/class-hphp-post.php | |
*/ | |
/** | |
* To get a new extended post by ID | |
*/ |
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 | |
/** | |
* Uses the `spl_autoload_register` function to autoload classes so that we don't have to | |
* explicitly require each file for each class we use in our code | |
*/ |
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 | |
#! /acme-plugin/acme-plugin.php | |
/** | |
* Plugin Name: ACME Plugin | |
* Description: A WordPress plugin example using PHP namespaces and autoloading | |
* Version: 0.0.0 | |
* Author: Michael Hull | |
* Author URI: https://resoundingechoes.net | |
*/ |
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
<!-- Key template --> | |
<script type='text/html' id='key-template'> | |
<kbd>{{ key.key }}</kbd> | |
<span class='sound'>{{ key.name }}</span> | |
<audio src="sounds/{{ key.name }}.wav"></audio> | |
</script> |
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
/** | |
* In the `person.sayHello` function, we are using an ES6 template literal | |
* to dynamically create a string | |
*/ | |
var person = { | |
first: 'Michael', | |
last: 'Hull', | |
sayHello: function() { | |
console.log( `Hi, my name is ${this.first} ${this.last}` ); | |
}, |
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
var coinTosses = [ | |
{ isHeads: true, user: 'Michael', time: 1485954569 }, | |
{ isHeads: false, user: 'Michael', time: 1485954575 }, | |
/* ... etc ... */ | |
]; |
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
import { Component } from '@angular/core'; |
OlderNewer