Skip to content

Instantly share code, notes, and snippets.

View chrisbolin's full-sized avatar
❤️

Chris Bolin chrisbolin

❤️
View GitHub Profile
@chrisbolin
chrisbolin / script.js
Created May 24, 2016 17:28
Documents -> Spreadsheet Array
/*
converts an array of objects into an array of row arrays,
suitable for use in e.g. a csv coversion (npm install csv-stringify)
includes the header row.
e.g.
objectArray = [{a: 1, b: 120}, {a: 2, c: 'horse'}]
toRows(objectArray) -> [ ['a', 'b', 'c'], [1, 120, undefined], [2, undefined, 'horse'] ]
*/
const toRows = objectArray => {
@chrisbolin
chrisbolin / SnapshotGuidelines.md
Last active May 31, 2018 17:18
Snapshot Guidelines

The Rule: Keep Snapshot Tests Useful

Snapshots can be helpful, but if used improperly they can useless or even a burden.

Make Snapshots Targeted

Don't snapshot things you don't care about. Don't snapshot an entire wrapper component if you are only interested in a single subcomponent. You can use enzyme's find() (available on both shallow and full wrappers).

Make Snapshots of Shallow Components

@chrisbolin
chrisbolin / README.md
Created August 15, 2018 06:21
Useful 404 Pages

Suggest sites to user based on URL matching and other information. Might require crawling the site or calling out to a search API like Duck Duck Go.

@chrisbolin
chrisbolin / .yarnrc
Last active December 18, 2018 22:44
Bundling specific Yarn version in a project with yarn-path
yarn-path "./yarn-1.12.3.js"