Skip to content

Instantly share code, notes, and snippets.

@calcsam
calcsam / gatsby_performance_build_script.sh
Created June 24, 2018 06:48
Build script used for Gatsby performance benchmarking
export GITHUB_USER=freeCodeCamp
export REPO=guide
export COMMIT_HASH=6f35bcd61103545136a3ed130124da9822b761ed
#export GITHUB_USER=calcsam
#export REPO=gatsby-image-performance-benchmarking
#export COMMIT_HASH=d2d358ed54ade68c057333666777fd56bef5ebf2
#export COMMIT_HASH=f05103a1c3e0b25ea4beafd63b6df72953d657b2
sudo -E su
@calcsam
calcsam / script.sh
Created December 20, 2016 11:12
Simple shell script to measure app complexity over time
for i in {1..100}
do
a=$(find ./assets/ -name *.jsx | xargs wc -l | tail -n 1); b=$(git rev-parse HEAD); c=$(git show -s --format=%ct $b); echo $a $b $c >> ~/Documents/line-log.txt; git checkout HEAD~1
done
# assumes all class names start on new line like:
# .class-name {
cat path/to/file.scss | grep '^\.' | sed 's/\.//' | sed 's/ {//' | xargs -I % bash -c 'if ! grep -q -s -r --include \*.jsx -m 1 % *; then echo %; fi'