Skip to content

Instantly share code, notes, and snippets.

View trusktr's full-sized avatar
📜
writing code

Joe Pea trusktr

📜
writing code
View GitHub Profile
@trusktr
trusktr / event-emitter.js
Created August 21, 2016 02:22 — forked from domenic/event-emitter.js
Revealing constructor pattern event-emitter
// This event emitter emits events, but reserves the right to publish events to
// for its creator. It uses a WeakMap for true encapsulation.
const eesToEventMaps = new WeakMap();
export default class EventEmitter {
constructor(publisher) {
const eventMap = Object.create(null);
eesToEventMaps.set(this, eventMap);
@trusktr
trusktr / MenuBackIcon.qml
Created October 26, 2015 22:29 — forked from cyberbobs/MenuBackIcon.qml
Animated hamburger-back icon in Material Design style done in QML
import QtQuick 2.2
Item {
id: root
width: 24
height: 24
Rectangle {
id: bar1
x: 2