Gutter r135 Is Out

As a hack a while back, I put together a Twitter client, Gutter, written in Shoes for Ruby. Well, a lot has happened since my last release, so here it is again:

What’s new?

  • Ignoring people (anti-social networking)
  • Filtering out posts by regular expression (Thanks, Josh Davison!)
  • Theming support
  • Built-in Twitpic viewing

Along with everything else amazing it does.

I’m not going to lie. The settings screen looks like hell. Really, it’s atrocious. It works though, but you’re not going to like it.

Anyway, I hope you like it. Send me a message with comments, concerns, ideas, whatnots.

Download Gutter

Inquisition Cleanses the Taint from your Strings

There are a couple of really great options for protecting against XSS-style attacks in Ruby on Rails. Acts_as_sanitized is pretty great, but it uses the Rails Sanitizer, which isn’t perfect.

XSS-Terminate has an awesome built-in HTML5 sanitizer, but xss-terminate automatically tries to clean every field on every model, which is a bit much for my needs.

But now, you have Inquisition. Inquisition is easy enough:

  class Post < ActiveRecord::Base
    cleanse_attr :title, :body
    cleanse_attr_writer :email
    cleanse_attr_reader :author
  end

  class PostTest < ActiveSupport::TestCase
    should_sanitize_attributes :title, body
    should_sanitize_attribute_writers :email
    should_sanitize_attribute_readers :author
  end

That is it. Installation is great too:

  gem sources -a http://gems.github.com
  gem install thumblemonks-inquisition

If you’re using rails and you want the shoulda macros, you’ll have to freeze the gem.

So, there you have it. Inquisition uses the same html5lib_sanitize from xss-terminate, so you get the best protection against even somewhat-invalid html. It also doesn’t assume you want everything sanitized everywhere.

I hope you like it. If you’re wondering about the name, Inquisition removes the heresy and taint from your strings.

Art and Code 2009

This weekend, I travelled with Evan of OpenSprints.org and JonP to Art and Code. The experience, overall, was fantastic. We had an opportunity to sit through two classes with the venerable _why of such internet fame.

Why’s online persona completely matches his in-person persona. It was incredibly refreshing to walk into a class at 10AM on a Saturday and have it begin to the sound of an autoharp, listening with people from the age of eight and up. Installing and using HacketyHack was a breeze, of course.

Shoes, the liquified horse that powers HacketyHack, has brought complete joy to my hacking experience and allowed Evan and I to crank out what used to be multi-month learning curves of graphical kits, to a multi-hour hacking session. _why certainly solved the problem of graphical toolkits, fulfilling all of the points of The Little Coder’s Predicament.

Art and Code itself was an interesting crowd compared to most programming events. It avoids the hoo-ha, boasts a $25 entry fee, and allows all sorts of people to enjoy it, as I said above, people from the age of 8 to 60, male and female, artist and programmer.

The best part of the conference was the tiny crowd. It was to talk to an excellent group of people who seem to understand that programming is hacking, and hacking is art.

Many “enterprise” software engineers will argue you to no end about how you are doing it wrong. How do they know what I am doing, anyway?

Here’s an example:

This gives you, of course:

Ok, maybe this isn’t simple enough for a child, but it’s certainly something that could be achieved within a week or two. We’re not talking shopping carts and Flash here, we’re talking everything from Commodore to Processing as possible.

Meanwhile, you should be awaiting the release of Hackety Hack and the next Shoes. It brings out the kid in you. The kid that powers the hacker, who will make a singing game of bears dancing and attacking you, helicopters that shoot down dinosaurs, or talking to aliens that are trying to kidnap all of the good meatloafs. HacketyHack is a tool for hacks, in the most beautiful and exciting sense.

I want to go into some of the awesome features of Hackety Hack this week, right there on your laptop on your lap.

Also, check out some of the photos at my flickr set, as well as Jon’s flickr. These are really more for us, but hopefully it will inspire more to seek Potatchos.

Welcome the Twitter Rails Exception Notifier

So you’re probably looking for some visibility into your exceptions in Ruby on Rails. Sure, everyone is. There are some great things out there, like hoptoad, that we use and are fantastic.

Really, it’s great enterprise software. I, for one, do enterprise software development for a living. It’s circumstance, sure, not necessarily a passion. I am not a huge fan of the codebase of our app. Still, the app itself kind of takes on a personality over time.

Combined with similar feelings from annealer and V, we give you TwitterShitter:

module TwitterShitter
  def self.included(base)
    if base.instance_methods.include?("rescue_action_in_public")
      base.module_eval { alias_method_chain :rescue_action_in_public, :twitter }
    end
  end

  def rescue_action_in_public_with_twitter(exception)
    Bed.crap
    rescue_action_in_public_without_twitter(exception)
  end

  class Bed
    require "httparty"
    include HTTParty
    format :json
    base_uri 'twitter.com'

    def self.crap
      query = {:status => "EXCEPTION TIME: Oh man. I just crapped the bed.", :source => "TwitterShitter"}
      credentials = {:username => "", :password => ""}
      post('/statuses/update.json', :query => query, :basic_auth => credentials)
    end
  end
end

Go ahead and include TwitterShitter in your base controller, and add your username and password to the file. It will notify every time you get a non-local exception (see rails’ local_request?).

Succinct, no? Sure the HTTParty is entirely excessive, you may as well just use Net::HTTP, but I like plugging HTTParty wherever I can.

Try Gutter r111

GOOD NEWS!

There’s a new release of Gutter, your favorite twitter client. This release is revision 111, so give it a shot. Here are some new things:

Installation is easy for Mac/Windows/Linux:

  1. Download Shoes for your platform
  2. Download the latest Gutter
  3. Double click Shoes and then open gutter-111.shy!

Alternatively, there is a one-click-installer for Linux (Mac and Windows one-click coming soon!): Linux One-Click

As always, please send me bugs and feature requests.

Learn C To Understand Ruby

My learn-C-to-understand-ruby project is working out fantastically. Thanks to great amounts of help from things like the Ruby Hacker’s Guide, hacking in Shoes, and Programming Ruby, I have learned a fantastic amount about the “why” and “how” of ruby. I think I will expand my project to include, later, learn-Smalltalk-to-understand-ruby.

I highly recommend it, and will begin posting interesting things that I have picked up along the way.

Gutter88 Is Out

There is a new version of your favorite shoes twitter client,
Gutter! Not a whole lot has changed, but
importantly, there is an interface for logging in with another account.
Also, login failures are handeled much nicer now.

So, enjoy:

Gutter-88

Gutter Is Easy

Thanks to an awesome feature in Shoes, installing Gutter is only a three step process now:

  1. Download Shoes from shoooes.net
  2. Download Gutter
  3. Open Shoes, and pick out gutter-83.shy!

This should get rid of the trouble getting started with Gutter.

Shoes In The Gutter

A while ago I began messing with Shoes. Shoes is an excellent, tiny graphics
toolkit. Learn something about it at
Shoooes.net/about.

Anyway, Gutter was designed as a quick hack to make a decent twitter client
for linux, mac, and windows (maybe).

Gutter

So, it’s basic and a hack, but check out the code, and give it a shot. Lemme
know what you really want to happen in it, and I will try to make it happen.

To try it out:

  • Firstly, go to http://shoooes.net and get Shoes for your platform.
  • Then checkout the code from github.com at:
    • http://github.com/toothrot/gutter/tree/master
    • If you do not have git, do not worry! Simply click the download button on github.
  • Then, start Shoes, open up gutter.rb from wherever you put the code, and enjoy.

Please, let me know what features you want. Here’s what I’m planning:

I can’t think of what else a twitter client needs, so let me know.

Short

The rights of women and the poor have been ignored long enough. If you think otherwise, you’re wrong.