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

Thu, Jun 27, 2013 - 2:37am -- 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 "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:

"I want to learn programming. How should I start?"

Wed, Aug 22, 2012 - 1:21pm -- Isaac Sukin

This is a slightly edited response I recently wrote to someone who asked how to learn skills that would be useful at a hackathon. It's my usual response when someone asks how to get started programming.

You should start by approaching the problem from a different perspective. You should be thinking "I want to build X. Now what do I need to learn to build that?" not "I want to learn to build stuff. What can I learn?"

How to Build a First Person Shooter in the Browser with Three.js and WebGL/HTML5 Canvas

Tue, Jun 26, 2012 - 4:46am -- Isaac Sukin

Update, October 2013: I wrote a book, Game Development with Three.js, that goes into much more detail on the concepts discussed in this article and much more about how to build a fuller in-browser game. Check it out if you'd like to learn more!

Learning to Code is like Learning to Drive

Tue, May 22, 2012 - 11:59am -- Isaac Sukin

A lot of people think about programming as some huge, difficult discipline that you sit down and learn like you would learn History or Math. I think I'll learn how to code today, one might say, and I've really been looking forward to that quantum physics class.

Here's the thing: almost no one learns how to code in a classroom, by hearing about it or by reading about it. People learn how to code by doing it, like driving a car. But most people learn how to drive a car because it gets them from Point A to Point B, not because driving is fun. Lots of people drive for fun, but hundreds of millions of people slog through traffic on their way to work every day.

Subscribe to RSS - coding