Skip to content

Instantly share code, notes, and snippets.

View mdwheele's full-sized avatar

Dustin Wheeler mdwheele

View GitHub Profile
@mdwheele
mdwheele / .travis.yml
Created January 26, 2016 15:41
Example Travis CI Configuration for PHP
language: php
sudo: false
matrix:
fast_finish: true
include:
- php: 7.0
env: WITH_COVERAGE=true
- php: 5.6
@mdwheele
mdwheele / GameDevLinks.md
Last active December 27, 2015 08:39
GameDev Related Links
@mdwheele
mdwheele / AssetLoader
Created November 4, 2013 00:15
LibGdx Grouped Asset Loader
public class Assets implements Disposable, AssetErrorListener {
private static final String TAG = "Assets";
private Logger logger;
private AssetManager manager;
private ObjectMap<String, Array<Asset>> groups;
public Assets(String assetFile) {
logger = new Logger(TAG, Logger.INFO);
@mdwheele
mdwheele / gist:7171422
Created October 26, 2013 16:23
Simple Sublime Text-esque JS Filter
var items = [
'/home/user/code/folder/whatever/something/nothing/neat.js',
'/home/user/code/folder/whatever/something/nothing/great.js',
'/home/user/code/folder/whatever/something/nothing/stuff.html',
'/home/user/code/folder/whatever/something/nothing/elmo.css',
'/home/user/code/folder/whatever/something/nothing/animal.css',
'/usr/local/lib/blah',
'/foo/bar/baz/goo/blue'
];
@mdwheele
mdwheele / Cache.php
Last active November 17, 2015 20:57
Useful trick to stub stable WordPress functions for testing your plugin boundaries in isolation.
<?php
namespace Vendor\Services;
use Closure;
class Cache
{
protected $prefix;
@mdwheele
mdwheele / .gitmessage
Created September 21, 2015 14:48
A template for a reasonable git commit.
Replace this line with imperative summary
An awesome description describing WHY over HOW/WHAT
# [Ticket #12]
#-----------------------------------------------@----------------------#
#
# 1. Summary should be under 50 characters. @-symbol above is a marker
# for that.
@mdwheele
mdwheele / ponder.md
Last active August 29, 2015 14:08
Ponderances on using media-type representation as a mechanism for partitioning use-cases on a resource under different contexts.

Please do not read any of this with an "absolute" tone. These are merely my thoughts on a problem based in my current understanding and some experience. To be honest, I would not be surprised if this is already being done by individuals more experienced than I at building REST APIs, but I think it is worth discussing as I have yet to find anything like this blogged about. I present this with utmost humility in order to foster discussion; not to create devolving argument.

Some Background

I believe that usage of media types in examples on the web demonstrating "how to build" RESTful APIs is too narrowly focused. In my experience, much of the discussion around them seems to be solely focused on their usage either in content-negotiation or applying versioning to an API.

*As an aside, versioning can be "controversial" itself as an "anti-pattern" of REST. I heard it argued that HATEOAS should be the answer to the problem that versioning works to solve. This is an aside and not the focus of this ponderanc

.DS_Store
.idea/
@mdwheele
mdwheele / php-friend.php
Created August 11, 2014 13:00
An example of how one might implement a pseudo-friend relationship between two PHP objects.
<?php
class SampleEntity
{
private $friend = 'SampleEntityPresenter';
protected $firstName;
protected $lastName;
public function __construct($firstName, $lastName)