MPOV

occasional posts about programming, tech, and the dreaded etcetera 

CampaignMonitor API Wrapper

First of all, HTTParty is simply amazing. That is all.

Second, Ruby never ceases to amaze me regarding its power and tools for meta-programming. "method_missing" is just too cool.

Third, I created a 20-line wrapper class for the Campaign Monitor API this weekend (using HTTParty). The code and the gem is over on GitHub: http://github.com/seven1m/campaign_monitor.

Comments [0]

CascadingRubies - Ruby DSL for generating CSS

I've been working on a little experiment lately... a Ruby domain-specific language for generating Cascading Style Sheets called CascadingRubies. It's an internal DSL, meaning it uses plain Ruby syntax, like this:
Output:
Being just Ruby, of course, you can mix in variables, arithmetic, require external code, hit the database, or whatever. The guys on the Tulsa.rb mailing list have provided some great feedback, and from that I've released the the second gem version (0.2.0). If this looks interesting to you, head over to the GitHub project and check it out. Please let me know what you think.

Comments [0]

Install the Ruby gem "dnssd" on Ubuntu

sudo aptitude install libavahi-compat-libdnssd-dev
sudo gem install technomancy-dnssd -s http://gems.github.com
irb
> require 'rubygems'
> require 'dnssd'

Comments [0]

ShrinkSafe with Prototype 1.6

I didn't find this information anywhere, so here it is for the Google archives... To get Prototype to run after squeezing it through ShrinkSafe, you need to put back every instance of the variable $super. ShrinkSafe replaces variable names with shortened versions, and because of some Prototype voodoo, it breaks on this one name. There are about 8 places you'll find it, and unfortunately, it takes some manual hunting once ShrinkSafe has changed a bunch of names, but there you have it. I suppose someone smarter than I could tweak ShrinkSafe to ignore this variable name, but for me, this works.

Comments [0]

Ditch Pagination

I build web apps. Almost every one has a screen or two somewhere that shows a listing, and at the bottom it has pagination links, e.g. next page, page 3, etc. For a recent app I've been working on, the interface is very search-driven, i.e. the user enters some criteria the results are displayed. As an experiment, I left off the pagination links. In this app, there is no "next page." Instead, if the results are not on the first page, then the user must refine their search. If you think about it, how often do you scroll through a Google search results page and then choose to change your search query rather than click on the next page? If you're like me, a lot. Even if you do click the next page, I would bet you don't click much past page 2. For users who see the Web and web apps as a necessary evil, they might be more apt to page through thousands of results rather than think about what they're looking for and change the query. Ditching the pagination links lights up a different part of the brain I would guess (of course I have no idea considering I am only a web geek). What do you think? Am I evil? Can it work? By the way, I haven't had any complaints yet. We'll see...

Comments [0]

SliceHost Affiliate Link

Just posting this for any friends getting ready to sign up for a SliceHost account. This my referral link - I get a discount on my slices if you use this. Help a poor developer, please.

https://manage.slicehost.com/customers/new?referrer=198350528

Comments [0]

Tulsa Ruby Workshop

Comments [0]

OneBody: Using Git

I still plan on writing the final part in the Git series on this blog, but in the meantime, on a related note, we now have a page up on the OneBody wiki about Using Git. It includes some instructions for using Git on Windows and some other commands that may be helpful to noobs.

Comments [0]

FireFox 3 Beta

Oooo I really like the new Firefox 3 beta. It's zippy and it looks great.
My only beef was the new fancy address bar... Being an uber web geek, I tend to recognize things by their URLs instead of page titles, so this was slowing me down to much:
So, to get things back all barebones FF2 style, I installed this and set browser.urlbar.matchOnlyTyped in about:config to true. Much better.

Comments [0]

Rails Routes Weirdness

Just to save you a half-hour of your life, I thought I'd share that you should never create a named route called "directory" -- it will break Rails migrations and other rake tasks in mysterious and hard-to-track-down ways.

Comments [0]