Saturday, January 22, 2011

Linchpin, a must read for everyone!

Linchpin: Are You Indispensable?Linchpin: Are You Indispensable? by Seth Godin
My rating: 5 of 5 stars

Amazing book!  I was looking for the chance to write a book related to disobedience and How this could lead to your unique brand in the world.  I think this book touched my core point evolving with the topic on a very productive way.  A joy and very profitable investment to read this book.

One more time Thanks to Seth Godin for his generosity!


View all my reviews

Saturday, January 15, 2011

How to perform several changes on many files in one step

Hi,

Several time you got a very safe pattern to be modified for a different text on thousands of files on a huge hierarchical tree?   The best way I have seen this working pretty nice is with a one liner Perl, already tested on Windows, Linux and Mac, Perl still very alive!

perl -pi -e 's/this reg exp/with_this_content/g;' file

I said thousands of files but above is only one, well pipe them:

find . -name "*rb" | xargs perl -pi -e 's/this reg exp/with_this_content/g;' {}

recommendation, have a committed version of your work in case you didn't like the results of the massive editing!

Thursday, January 6, 2011

How to append to an array in ruby

To add elements and incorporate them into a base array:
base_array.concat appen_this_array

to add single items, just push:
base_array.push(this_item)