Posts in category 'hacking'

  • The Gallery Cometh

    I decided to take a tour through my collection of digital camera photos and was, frankly, surprised at how much stuff I had. Worse, none of it was terribly accessible nor shareable. And so I finally cracked and decided it was time to get some kind of photo gallery going on.

    Now, I could have one with Gallery, which Brad has used to power his photo gallery, but I really wanted something that would integrate directly into my wiki, so that I could easily incorporate gallery photos into wiki pages, comment on them in the normal fashion, etc, etc. Unfortunately, nothing of the sort really exists for Oddmuse, meaning it was time to roll my own.

    The result is my Gallery. It’s pretty bare bones, at this point… really, it’s just functional enough to be useful. It can:

    • Add galleries and images through a standard web interface.
    • Support infinite nesting of galleries.
    • Handle zips and tarballs, as well as standard image formats.
    • Does the usual pagination stuff, so you don’t get all gallery images at once.
    • Does on-demand scaling of images, so people can choose different resolutions.

    And all of this is done in the context of the standard wiki subsystems, so you can comment, search, etc (though search is b0rked for image captions and descriptions right now… that’s on my todo list).

    Anyway, there you have it. Take a look. Give me feedback if you like. And if I can make the code, you know, not horrible, I’ll release the source to it.

  • Masochism...

    So, with the announcement of Vim 7.0, the ridiculously confusing ying to Emacs’ fat, bloated yang, I’ve decided to take a break from my traditional editor, Emacs, and give Vi another go (with the help of a VIM Reference Card).

    Now, you might be asking yourself, “why oh why, dear god, would he do this to himself?!?” And, frankly, I have no good answer to that question. Toying with it, I have to admit that there seems to be a lot of power behind the incredibly esoteric Vi interface. To call it a programmers editor is an understatement… the various commands in Vi, together, compose a bewilderingly complex, difficult to understand programming language tailored specifically to interactive text editing. Moreover, the focus on the keyboard means less mouse use, resulting in less shoulder strain. And the fact that most of the commands are simple characters means no more Emacs-finger, due to reaching for the control key.

    And all this power comes in a deceptively slim package. The editor starts up blindingly fast, which means it’s great for small edits or larger tasks, unlike Emacs, which I tend to start up and just leave running. And the fact that it’s terminal based (it doesn’t open up a separate window) means I can run it inside of GNU Screen comfortably, thus allowing me to migrate work to and from the office easily by detaching and reattaching screen sessions.

    So, we’ll see how it goes. I’ve been spending my time hacking C code and writing POV-Ray scenes with it, and so far the experience has been positive. And I think there’s a certain zen to Vi commands that I’m slowly starting to grasp… an order in the chaos so to speak. And, hey, in reality, is ‘C-x C-s’ really that much easier than ‘:w' (especially after mapping 'jj' to and ';' to ':')?