Skip to content

Instantly share code, notes, and snippets.

View TylerK's full-sized avatar
👉
Pushing rectangles around the screen

Tyler Kelley TylerK

👉
Pushing rectangles around the screen
View GitHub Profile
@TylerK
TylerK / click-outside.tsx
Last active May 8, 2018 10:47
Click outside higher order component for React written in TypeScript
import React from 'react';
import { findDOMNode } from 'react-dom';
type HocWrapper<P> = React.ComponentClass<P> | React.SFC<P>;
function withClickOutside<P, S>(Component: HocWrapper<P>): React.ComponentClass<P> {
class WrappedComponent extends React.Component<P, S> {
private handleClickOutside = e => {
const bounds = this.wrappedDomNode.getBoundingClientRect();
const mouseX = e.clientX || e.pageX;
@TylerK
TylerK / writing-better-tickets.md
Last active November 3, 2016 19:26
Writing Better Tickets

Overview

Issue reporting is not solely the domain of most QA departments. As such, many different people can be tasked with reporting issues we come across on our projects. It will make the lives of those on the development side much easier if all issues are written in a consistent manner and contain a minimum amount of necessary information.

Note: This document is not intended to instruct users how to report bugs and improvements. It is intended for fellow developers, QA folks, PM's, and any other employees involved in the software design & development processes.


When to File a Bug Vs. an Improvement

@TylerK
TylerK / node.walk.js
Last active December 2, 2015 03:16
Quick function to walk a local directory and return a Javascript object of it's files\folder structure
/*
* Recursively walk a directory and return JSON.
* @param {string} dir - root dir to walk, must supply this.
* @param {object} structure - internal object to build, no need to supply this.
*/
let walkDir = (dir, structure = []) => {
let files = fs.readdirSync(dir);
files.forEach((node, i) => {