Josh (the blog)

I’ve delivered simple, clear and easy-to-use services for 20 years, for startups, scaleups and government. I write about the nerdy bits here.


@joahua

To do: Learn JavaScript properly

I read an article today on using JavaScript for image previewing without any extra markup, and was, needless to say, suitably impressed. And slightly scared that if I were locked in a room with a computer and no access to the Internet, I couldn’t possibly write something like that. I can hack bits of JavaScript together and come out with something that works (heaven help anyone who has to comprehend it or, worse still, subsequently extend it), but it probably isn’t Doing Things Properly — ironic, because Doing Things Properly is what the whole CSS/(X)HTML web standards groupies thing is about. I’m vaguely ashamed that I can be passionate about presentation and content but completely fail to “get” the behaviour layer of things.

As AJAX becomes more prevalent, there’s less and less excuse (or scope, whilst remaining in the industry!) for failing to comprehend these things. And that scares me a little, whilst being incredibly exciting.

The wonders of floats

I know this has been done before, but I haven’t personally tried making a layout that works like this. Actually, it’s not even quite a layout. Just a well presented list of thumbnails.

You’ll note that the layout looks, at first glance, suspiciously as though it were done in a table. It’s not. Pure list there. Want to see something cool? Resize your window and watch as “columns” appear to add and disappear depending on how much space you’ve got. Haven’t got a massive screen? Firefox users can hold down control and spin their mouse wheel and watch the columns change before their eyes!

Ah, the many magical powers of CSS.

Change JPG quality in a shell

Yeah, so I’m posting the dregs of what I’m learning for another project here. Deal with it! I was rather proud of this little gem, not because it’s amazingly complicated, but just because it saves me so much time and bandwidth (think download, process locally using GUI tools, re-upload).

mogrify -geometry 700x525\> -quality 85 -unsharp 1x1 *.JPG

YMMV with the *.JPG bit… obviously will need changing. This whole thing depends on ImageMagick being installed… but it will be on most platforms (By platforms, I mean real operating systems where you don’t need a graphical display to pull these things off! *puts on seedy hardcore chain smoking Unix geek voice* “I do typesetting and print design from the console, man.”), I’d imagine.

Blog and run

Do I stay and write this blog article, or run for my life?

Hehehe, good stuff!

Distractions

Yes, I haven’t been posting as much in the last few days. Between the end of school, the revue, a valedictory service, the formal (and briefly, the afterparty), and setting up a website to house content from all of the above, I haven’t had massive amounts of spare time.

Despite all that, I have no intention of posting about it all here. I figure the various photos say enough…