Skip to content

Instantly share code, notes, and snippets.

@eddiesholl
eddiesholl / keybase.md
Last active June 26, 2017 05:55
keybase.md

Keybase proof

I hereby claim:

  • I am eddiesholl on github.
  • I am eshollzen (https://keybase.io/eshollzen) on keybase.
  • I have a public key whose fingerprint is C917 6BFC BC4A 9AED 0C50 37C5 F537 1E40 B367 FE50

To claim this, I am signing this object:

@eddiesholl
eddiesholl / clean_yarn_mirror.sh
Last active August 11, 2017 17:47
Find package files stored in yarn offline mirror that are no longer referenced/resolved in yarn.lock file
# There is no way right now to find packages included in an offline mirror folder that are
# not actually referenced by the current yarn.lock file. This script will compare the files
# in your offline mirror folder and find any that are not in the current set resolved by yarn.
# The closest is https://yarnpkg.com/en/docs/prune-offline-mirror but this only effects
# specific future activities, like calling 'yarn upgrade'.
# example usage: cd some_repo; clean_yarn_mirror.sh ./npm_offline_cache
echo "Scanning files in $1..."
tgz=($(grep -ho -e 'resolved .*\.tgz' yarn.lock | cut -d" " -f2))
@eddiesholl
eddiesholl / factory.js
Created August 31, 2017 07:58
Tools for processing webpack output, to help identify time spent
const input = require('./factory.json')
const addPaths = (name, prefix) => prefix === '' ? name : `${prefix}/${name}`
const createNode = (name, subPath) => {
return {
name,
path: addPaths(name, subPath),
cost: 0,
children: []