Skip to content

Instantly share code, notes, and snippets.

👮‍♀
git inspector

Andrew Luca iamandrewluca

👮‍♀
git inspector
Block or report user

Report or block iamandrewluca

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
View Icon.jsx
import React from 'react';
const {PropTypes} = React;
import iconPaths from './selection.js';// the file exported from IcoMoon
const foundIcons = {};
function getPath(iconName) {
if (foundIcons[iconName]) {
return foundIcons[iconName];
@iamandrewluca
iamandrewluca / event-delegate.js
Created Sep 7, 2017 — forked from mhairston/event-delegate.js
Event Delegation with Plain JavaScript
View event-delegate.js
// Event Delegation with Plain Javascript
// from Adam Beres-Deak
// http://bdadam.com/blog/plain-javascript-event-delegation.html
function on(elSelector, eventName, selector, fn) {
var element = document.querySelector(elSelector);
element.addEventListener(eventName, function(event) {
var possibleTargets = element.querySelectorAll(selector);
var target = event.target;
You can’t perform that action at this time.