Maia-ism

Mommy, you’re the best my friend.
- Maia

That’s about the cutest thing I’ve ever heard.

all? and any?

I’m not exactly sure how I’ve missed Enumerable#all? and #Enumerable#any?, but mark them as yet two more reasons to love Ruby. Both methods pass all elements of the collection to a block and they return true or false based on the collection’s matchy-ness. Examples follow:

["Joe Purdy", "Jonathon Coulton"].all? { |artist| artist.rocks? } #=>true
["Fortran", "BASIC"].any? { |language| language.rocks? } #=>false

Oh, you want a serious example. Sheesh. Let’s see if we can find out if there are any even numbers in a collection:

[0,1,2,3,4,5].any? { |x| x % 2 == 0 } #=> true

Cool. Now, are all of them even?

[0,1,2,3,4,5].all? { |x| x % 2 == 0 } #=> false

See? Aren’t they just the coolest?

Vim and Ruby

Just FYI, if you’re using Vim to edit your Ruby code, you really want to be using the vim-ruby scripts, a-like so:

gem install vim-ruby
vim-ruby-install.rb

This will give you some nice ruby-style indention, syntax highlighting, etc etc etc.

Fingr

What the duece is Fingr?

Fingr is a Camping mini-app that Web 2.0-ifies Finger.

In other words, it takes something that works just fine and makes it kinda lame :).

The idea is that you can create a jabber account and link it to your Fingr install, send messages to said jabber account and VOILA! They appear as though by magic in your browser.

I liked this better when it was called Twitter!

Yeah, I know. In fact, it uses xmpp4r-simple, which was written by the Twitter folks. Think of Fingr as an anti-social version of Twitter: it’s for you and you alone, unless you choose to share the URL.

How?

Well, like I said before, it uses Camping and xmpp4r-simple. By association, it requires Ruby. It also needs rss/maker, but I think that’s included with the price of Ruby.

All in all, it’s pretty simple. Copy config.yml.sample over to config.yml, enter the proper info and start it up:

camping fingr.rb

By default, it’ll start up on port 3301. If you want it to run somewhere else, just drop the –port option on it:

camping --port 1234 fingr.rb

Goodbye and good luck!

S3 vs. JW mp3 player

I’ve been doing some work on the Valley Christian Assembly website: in particular, adding in a way for my Pop to share recorded sermons. The sermons are stored on S3 and I wanted to come up with a cool way for folks to listen to them.

Enter the JW MP3 Player.

Here’s a tip: If you’re using S3, you’ll need to encode the URI to keep Flash from pooping it’s pants.

var so = new SWFObject('mp3player.swf','player','320','20','7');
var eURI = encodeURI('http://s3.amazonaws.com/BUCKET/KEY?STUFF');
so.addVariable("file", "a href=" + eURI);
so.addVariable("type", "mp3");<br />
so.addVariable("width","320");<br />
so.addVariable("height","20");<br />

Consider encodeURI(uri) like your friend that comes over for a party, has a great time, cleans up your house for you and then goes home :).

Lispy

Peter Seibel (author of Practical Common Lisp) has asked for some Google juice. I love the book and so I thought I would contribute what little Google juice I’VE got to helping getting Practical Common Lisp recognized as the defacto Lisp tutorial.

I know… real smooth :).

For Future Reference

Since I always seem to forget how to do this, here are the steps to create a new Rails project and import it into subversion:

  1. mkdir PROJECT_NAME
  2. cd PROJECT_NAME
  3. mkdir branches
  4. mkdir tags
  5. mkdir trunk
  6. rails trunk
  7. cd ../
  8. svn import -m “Initial import.” PROJECT_NAME

Done and done :).

All Done

I’m all done here. Check out http://mando.tumblr.com for all future updates.

*Edit* Just kidding :)

Decisions, Decisions

Current conversation in my head:

Me: I need a more formal presence on teh intarweb.
Inner Me: Why?
Me: A couple of reasons:
Me: 1) I need to build the Mando Escamilla Brand.
Me: 2) I need a place to put all the stuff I work on.
Me: 3) I never blog any more, so mando.org is all empty and stuff.
Me: 4) No one knows about me.
Inner Me: *sigh*. Let’s take these in reverse order, shall we?
Inner Me: 4) Who cares? Your friends and family know all about you.
Inner Me: Why should you care that Joe Random knows you?
Inner Me: 3) What about your tumblelog? You do that all the time.
Inner Me: 2) Ok, I’ll give you that one.
Inner Me: 1) Can you BE any more obnoxious?
Me: Alright, alright.
Me: So, you’re saying incorporate the tumblelog and some static pages for projects?
Inner Me: Actually, I’m saying it’s almost midnight and you should be in bed before the super flu kills you, but we’ll go with your idea since you never listen to me anyway.
Me: Hmm….

New Yankee Stadium

It’s nice, but I’m glad I’ve been to the House that Babe Built (on opening day, no less :). Rumor has it there’s gonna be even less seats in the new stadium, which will drive the ticket prices all the higher.