Skip to content

Instantly share code, notes, and snippets.

@ryanjduffy
ryanjduffy / MoreToolbar.patch
Last active March 22, 2017 15:48
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({
this.inherited(arguments);
this.$.client.setLayoutKind(this.clientLayoutKind);
},
+ rendered: function(){
+ this.reflow();
@ryanjduffy
ryanjduffy / dco.md
Created July 25, 2018 16:19
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
ryanjduffy / App.js
Last active November 9, 2018 00:16
@enact/analytics
// 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
ryanjduffy / useIdleMapReduce.ts
Created December 21, 2020 18:41
useIdleMapReduce
function useIdleMapReduce<T = any, M = T, R = M>(
array: T[],
map: (item: T, index: number, array: T[]) => M,
reduce: (acc: R, value: M, index: number, array: M[]) => R,
initialValue: R
) {
const ref = useRef({ array, out: [] as M[], acc: initialValue, index: 0, id: null });
const result = useCallback(() => {
if (ref.current.index !== -1) callback(true);
return ref.current.acc;