Blog posts tagged "typo"
I use Rails’ database session backend for LM. (for login, as well as “flash”) Without any sort of built in garbage collection the sessions table gets very large, very quickly. Beyond aesthetic issues, this can also cause MySQL’s key buffer to fill up. (which on Debian is by default set quite low)
So I wrote up a quick flush method, and saved it in a file
class CGI::Session::ActiveRecordStore::Session def self.flush_old_empty_sessions self.delete_all "DATE_SUB(NOW(),INTERVAL 6 HOUR) > updated_at and BIT_LENGTH(data) <= 688" end end
This says nuke all sessions which are over 6 hours old, and which are empty. (688 is the length of the serialized session with an empty flash)
MySQL specific, and susceptible to changes in either session structure or its serialization. But it was quick and easy and worked for me.
Then you simply need a cron job like:
ruby script/runner 'CGI::Session::ActiveRecordStore::Session.flush_old_empty_sessions'
Comments should now properly refresh on Firefox 1.5rc2 (also fixed for any other browser that was deciding that
$('commentList').lastChild means the smattering of whitespace between a closing
</li> and the closing
Also turned off the html filtering for comments which was acting as a “make ugly” flag. (BlueCloth seems to be finicky and difficult compared to Markdown implementations I’ve used before, and RedCloth claims to do Markdown, but didn’t when I tested it)
One of my key goals when moving Laughing Meme over to Typo was not to break the nearly 4 years of accumulated URLs. This involved some tweaking of Typo’s importer script to maintain my old
ids1, and some routes tweaking. So far so good.
But what about the pieces of the site not maintained by MT, pieces that expect to be handled by Apache, not dispatch.fcgi? For that ProxyPass if you friend. It isn’t a sweeping solution, but as I bring pieces of the site online that use PHP, server side includes, or just DirectoryIndex, I’m using ProxyPass to re-route the URLs before they fall into the Rails’ event horizon. Works great.
1. Actually, was a bit more complicated them that, as I combined several MT blogs (LM, MLPs, Work, etc) into one, so I let the importer create a
id, but also hang onto the MT id in a new column
And while a number of things are still broken, I feel like its starting to take shape, and Typo/Rails as an infinitely hackable framework gives me the chance to play with ideas I’ve been mulling over for a while, on how to present and reference the growing archives we all have. (only the skeleton of which is yet showing)
update: Comments fixed, again. (thanks Ruby for the heads up)
update2: My CSS-fu isn’t up to it (or perhaps my concentration is just shot right now), but the original artistic vision called for the magpie to float behind the MLPs. (ideally blurred slightly by a translucency) Anyone able to help?
Been meaning to upgrade for forever, but comment spam finally pushed it to critical early this week. And there went my Sunday.
Not Seeing Eye to Eye with WordPress
WordPress was my first choice. I’ve tried upgrading to WP for a few times, but each times I try I get stymied. WP just isn’t flexible enough out of the box and the code is badly in need of refactoring. Might just be an impedance mismatch between me and WP.
Typo, Up On a Too High Pedestal
Next up was Typo. Now I know there is a codebase that is poetry, Typo is the gold standard of Rails apps, and I’ve referred to it when coding my own Rails apps.
Unfortunately when I checked on
#typo, the recommended upgrade path from MT2.x was via MT3.x, and it doesn’t use the MT’s import/export feature, but rather direct database manipulation.
Moveable Type 3, the Sound of Settling
So now I’ve got a running MT3 install, and I think I’m just going to stay here, at least for tonight. I am struck again how much polish 6A puts into their apps. Bayesian comment filtering looks promising, Brad’s tagging implementation looks promsing, and I’ve always liked MT’s DSL for templates. (that said I’m currently missing the flexibilty of ERB + layouts)
Not sure I’m going to stay there, but I’m staying there for tonight, as I’m tired.