So, I needed to change markdown to textile and google didn’t yield any handy scripts, so I sharpened my vim fu with Rubular, my favorite regular expression tester and came up with a few substitutions that took care of everything but lists and code blocks.

In vi, type ESC to go into command mode, then :%s/one/two/g will find every instance of “one” and replace it with “two”

First the easy stuff, headers. ^ finds the beginning of the line.

:%s/^# /h1. /g
:%s/^## /h2. /g
:%s/^### /h3. /g

To replace images, I needed to replace ![alt-text](link) with !link! so I needed to capture text. I suppose I didn’t really need the first capture, but I was working on the replace expression for a regular link when I realized it would be easier to do the images first. To understand the expression below, you need to know that (stuff) captures some text which can be inserted in the replacement text with 1 and 2, etc. So to get everything between square brackets, I use [(.*)]

:%s/![(.*)]((.*))/!2!/g

All of my images appeared on a single line, so I didn’t catch a potential issue in the above expression until I got to replacing text links. I needed to use a non “greedy” capture so that I wouldn’t pull in text after the link that happened to include a parenthetical comment. Normally, in reg ex I would use (.*?) but in vim I needed to write (.{-}) …wtf?

:%s/[(.*)]((.{-}))/"1":2/g

Special thanks to Adam Wolf’s tip via ShareGrove which helped me document these steps.

you can put VIM in a mode where the command history is just like another buffer. Not in insert mode, try q:

You should get a new buffer that you can edit with the command history in it, so “*yy would yank the current line into the system clipboard, etc.

I’ve gotten a number of requests for follow-on training in San Francisco for Rails and the Ruby language, so here are some classes coming up in January.

Ruby on Rails class

Another Ruby on Rails training at Marakana is coming up January 19-22 — the deadline for early bird discount is Dec 29.  I was pleased to hear positive feedback from the test-first teaching approach:

I really love the emphasis on test driven development and the use of tests as a way to move students along in exercises. This is definitely the way to teach. I highly commend you folks for doing it. It provided instant feedback on how successful my coding was, and provided a good guideline for successful coding in my profession. — Reed College

One thing Marakana did extremely well was provide unit tests with labs. This one technique alone will now represent the standard I hold all future training courses to. It made training more than learning, it made it about problem solving. It made learning fun. — Near Infinity

Scholarship. Marakana will again be offering a scholarship spot (deadline Jan 12). If you feel that your presence will increase diversity in the Ruby on Rails community and that taking this class could have a positive impact on your life and you would not otherwise be able to afford the class, please fill out this short form. Our decision on the candidate will balance your need, how much taking this course will have a beneficial effect and your potential impact on the community. Bonus points for bloggers and twitterers or people who otherwise spread their know-how.

Ruby language class

Liah Hansen and I will be teaching a new Ruby language class which will be 6 weekly evening classes with homework assignments in between.  I didn’t set up a scholarship form for the Ruby language class, since it is less expensive, but would consider an application for this class as well — just add a note to the first field in the form.

If you sign up for both classes, we’ll give you a $200 discount on the Marakana class.

Advanced Rails class

Wolfram Arnold will be teaching an advanced Rails class on Jan 25-28, the week after my introductory class. This will be a good companion to the first class or a way to sharpen your skills if you are already working with Rails.

Cisco CTO, Padmasree Warrior, gave a thoughtful keynote speech for the Women of Vision event. I watched part 1 in May. Reminded by Anita Borg Institute’s Year in Review, I enjoyed watching part 2 and part 3.

She titled her talk: “fear stays silent while passion speaks,” which struck me as an important way to talk about vision and about women in tech. Although I do think a certain amount of fear coupled with the courage to overcome it can sharpen an edge, too often women (and men) hold themselves back without even realizing their own power and creative force.

She also notes that work and life are always at odds.  It isn’t about balance.  It is about integration.

Here are five life lessons she shared:

  1. Every transition brings a growth opportunity
    an opportunity to add new skills
  2. You can gain speed at a turn
    applies to companies as well as individuals, a downturn or upturn allows us to focus
  3. Leaders blur boundaries
    You need to be able to work across functional boundaries, as well as across countries and with different kinds of people. Influencing across an industry is more important than leading a large number of people.
  4. The best way to gain recognition is to give it away
    People are often afraid of losing credit. Ideas are stronger when you share them. If you give someone credit for an idea, it is amazing how quickly they will run with it.
  5. Opportunity is a mold waiting to be re-shaped
    There is never a perfect fit for a job. We are always in a mold and it is up to us to break out of that mold. The fit doesn’t come to you, you need to work hard to make a fit.

“The CTO’s job is not to know all the answers, but to ask the right questions”