Site Search:



Calendar

August 2008
M T W T F S S
« Jun    
 123
45678910
11121314151617
18192021222324
25262728293031

Archive for the 'PHP' Category

So… The windows command line has a bunch of commands built in for common tasks such as creating directories, renaming stuff, moving things about, yada yada yada. Its kind of stunted though when I compare it to the kind of file operations I do all the time in my development work.

I just finished sorting a huge number of files into appropriate directories, and noticed annoyingly that about 10,000 files (images in this case) had signatures in the file name making them ugly when displayed on my HTPC as a slide show. For example “Blue Iris (!downloaded from precariouspanther.net!)”… (The site link obviously changed in this case). Rather than having that garbage show up on my screen, I much prefer it to just be “Blue Iris”.

The easiest way to do this is just selecting the file, pressing F2 (or right click/rename) and editing the name removing out the garbage. This is normally fine - however with this collection of around 10,000 images it would take, oh I dunno… three years???

Frell that for a joke! After five mins scouring google I didn’t find a quick and easy solution, so whipped up a quick php script to enable simple find/replace on file names in a directory, opened up trusty CMD, typed in

findReplaceName * ” (!downloaded from precariouspanther.net!)” “”

and within 2 minutes all the work is done. I used to use perl for my shell scripting in linux all the time on the web servers, but given I’m coding php all day every day (and setting up perl on windows is annoying) this worked out much much better for me.

Read the rest of this entry »

01 5th, 2008

Lightboxes Fixed!

Author: Panther

Had a chance today to throw together a quick Wordpress plugin to fix the trouble I was having with the hotlinked (from Blogger) images auto-uploaded from my mobile phone.It automatically caches ALL hotlinked images locally, no matter what kind of tag references them - even if its a link. Dumps cached images into a pantherCache folder within your uploads directory.
Caching occurs when the post is being saved so that your blog doesn’t lag up :)

Anyway for anybody who wants it, the link is below. Its very unsupported though so be gentle with it.

Panther Auto-Cacher for Wordpress


precariousPanther Web Blog is proudly powered by WordPress