Posts Tagged “Ruby”

Well, after about 5 hours of hacking, I got a ruby script together to migrate all my data from Typo 4.11 to WordPress, so the site is back from the dead, and now running on an engine that DreamHost is actually happy with.

Update: The conversion script is now available here or at GitHub.

Comments No Comments »

Haml is a new markup format for Ruby on Rails apps that just hit 1.0. At first glance it looks pretty odd, but it turns out to be really easy to write in, and it’s shorter and, actually, easier to read than the equivalent eRB.

I think I’m going to convert Typo to use Haml for all its templates. I already did Azure’s layout file and it was pretty simple.

Comments 2 Comments »

Typo 4.0 is out! Many thanks to Scott Laird for his wonderful work on Akismet support and the new gem installer.

Comments No Comments »

Well, it looks like we’re almost at the 4.0 milestone for Typo. Tonight I knocked off 7 tickets (a couple just got re-categorized, but others got fixed/closed). Now there’s just 1 left, and it’s slaird’s responsibility. Unfortunately I have no idea what the time frame is on finishing it.

In any case, I’ll be pushing to get 4.0 out the door as soon as possible.

BTW, anybody currently on trunk and Rails 1.1, I highly encourage you to upgrade to HEAD. Why? Because I squelched the exceedingly verbose logging of sidebar rendering (in a quick test, a single sidebar rendered on the front page shoved 70k into the log file). It’s a fairly ugly hack, but it’ll save you from having to wipe your logs every week.

Comments No Comments »

Well, Rails 1.1 is out now. And that is a problem for Typo. See, when we tried running it under Rails 1.1rc1 we discovered that this new version of Rails has certain problems with components. Basically, Rails isn’t setting up the component namespaces that we’re expecting it to. I guess this is what I’ll be spending tomorrow evening hammering on.

Update: As of 10:57 AM this morning, Typo trunk now supports Rails 1.1 (and should work with Rails 1.0 too).

Comments No Comments »

After a couple hours of hacking I managed to come up with a ruby script that generated a GraphViz dot file that describes all of the Universal Type Identifiers on the system. I’ll release it later once I make it a bit more usable, but right now I have a dot file to hand out. If you don’t have GraphViz installed you can download the dmg, or you can use OmniGraffle. Just open up the file in Graphviz.app or OmniGraffle.app - note however, that OmniGraffle seems to screw up the border and widths of all the nodes, so if you don’t have a registered version (and thus cannot edit the file), you should stick with Graphviz.

Download: utigraph.zip

Comments No Comments »

Just a quick post about AJAX on Rails, to test out my latest feature, which is Lightbox support for Typo:

If you click that and it doesn’t overlay the image on top of the current page, then you’ve run into a bug in Safari that I’m trying to figure out the cause of. Grrrrr. The bug has been worked around.

Comments No Comments »

Inspired by a script mentioned on ranchero.com, I wrote a ruby script that generates an RSS feed for all the Crash Reporter logs on your machine. Just create a New Special Subscription in NetNewsWire, point it at the script, and you’re all set.

Comments 10 Comments »

So why has been talking about MouseHole lately. If you’re unaware, MouseHole is a ruby script that acts as a web proxy and filters HTML documents via ruby scripts. Or for a much better look at it, go look at what why wrote.

Anyway, I wanted a way to do JavaScript cross-site AJAX tricks, like what Greasemonkey enables. Unfortunately, because MouseHole is a pre-processor, not a JavaScript extension, it’s not possible. So I spent a few hours and wrote a way for MouseHole scripts to provide content that doesn’t actually exist (as opposed to mutating existing content). This way JavaScript can do an AJAX call within the same domain (so it doesn’t hit the security limitations) but that call is intercepted by your script, so you could pull info from other sites and send it back, or whatever you wish.

I haven’t actually done anything with this new capability yet aside from a rather silly example script which simply adds a button to Google that asks MouseHole for a random number. I’d really like to extend Google Maps, but that will require delving into how it works, and it’s far too late to do that now, as I need to get to bed.

Anyhow, I put together a patch and sent it to the MouseHole Scripters mailing list. If you check out MouseHole from the CVS repository, you can apply my patch and test it. Or you can just wait to see if it gets added to MouseHole.

Comments No Comments »

I ran across a link on SvN to an interesting logic puzzle called Whose Fish?. It purports to be a logic puzzle created by Albert Einstein, and claims Einstein said 98% of the population would not be able to solve it. So naturally, I was intrigued.

The only problem was, the logic matrix for the puzzle doesn’t fit on a single piece of paper, and I don’t have Excel installed. So what did I do? I wrote a CGI script in Ruby that generated a logic matrix using a table of checkboxes, and I wrote some accompanying JavaScript to make it easier to use. Go try it!

If you don’t want to solve the puzzle yourself, feel free to check out some of my steps. Just please, don’t submit this as your own answer. If you’re going to submit an answer, do the work yourself. So anyway, here are some of my steps:

  1. Step
  2. Step
  3. Step
  4. Step
  5. Step
  6. Step
  7. Step
  8. Step
  9. Step

And here’s the final solution.

Comments No Comments »