Skip to content

Instantly share code, notes, and snippets.

@Billy-
Billy- / rename-author.sh
Created October 10, 2018 19:35
Rewrite commit authors
# "borrowed" from https://stackoverflow.com/a/23564785/1879895
git filter-branch --commit-filter \
'if [ "$GIT_AUTHOR_NAME" = "OldAuthor Name" ]; then \
export GIT_AUTHOR_NAME="Author Name";\
export GIT_AUTHOR_EMAIL=authorEmail@example.com;\
export GIT_COMMITTER_NAME="Commmiter Name";\
export GIT_COMMITTER_EMAIL=commiterEmail@example.com;\
fi;\
git commit-tree "$@"'
@Billy-
Billy- / webpack-unused-files.sh
Created January 22, 2019 14:39 — forked from xjamundx/webpack-unused-files.sh
Quickly identify files unused by webpack
# ----------------------------------- #
webpack --display-modules | awk '{print $2}' | grep ^\.\/ > files-processed.txt;
cd src; # assumes all your files are here
find . -name *.js?(x) | grep -v eslint | grep -v __ > ../../files-all.txt; # excludes __tests__ and .eslintrc files
cd ..;
cat files-all.txt | xargs -I '{}' sh -c "grep -q '{}' files-processed.txt || echo '{}'";
rm files-processed.txt files-all.txt;
# ----------------------------------- #