This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as assert from 'assert' | |
import * as crypto from 'crypto' | |
import * as data from './data' | |
function ascendingByProp(prop) { | |
return (a, b) => b[prop] - a[prop] | |
} | |
function descendingByProp(prop) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs').promises; | |
const path = require('path'); | |
interface Params { | |
dir: string; | |
header: string; | |
predicate: (filePath: string) => Boolean; | |
} | |
interface WalkTree { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import { createStore } from 'redux' | |
import { connect, Provider } from 'react-redux' | |
import './styles.css' | |
// Log unnecessary re-renders | |
require('@welldone-software/why-did-you-render')(React, { | |
trackAllPureComponents: true, | |
include: [/^ConnectFunction/], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sizes = { | |
giant: 1170, | |
desktop: 992, | |
tablet: 768, | |
phablet: 572, | |
phone: 376 | |
} | |
export const media = Object.keys(sizes).reduce((accumulator, label) => { | |
accumulator[label] = (...args) => css` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { exec } from 'child_process' | |
import debug from 'debug' | |
export default { | |
check: cwd => new Promise((resolve, reject) => { | |
let resolveObj = { | |
behind: false, | |
amount: 0, | |
branch: 'origin/stable' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import assert from 'assert' | |
import Immutable from 'immutable' | |
const batchSetters = state => { | |
state.set('a', 1) | |
state.set('b', 2) | |
state.set('c', 3) | |
return state | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import assert from 'assert' | |
const tracer = async obj => { | |
const trace = {} | |
let order = [] | |
const object = new Proxy(obj, { | |
get (target, prop) { | |
order = order.concat(prop) | |
trace[prop] = Reflect.has(trace, prop) ? trace[prop] + 1 : 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs' | |
import { interpolateName } from 'loader-utils' | |
// webpack config | |
const publicPath = 'static' | |
const filenameTemplate = '[name].[hash].[ext]' | |
const extensions = [ | |
'png', 'jpg', 'jpeg', 'gif', | |
'ico', 'svg', 'otf', 'eot', 'svg', | |
'ttf', 'woff', 'woff2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am justingreenberg on github. | |
* I am jkg (https://keybase.io/jkg) on keybase. | |
* I have a public key ASDIroaoNEZCCD8O4tjhCSgtC7tzKSP_KD7sTXgZFgpsnwo | |
To claim this, I am signing this object: |