Skip to content

Instantly share code, notes, and snippets.

Avatar
📜
writing code

Joe Pea trusktr

📜
writing code
View GitHub Profile
@trusktr
trusktr / event-emitter.js
Created Aug 21, 2016 — forked from domenic/event-emitter.js
Revealing constructor pattern event-emitter
View event-emitter.js
// 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 Oct 26, 2015 — forked from cyberbobs/MenuBackIcon.qml
Animated hamburger-back icon in Material Design style done in QML
View MenuBackIcon.qml
import QtQuick 2.2
Item {
id: root
width: 24
height: 24
Rectangle {
id: bar1
x: 2