lazyhacker / utilities / jhpacker

Here are some utilities / code snippets that you're free to use in whatever way you want. Hopefully I'll upload some more stuff in the near future.
Thanks to Hsin for letting me contribute to lazyhacker, and let me know if you have any feedback.
-Jason <jhpacker@lazyhacker.com>

You can just rename the .phps files .php and you should be good to go. Hey, we're required to be a little lazy, right?

random_img.php
Pulls a random image out of a directory. You can specify what size or size range you want the image to be and it'll randomly cycle through the available image files in the directory you point it at. For use like:
<img src="random_img.php?dir=images/banners&size=200-300x200">
to pull a random image from DOCUMENT_ROOT/images/banners of size 200 to 300 wide and 200 high.

printable.php
Creates a bare-bones printable HTML version of the document you pass to it, pulling out background images & colors, javascript, etc. It's pretty basic but handy if you have a static HTML site you want to put "printable version of this page" links on.

htmlmaker.dot
Drop this into your Microsoft Office\Office\Startup directory and you'll get a couple new items under the "Tools" menu in Word.

HTMLmaker: Creates a simple HTML skeleton file out of your currently open document. I use it to copy & paste stuff from Word into Dreamweaver or whatever, but it'll save you from either having to insert lots of formatting tags after you cut & paste the straight text from Word or the evils of "Save as webpage".
Doesn't do much html entity escaping, though the code is in there if you'd like that functionality.

StripTags: You probably won't need this but it can remove existing HTML tags in your document, I sometimes run that before HTMLmaker itself.

The above stuff is a very bad hack of some of "Filip's Word Macros 1.5.1" by Bo Svernstrom (http://www.algonet.se/~bofilip). I apologize for mangling this (I'm not a VB programmer at all), but it's been a useful util for me and others.


| lazyhacker home |

© Hsin Tsao