A brief sampling of my work
In: Uncategorized
31 Oct 2009Back with more one liners…
This one converts all html tags in a file to lowercase.
perl -pi.old -e 's/(<\/?)(address|applet|area|a|base|basefont|big|blockquote|body|br|b|caption|center|cite|code|dd|dfn|dir|div|dl|dt|em|font|form|h1|h2|h3|h4|h5|h6|head|hr|html|img|input|isindex|i|kbd|link|li|map|menu|meta|ol|option|param|pre|p|samp|script|select|small|strike|strong|style|sub|sup|table|td|textarea|th|title|tr|tt|ul|u|var)([\s\/>])/$1.lc($2).$3/gie' file
This concatenates all files of a specified type – prefixed with its title. Useful for quick code review across many files.
for i in $(find -regex ".*\.jsp$"); do echo '<!--' $i '-->'; cat $i; done > combined.jsp
This one removes all multiline comments from a file.
perl -pi.old -e 'BEGIN {$/ = undef;} s#\*.*?\*/##sg' test
If you understand the -p option, you’ll understand why the BEGIN block is necessary and why the s flag is not very useful without the BEGIN. To really understand, what’s going on I recommend reading perlrun.
This portifolio represents a brief sampling of my work. More thorough demonstrations and walk-thrus of my latest and greatest work are available via remote virtual session on DimDim, a free flash based web conferencing tool.
You can view my resume here.
Also note that I recently joined StackOverflow where you will find me asking and answering many web development questions.