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.
Update on the Vim Switch
Well, it’s been almost two weeks now, and the vimming continues unabated. So far, I have to say, I’m pretty happy with the change. The simple fact that I can run it in a screen session without feeling crippled has been wonderful, particularly since I’ve been frequently moving my editing sessions between work and home lately (all I need to do is ssh in, and do a ‘screen -DR’, and voila, my work environment is migrated over).
As for the RSI, other than the usual stiffness from long periods of typing, the other symptoms (things like shooting pains in the hands) have been reduced or eliminated, proving once more that emacs finger is real and dangerous! And yes, I realize that I could’ve just swapped my capslock and control keys, but I use my capslock as a third modifier, so that doesn’t work as nicely for me. :)
Meanwhile, my vocabulary of vi commands continues to expand. My biggest problem is simply remembering to use vi/vim shortcut keys and commands instead of doing things manually. This is especially a problem for me since I’m a fast enough typist that I’ll often resort to brute forcing things, rather than trying to be speedy and clever. Thing likes Ctrl+n for completion while coding is incredibly convenient, and a significant timesaver, assuming I’m smart enough to remember to use it. And being able to type things like ‘ct;
' is really darn handy, when I don't accidentally find myself typing 'xxxxxxxxxxi ' by mistake. But, given time, I suspect I'll internalize more of the commands and my editing speed will continue to increase. So, the moral of the story is that it looks like Vim has a new convert! I have officially switched sides in the infamous Editor_war.
Well Worn Ruts
So, the text editor adventure continues. It’s funny, for a long time now coding has lost some of it’s fascination. This is probably at least in part because I’ve been doing it for… 12 years now. Jebus. Thus, I’ve found myself in a bit of a rut. But now I actually find myself looking for reasons to code, if anything to give me an excuse to further explore the power of Vim. Go figure.
‘course, the real question is, what do I work on with my shiny new editor? I could work on, like, work, but that seems wrong somehow. Work on my off-time? How is that a good idea? I could try to come up with a project of my own, but I’m largely tapped out for ideas right now. Or I could continue to try and hack away with POV-Ray… though I’m hardly artistically talented. It’s a bit of a quandry.
What I should really do is see if there’s a script for Vim to publish to a wiki. And should I be unable to find one, maybe I should try to hack one up myself! Hmm… I see a project brewing…
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 ':')?