Changing the Get Satisfaction widget tab text

We recently added the Get Satisfaction widget to an app, and it was darn easy (we used the overlay widget). It allows you to customize the location and the background color of the tab, but not the text (the default is ‘Feedback’). The customer wanted the text to be ‘Support’, so I thought I’d share the solution with you in case you want to make the same change.

The tab uses a background image for the text, so I grabbed a copy and changed the text (its on a grey background div here so you can see it, since its white text with a transparent background):

support_trans_tab

and here is the css to apply it (the body in the selector makes it more specific to override the rule from Get Satisfaction’s style; alternatively, you can use !important on the rule):

body a#fdbk_tab {
    background-image: url(/path/to/support_trans_tab.png);
}

script_finder gem

I recently published a ruby gem on github that simplifies running scripts from a script/ dir from anywhere in your project (rails or otherwise).

script_finder provides a script (called s@) in your path that searches in and up from the current dir for a folder (default: @script/) containing an executable file uniquely identified by the a prefix given as the first argument. It then calls that executable, passing the rest of the arguments to the called executable. If the given prefix is ambiguous, the script suggests unique prefixes.

Examples (in a rails app):

~/rails_app/app/views$ s c
--> calling '/Users/tobias/rails_app/script/console'
Loading development environment (Rails 2.1.0)
RowsLogger plugin enables mysql
>> exit
~/rails_app/app/views$ s r 'some ruby'
's r' was too ambiguous. Try:
's ru' for 'script/runner'
's re' for 'script/remote'
~/rails_app/app/views$ s ru 'some ruby'
--> calling '/Users/tobias/rails_app/script/runner some ruby'
...

The gem is not rails specific – out of the box it will work with any project that has a script/ directory. If you want to make your own version of the s@ script that looks for executables in a different dir (I would save this one as @c):

  #!/usr/bin/env ruby
 
require 'script_finder'
 
# looks for executables in a commands/ dir instead of script/.
ScriptFinder.find_and_execute(ARGV, 'commands')

Let me know if you have any problems/questions.

method_missing tip

When using ruby’s method_missing, don’t alter the method parameter before calling super (you are calling super, aren’t you?). Otherwise, you will get a very clear exception:

  ArgumentError: no id given

Thanks to google and Nicholas Schlueter for the tip.

Presentation Tools

Last night, I gave my first presentation in a really long time. It went really well! (I used to have a terrible fear of public speaking, so much so that I changed majors in college to avoid having to take a public speaking class (I switched back, because I realized I was being foolish. I’m glad I did, because I met a nice lady (we went out once, and it was the worst date of my life; but I digress))). The presentation was on Haml & Sass, and is available on github if you are interested.

But this post isn’t about the presentation, but about the tools I used to build/show it. I spent some time trying to get colorized code samples in to Keynote ’09, but did not have much luck. After a little bit of research, I found Dave Thomas’ codex, an html based presentation builder that uses the s5 javascript presentation tool. Codex allows you to reference code files or embed code snippets, which will be pulled in during the build process and wrapped in a SyntaxHighlighted div. It processes ‘slide’ files and creates one html page containing the entire presentation. I modified it a bit for this presentation to add support for adding text to the previous slide, and included all of the available SyntaxHighlighter language modules in the output. The modified version is here.

To display the presentation, I created a Fluid app, set it to me chromeless, and made it draggable from anywhere. I then installed iRed Lite, which allows you to send keystrokes to any app using the Apple infrared remote. Once that was all in place, I hooked up the projector, dragged the Fluid app to the projected display, and gave the presentation.

Starting a new project

Back in May of 2008 I got involved in a new project. The client and I had some really fun collaboration sessions to get things started, but then I had to do the inevitable ‘sit and wait’ while the project worked its way through the machinery of the organization. The first couple of months there was some small doubt about the project coming together, but it has been a sure thing since then. I did what I could to prepare for getting down to work, but there is only so much you can do ahead of time.

This past Thursday (the 19th) we got together early for the kick-off meeting. It was an intense session with the client, where I mostly watched, listened, and encouraged. But toward the end of the meeting, the project was delivered in to my waiting hands. This looks to be a long term collaboration with the client, and I plan to use every trick I know (agile or otherwise) to make this successful! I’m still getting to know this project, and like any interesting job, it will certainly be a learning experience. I currently have another similar long term project with this particular client, but every one is different!

I plan to occasionally update this blog with the status of both projects. The client and I whiteboarded a bit of code to capture some metadata about the project as we see it currently:

family.children << Child.new( :name => 'Leif Everett Crawley',
                              :gender => :male,
                              :weight => 8.pounds + 14.ounces,
                              :height => 20.5.inches,
                              :born_at => 'Thu Feb 19 09:36:19 EST 2009',
                              :birth_location => :home )

177-7746_img

So far, things are going great! But projects like this are always easier at the beginning, the hard work comes much later!