Skip to content

Instantly share code, notes, and snippets.

@correlator
correlator / flashflush.sh
Created September 4, 2017 22:59 — forked from 50kudos/flashflush.sh
A Bash script that lists all unused css classes in html/haml/erb files for rails project (or maybe others depending on project structure)
#!/bin/bash
cat $(find app/assets/stylesheets/ -type f) |
grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// |
while read CSS; do
if ! grep -Erqi "([^(remove|has)]?class[(:|=|[:space:]*=>[:space:]*)]*[[:space:]\W]*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then
echo $CSS >> unused.scss;
fi
done
@correlator
correlator / results
Created September 27, 2016 15:47 — forked from choubacha/results
Clinton:
Summary
Distinct words: 1339 out of 6101 (0.22)
Linear Histogram
Times said | Number of distinct words
0..10 | 1232 (20.19%)
10..20 | 52 (0.85%)
20..30 | 20 (0.33%)