Skip to content

Instantly share code, notes, and snippets.

Ryan Duffy ryanjduffy

Block or report user

Report or block ryanjduffy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ryanjduffy / App.js
Last active Nov 9, 2018
View App.js
// How it might be used by an application
import configure, {fetchConfig} from './analytics';
// example of some custom logic that could be used to add metadata to the log
const getPanelName = (node) => {
const panel = node.closest('article[role="region"]');
let panelName = '<None>';
if (panel) {
const header = panel.querySelector('header h1');
ryanjduffy /
Created Jul 25, 2018
Enact Developer Grant and Certificate of Origin 1.0

Enact Developer Grant and Certificate of Origin 1.0

By making a contribution to the Enact Project (“Project”), I represent and warrant that:

a) The contribution was created in whole or in part by me and I have the right to submit the contribution on my own behalf or on behalf of a third party who has authorized me to submit this contribution to the Project; or

b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right and authorization to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license) that I have

ryanjduffy / MoreToolbar.patch
Last active Mar 22, 2017
View MoreToolbar.patch
diff --git a/source/MoreToolbar.js b/source/MoreToolbar.js
index ab432e6..2c44e4c 100644
--- a/source/MoreToolbar.js
+++ b/source/MoreToolbar.js
@@ -51,22 +51,37 @@ enyo.kind({
+ rendered: function(){
+ this.reflow();
ryanjduffy / debugger.html.diff
Created Feb 26, 2017
Auto-expand breakpoints when adding a new breakpoing in debugger.html
View debugger.html.diff
diff --git a/src/components/SecondaryPanes/index.js b/src/components/SecondaryPanes/index.js
index 43dcb33..f4aad39 100644
--- a/src/components/SecondaryPanes/index.js
+++ b/src/components/SecondaryPanes/index.js
@@ -65,6 +65,15 @@ const SecondaryPanes = React.createClass({
displayName: "SecondaryPanes",
+ componentWillReceiveProps(nextProps) {
+ const { breakpoints: { size }} = this.props;
ryanjduffy / logState.js
Last active Jan 20, 2017
Log React State Changes
View logState.js
import React from 'react';
const original = React.Component.prototype.setState;
const logState = function (type, current, updated) {
console.log(type.displayName || || 'Component', 'updating', current, 'with', updated);
const logger = function (partialState, callback) {
const type = this._reactInternalInstance._currentElement.type;
View file.js
// vim: syntax=JSX
import React from 'react';
export default class MyClass extends React.Component {
render() {
return (
<a href="">Let's head to</a>
ryanjduffy /
Last active Aug 29, 2015
Console jsperf

Usage Example

// Setup code before all tests are ran
jsperf.before(function () {
   testStr = '-1/2';

// Teardown code after all tests are ran
jsperf.after(function () {
ryanjduffy / App.js
Last active Aug 29, 2015
GridListImageItem + Badge Overlay
View App.js
ready = require('enyo/ready'),
kind = require('enyo/kind'),
GridListImageItem = require('moonstone/GridListImageItem'),
ImageBadge = require('moonstone/ImageBadge');
ready(function () {
var C = kind({
ryanjduffy / codepen.html
Created Jun 18, 2014 Launcher for EnyoJS
View codepen.html
<title> Launcher for EnyoJS</title>
<form id="form" action="" method="POST"><input id="data" type="hidden" name="data"></form>
var q =;
var libs = q.split(",");
ryanjduffy /
Last active Aug 29, 2015
enyo.attach prototype


Exercise to allow an enyo kind to "attach" to existing markup for progressive enhancement, web component-style integration, or preference for markup over enyo-style components[] block.

View it in action on JSFiddle

Attaching a kind to a control

Define it and call enyo.attach with a reference to the kind and target node

enyo.kind({name: <kind name>});
You can’t perform that action at this time.