Elsewhere: Tumblog / Twitter / MP3 Blog / Reader / Email

DRL Echobox

pretty much a feed dump these days.
follow me on Twitter

Saturday, December 31, 2005

meanwhile, on #prototype: 

[11:15am] jchris: i really would like a way to inspect objects to see what methods they have defined.
[11:15am] jchris: i think i'm spoiled by ruby
[11:17am] sam-: Object.methods = function(object) {var methods = []; for (slot in object) if (typeof object[slot] == 'function') methods.push(slot); return methods}
[11:18am] sam-: call like Object.methods(someObject)
[11:19am] jchris: thanks. I'll try it
[11:20am] jchris: awesome! all the methods just popped out.





HAPPPPPYYYYYY NEW YEAR, peeps!

Friday, December 23, 2005

oh no! Ruby action! 

Ok,
I've been sparing you all the details of my hot love for Ruby on Rails, but my Other Blog is down for maintence (I can't post to it right now, but you can read it) so you'll have to bear with me and my excitement.

If you find yourself spending to much time in irb staring at things like this:

"annotation"=>"Youll Be Mine", "position"=>"3", "created_at"=>"2005-12-11 16:59:11"}>, #nil, "artist"=>nil, "playlist_id"=>"1", "updated_at"=>"2005-12-11 16:59:12", "info_url"=>nil, "title"=>nil, "id"=>"5", "track_id"=>"5", "annotation"=>"You And I", "position"=>"4", "created_at"=>"2005-12-11 16:59:11"}>, #nil, "artist"=>nil, "playlist_id"=>"1", "updated_at"=>"2005-12-11 16:59:12", "info_url"=>nil, "title"=>nil, "id"=>"6", "track_id"=>"6", "annotation"=>"Johnny Wanna Live", "position"=>"5", "created_at"=>"2005-12-11 16:59:12"}>, #nil, "artist"=>nil, "playlist_id"=>"1", "updated_at"=>"2005-12-11 16:59:12", "info_url"=>nil, "title"=>nil, "id"=>"7", "track_id"=>"7", "annotation"=>"Innocent Love", "position"=>"6", "created_at"=>"2005-12-11 16:59:12"}>, #nil, "artist"=>nil, "playlist_id"=>"1", "updated_at"=>"2005-12-11 16:59:12", "info_url"=>nil, "title"=>nil, "id"=>"8", "track_id"=>"8", "annotation"=>"Celebrate Your Life", "position"=>"7", "created_at"=>"2005-12-11 16:59:12"}>, #nil, "artist"=>nil, "playlist_id"=>"1", "updated_at"=>"2005-12-11 16:59:12", "info_url"=>nil, "title"=>nil, "id"=>"9", "track_id"=>"9", "annotation"=>"Around My Heart", "position"=>"8", "created_at"=>"2005-12-11 16:59:12"}>, #nil, "artist"=>nil, "playlist_id"=>"1", "updated_at"=>"2005-12-11 16:59:13", "info_url"=>nil, "title"=>nil,

what you need is to open the terminal, type mate ~/.irbrc and paste the following in:

def py( thing = nil )
if thing.respond_to? 'to_yaml'
puts thing.to_yaml
else
puts thing
end
end

Now that you've done that, you can type "py my_object" and your object will get printed all pretty yaml style.


- !ruby/object:Track
attributes:
image_url:
artist:
playlist_id: "1"
updated_at: 2005-12-11 16:59:36
info_url:
title:
id: "84"
track_id: "84"
annotation: Alan Parsons Project
position: "83"
created_at: 2005-12-11 16:59:35
- !ruby/object:Track
attributes:
image_url:
artist:
playlist_id: "1"
updated_at: 2005-12-11 16:59:36
info_url:
title:
id: "85"
track_id: "85"
annotation: Sarah Brightman
position: "84"
created_at: 2005-12-11 16:59:36

thanks for the tips, ruby-breakpoint!



Thursday, December 08, 2005

a new job 

I spent the last two days at the offices of Planet Argon, where I've been programming Ruby on Rails. Rather, I've been using Ruby on Rails to write a website, with the help of a few other people, and getting paid for it. Considering that I'd be doing this anyway (and in not a stimulating context) even if I weren't getting paid, I can safely say I'm happy with my new job.

In the little world where the differences between various programming languages are important, Ruby (the language) is gaining stature and acceptance as fast as any language ever has. In the world most people live in, where programming languages are not that interesting, what it means is that not only do I have an opportunity to learn and challenge myself in a way that is satisfying, but also that the skills and experience I'm gaining should only get more valuable.

Hooray for doing what you like and getting paid! Or in geek speak - new job++

Archives

02.2004   03.2004   04.2004   05.2004   06.2004   07.2004   08.2004   09.2004   10.2004   11.2004   12.2004   01.2005   02.2005   03.2005   04.2005   05.2005   06.2005   07.2005   08.2005   09.2005   10.2005   11.2005   12.2005   01.2006   02.2006   03.2006   05.2006   06.2006   08.2006   10.2006   04.2007   05.2007   06.2007   04.2008   05.2008  

This page is powered by Blogger. Isn't yours?

Weblog Commenting by HaloScan.com