Archive for the ‘Web Development’ Category

Finding unique CSS colors with grep and perl

Just a tiny one-liner I’ve found useful to get unique CSS color values in a style sheet: egrep -r ‘#[a-fA-F0-9]{3,6}+(\s|;)’ *.css|perl -ne ‘if (m/(#[a-fA-F0-9]{3,6}+)(\s|;)/){print "$1\n";}’|sort|uniq Suggestions and improvements are welcome!

(continua...) »