Category Archives: screencasts

James Edward Gray: Associative Arrays and Ruby Hashes

Yesterday I put out a little screencast showing some ways of Creating Ruby Hashes. James Edward Gray II pinged me on Twitter and basically said “Great screencast! Ooh, but you forgot this! Ooh, and this! And this!” and so of course there was nothing to do for it but invite him to do a pairing screencast with me.

This video is a bit of a weird hybrid. You get 7 minutes of podcall, then 18 minutes of screencast, then another 12 minutes of podcall. James shows off some of the “hot new awesomeness” of Ruby 1.9, and then points out that this awesomeness has been around for a couple of years and nobody’s using it, in spite of it having been in the current Pickaxe for nearly as long. Along the way we talk about regular expressions, testing dogma, and the importance of never squashing creativity in the open source community. All in all, an incredibly fun time for me. James threatened to come back and do another one with me on regular expressions, and I’m mentioning it here in writing so that everybody knows I plan on taking him up on that offer.

No podcast, because half of it is us typing into a shared screen session. But here’s the video. You may need to watch it on Vimeo or download it to see the font clearly.

Associative Arrays with James Edward Gray II from David Brady on Vimeo.

CRAZY Bash Programming with Wayne E. Seguin

Okay, let me start by saying “holy freaking crap”.

I met Wayne E. Seguin at MountainWest RubyConf, and we immediately hit it off, much to the dismay of many onlookers. At one point Evan Light said “It would be interesting to find out which of you two has the most disturbing sense of humor.” Both Wayne and I immediately shouted “OKAY!” and then I didn’t hear what either of us said after that because everyone around us was screaming “NOOOOOOOOOOOOOO!!!!!!!!”

Now, Wayne created the incredible rvm, or “Ruby enVironment Manager”, and what’s more, he created it all in bash rather than using a “real” programming language like Ruby or Python. It turns out that Wayne’s been doing a lot of bash scripting, writing BDSM which doesn’t stand for what you think it stands for and instead stands for “Bash Deployment and Server Manager”. Then again the project image is a penguin dressed in leather cracking a whip over a 4U server wearing a ball gag. So maybe it also means what you think it means.

But I digress. The point is, Wayne’s been doing a LOT of programming in bash lately.

A few weeks ago, I tried to add rvm-prompt to my bash prompt, and found that I couldn’t. I learned enough bash scripting a couple years back to write a totally sweet bash prompt that showed my git branch in different colors based on the name. Master and Production branches show in an alarm color, story branches in a calm cyan, etc, like so:

But while my prompt was sweet, my bash prompt programming was… well, not so sweet. It chained half a dozen sed scripts together to inject the ANSI color codes for each branch name, and like I said, was so complex I could not debug it. I showed it to Wayne with a mutter about “I should probably extract this to a function or something”. Wayne looked at it and made this sort of incoherent cry of alarm and dismay. In his defense, this was the prompt:

A few hours later, he called me on Skype and said, “Can I help you with your bash prompt?” I said “Sure!” and Wayne turned on screen sharing.

What I didn’t know is that he had Haris Amin on the line as well, and he had prepared an entire bash programming lesson for us.

What HE didn’t know is that I have been in the habit of recording my Skype sessions. When Wayne switched us to his Adobe Connect sharing session, I said, “Hang on, you’re not sharing this with Skype, I need to start my OTHER screencast recorder.”

And here it is. The most awesome hour I spent last week:

CRAZY Bash Programming with Wayne E Seguin and Haris Amin from David Brady on Vimeo.