This file contains hidden or 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
/** | |
* Measures a canvas and splits lines of text so that they fit within the width thereof. | |
* Requires some text styling to be applied to the canvasContext already, and will not function as expected if that is changed between calculation and drawing of returned lines | |
* | |
* @param canvas - <canvas> | |
* @param text - String the text to measure and break up | |
* @param padding - the horizontal padding to take into account (assumes left/right padding are equivalent) | |
* | |
* @returns [Array] - an array containing lines of text that, when rendered on the canvas will not exceed the canvas' width | |
*/ |
This file contains hidden or 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
namespace HM\REST_API; | |
class REST_API { | |
public function __construct() { | |
add_action('rest_api_init', array($this, 'register_routes')); | |
} | |
public function register_routes() { |
This file contains hidden or 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
namespace HM\REST_API; | |
class REST_API { | |
public function __construct() { | |
add_action('rest_api_init', array($this, 'register_routes')); | |
} | |
public function register_routes() { | |
$api_namespace = 'hm/v1'; |
This file contains hidden or 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
namespace HM\REST_API; | |
class REST_API { | |
} | |
new REST_API(); |
I hereby claim:
- I am jordanforeman on github.
- I am jordanforeman (https://keybase.io/jordanforeman) on keybase.
- I have a public key whose fingerprint is 1B74 016D 06FD 4CA1 82CD 70D4 851A 4889 2A34 D49C
To claim this, I am signing this object:
This file contains hidden or 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
EventDispatcher = { | |
events: {}, | |
on: function(event, callback) { | |
var handlers = this.events[event] || []; | |
handlers.push(callback); | |
this.events[event] = handlers; | |
}, |
This file contains hidden or 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
/* These numbers are all arbitrary; feel free to tweak them to your liking/needs */ | |
$mobileBreakpoint: 360px; | |
$tableBreakpoint: 720px; | |
$desktopBreakpoint: 1080px; | |
@mixin breakpoint($bp) { | |
/* Use min-width for a progressive-enhancement approach */ | |
@media screen and (min-width: $bp) { @content } | |
} |
This file contains hidden or 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
// Responsive JavaScript Helpers | |
/* CONSTANTS HOLDER */ | |
var ScaleDirection = { | |
SCALE_UP : "UP", | |
SCALE_DOWN : "DOWN" | |
}; | |
/* RESPONDER CLASS */ |
This file contains hidden or 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 RGB = function(r, g, b){ | |
this.r = r; | |
this.g = g; | |
this.b = b; | |
}; | |
RGB.prototype.toString = function(){ |