Alternating row colors and adding hover with javascript

December 16th, 2006; 915 views

Keeping in my do-it-all-with-javascript theme, here’s something else I created in order to keep the javascript completely separate from the HTML from the more javascript stuff.

It was originally created for the purposes of adding the hover onmouseover, but I also decided to add the alternating row color at the same time.

To be completely anal, I’ll note that the hover is something that should be done with javascript (it pretty much has to be done in javascript anyways, and it’s less part of the presentation than an action), while the alternating colors should be purely CSS.

However, this makes page creation easier. I also remember having some problems with reading the background color style from the row object, so this makes it easy.
Read the rest of this entry »

automatic, more semantic image hovering

December 13th, 2006; 480 views

I can’t stand editing pages with those hard-coded, god-forsaken [img onmouseout=”MM_replace(…);” onmouseover=”MM_Replace(…)” … ] tags. I don’t mind throwing a little javascript into the midst of my HTML document, but that’s just excessive, and entirely too static, too. Making an image hover should not be that difficult.

So I came up with this quick hack that should probably be fleshed out a lot more. Basically, you set up the image as you normally would, but give it a special class and a sort-of special name. Once the page is loaded, javascript looks through for all images with that class, uses the .src to figure out the name of the hovered version, preloads it (for caching), and attaches the requisite onmouseover and onmouseout events.

Read the rest of this entry »

Decrypt (crack) Encrypted disk image (dmg) files

December 13th, 2006; 9258 views

I set myself up with encrypted sparseimage file a few weeks ago (as an alternative to filevault). Because this was supposed to be super-secure, I created a brand new password based marginally upon my standard password. I subsequently forgot this new password.

I was lucky, though, because I remembered what I would have done to this password (preface, postfix, letters -> numbers, etc). It ended up being few enough permutations to be reasonable but too many to try manually.

Basically, I just set up some arrays for the positions which may differ. I loop through these arrays, concatenate together a password, and try it. Everything is written to the terminal, so you just look for the entry with the very obvious success message.

If you’re in a similar situation, you can modify the following script to crack your dmg file.

Read the rest of this entry »

Introduction

December 13th, 2006; 429 views

I resisted for as long as possible.

However, this blog is different… really. This isn’t borne from a need to rant, but a need to share (see). Specifically (at least for now), it’s code snippets and the like from my development exercises.