Strip <span> tags from HTML in vim

David Nash vim, xhtml 4 Comments

When upgrading a website you might see source code like this:

You’re using CSS now and all those <span> tags are ruining it. In gvim, do this search and substitute: %s/<span.\{-}>//g Then to get rid of the </span> tags, do this: :%s/<\/span>//g

Batch reduce resolution of images in Ubuntu Linux

David Nash bash, linux 4 Comments

Open a terminal window or shell (who needs a GUI!?) sudo apt-get install imagemagick cd image_folder mkdir resized for f in *jpg do convert -resize 30% $f resized/$f done Easier than Photoshop, I reckon! I needed this today for some photos I was uploading. Photos from recent cameras are huge and Australian bandwidth doesn’t cut it. So this really helps. Obviously you only need to do the first line once. I found this in the Ubuntu forums but it took me a while to find the right combination of keywords in Google. View the original thread. I needed to change …