productivity

Reverse data in a Google Spreadsheet array

Mon, Oct 20, 2014 - 4:50am -- Isaac Sukin

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.

Command-line tip: replace a word in all files in a directory

Wed, Jun 26, 2013 - 11:37pm -- Isaac Sukin

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 '' -e '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:

TODO: Make code prettier

Sat, Jan 7, 2012 - 5:38pm -- Isaac Sukin

I'm writing a game in JavaScript for fun (I'm almost done, it'll be out within a few days). I've written dozens of games in traditional desktop languages, and I've written a lot of JavaScript designed to make user interfaces prettier, and I've even written some useful JS tools -- but this is the first time I've written a full application in JS complete with complex hierarchical entities. That is to say that I've never had to care much about the fact that JS more or less supports OO architectures before. I could have made this an opportunity to learn about OOP in JS, but I didn't. Instead I wrote the game basically without using (custom) objects at all, resulting in some redundancy and confusion. I did this because it was fast and easy and I already knew how to do it. The code's a mess, but so what? It works. It's good enough. I had fun, and I'm about to ship.

But I have this little note at the top of main.js:

My Google Summer of Code Experience

Thu, Aug 26, 2010 - 10:13pm -- Isaac Sukin

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.

Subscribe to RSS - productivity