Monthly Archive for May, 2008

Twitter Updates for 2008-05-27

  • @ameliorator That’s an Operation Ivy song. Not that it really matters. :) #

Twitter Updates for 2008-05-26

  • is making lentil soup at Beard-nard’s. #

YUI TreeView with Ruby on Rails

Here’s some code I’m using to generate a dynamic tree view using an acts_as_tree model with slug and title fields, the TreeView widget from YUI, and a Rails helper. I chopped out some of the code for clarity, so all this does is create a menu with the titles from the model, but the basic idea is there to expand on.

Rails view/JavaScript

<script type="text/javascript">
  var page_tree;
  page_tree_init = function () {
    page_tree = new YAHOO.widget.TreeView('page_tree');
    var root = page_tree.getRoot();
    <% generate_page_nodes(@root) {} %>
    page_tree.draw();
  };
  page_tree_init();
</script>

Ruby

def generate_page_nodes(node, &block)
  parent = node.parent
  node_name = node.slug.gsub('-', '_')
  parent_node_name = parent.nil? ? 'root' : parent.slug.gsub('-', '_')
  js = <<-JS
    var #{node_name} = new YAHOO.widget.MenuNode('<span class="node_title">#{node.title}</span>',
                                                 #{parent_node_name});
  JS
  concat(js, block.binding)
  children = node.children
  children.each { |c| generate_page_nodes(c, &block) } unless children.empty?
end

Looking for a New Place to Live

I’m looking for a new place to live in Portland. I’ve been keeping an eye on craigslist, but thought I should try some other methods, so I’m posting this to see if anyone out there knows of anything. If anyone has other suggestions for finding an apartment in Portland, please let me know.

I’m looking for a place by myself that…

  • I can move into around June 1st,
  • I can stay for at least six months and preferably up to a year or more,
  • has one or more bedrooms,
  • is under $1,000 a month, including all utilities,
  • is in Southeast Portland within a mile of People’s,
  • is north of Powell and west of 39th,
  • has a yard for gardening,
  • allows cats (I have one).

This is what would be ideal, but I’m somewhat flexible. If you know of something that might be a good fit, please get in touch.

Twitter Updates for 2008-05-25

  • @ameliator That’s an Operation Ivy song. Not that it really matters. #
  • It’s storming in Portland. A real storm. With thunder and lightning. #
  • We saw the most amazing cloud formation today. The sun was behind it, and we could see sunbeams. Will post pics soon. #

Twitter Updates for 2008-05-24

  • hit Ground Kontrol, Sushiland, & Voodoo Donuts at PnP last night w/ B, C, & Pete. #
  • played Gauntlet for what seemed like hours at Ground Kontrol. Felt a bit tripped out after. #
  • picked up his first pair of glasses yesterday. They really work! #
  • mm… cookies. #

Twitter Updates for 2008-05-23

  • is putting together a plan for the day that includes updating resume, writing some code, and looking for a new place to live. #
  • @ameliorator I did just move, but it was a temporary situation w/ another person. I’m looking to get a place by myself. #

Twitter Updates for 2008-05-22

  • is at Backspace w/ Michael (@itsaoof) catching up on email before meeting w/ Ace Hotel re new website. #

Twitter Updates for 2008-05-21

  • is meeting w/ SMC about byCycle. #

Twitter Updates for 2008-05-20

  • went to Hagg Lake yesterday, swam (in surprisingly not-too-cold water), engaged in interesting conversation, and juggled. #
  • had mm mm tasty (vegan) sushi for dinner yesterday; ate it in the hot tub. #
  • collaboratively pondered many options for the future today. #
  • got a late start on work today, but managed to put in about four good hours on the new AceHotel.com site. #
  • is of the opinion that Lincoln is a much nicer bike boulevard than Clinton. #
  • really enjoys solitary bike rides home (which is not to say that he doesn’t also enjoy non-solitary rides home). #