I’m rather fond of the e text-editor. Coming from TextMate, e presents a familar environment for Windows users. The one beef I had though was the inability to configure keyboard shortcuts. Specifically, I felt Ctrl+G should be “Find Next”, like it is in so many other programs, instead of “Go to Line”.
I tried a few other editors, but they all annoyed me to no end. Habits, familiarity, and all that. So rather than wait for e to add it’s own configurable keyboard shortcuts or muck around the in source code (brief aside: the availability of the source code actually makes me pretty happy — it means I can compile an alternative to vim / emacs on *nix that I actually like), I decided to use AutoHotKey.
In short, AutoHotKey lets you write scripts that remap keyboard shortcuts as you see fit. Some (minor) programming ability required and the documentation is a little convoluted, but it still beats all the alternatives. My e remapping below the fold.
More … Currently watching various media personalities pick Jonathan Zittrain’s brain regarding Twitter in Iran. While Twitter has definitely had a powerful impact here, I’m not sure that impact is what people think it is. As I understand it, the main effect of Twitter (and while we’re at it, YouTube, Facebook, blogs, etc. — which I’m going to sum up as TLT — things like Twitter) is to provide semi-real-time communication stream between Iranians and the outside world and between Iranians themselves.
But what exactly does that communication enable?
More … For some reason, the current version of MySQL defaults to using the latin1 encoding. I needed to get Unicode support with UTF-8 encoding working a little while ago, so I might as well write down what to do. It’s pretty simple.
Go edit your my.cnf file (mine was located in /etc/mysql/my.cnf).
At the end of the [client] section, add this :
default-character-set = utf8
At the end of the [mysqld] section, add this:
character-set-server = utf8
And then restart MySQL — e.g. sudo /etc/init.d/mysql restart
After this, any NEW MySQL tables you create should automatically default to using UTF-8 in queries.
I lost my iPhone a few days ago. When I was a kid, I often brought a book with me when eating by myself, so I’d have something to do while eating besides … um … eating. The book’s been replaced by my phone though (take that Kindle!), so going to to lunch without it just felt plain weird.
So let me be the first (or second or third or whatever) to extol the awesomeness of the iPhone. I used to have a Windows Mobile Tilt / TyTn2, and the iPhone 3G is hands-down superior. That said, I do have three very large annoyances.
More … Posted my first Django snippet! This concerns a quick and dirty hack for getting composite indexing in MySQL. It’s also a simple example of how to use Django’s post_syncdb signal.
Django currently comes with a unique_together meta attribute you can use to specify unique combinations of fields. I think the backends create an index in the database from this. However, I couldn’t find anything for simply creating non-unique attributes, hence the hack you see in the snippet.
I don’t really have the patience to make it work fully for the other backends since I don’t use them currently (aside from SQLite3 for testing), but it’s GoodEnoughForMe.