I have a spreadsheet of metrics I track every week. I add a new column to the left every week for that week's data, so that I don't have to scroll forever to the right to see recent information. (Yes, it would be easier to add rows, but that's another story.) All was well until I wanted to add sparklines; since the newer data was on the left, it looked like the sparklines were trending down, when actually the data was just backwards. I needed to find a way to reverse an array in Google Spreadsheets.
I need to use this command every once in awhile and I always forget how to do it off the top of my head.
grep -lr --exclude-dir=".git" -e "oldword" . | xargs sed -i "s/oldword/newword/g"
If you're on Windows you'll need unix command-line tools installed. The easiest way to do that is with Gow.
Here's what each piece does:
But I have this little note at the top of
This blog post was originally posted to my blog at Mediacurrent. It appeared on Drupal Planet.
This summer I was a mentor for the Google Summer of Code program for Drupal. I maintain the Facebook-style Statuses module, which allows users to have a stream of “status updates” on their user profiles and to write messages on other users’ profiles, like Facebook. So when I had the chance to mentor the Facebook-style Micropublisher proposal, which built on Facebook-style Statuses to allow attaching images, links, and video to status updates, I jumped on it.
The result was a resounding success, and I learned a lot during the process. Nitin Gupta, the student driving the project (and better known to some as publicmind) was an extraordinary developer in the true Drupal spirit. He gracefully put up with my pickiness about coding style, thoroughly researched the best code architecture for our purposes, and even identified places where Facebook-style Statuses itself could become more flexible. I truly believe that Nitin will remain committed to the module he created, and that both of us are better Drupal developers as a result of this process.
Isaac is a product manager, programmer, author, founder, investor, and game developer. Cookies are his kryptonite.
- Arguments against the threat of artificial superintelligence
- What is Virtual Reality good for?
- Reverse data in a Google Spreadsheet array