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:
I recently wrote an API callback script that performed some heavy calculations and took a long time to return. To keep the user from having to wait, I wanted to have the script immediately return cached results and asynchronously process the calculations. There are a few partial solutions on the web but none of them properly deal with sites using HTTPS, so here's my solution:
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?"
Tim from Crowdcademy recently wrote about the ugly side of programming:
I've also discovered that learning to code can have a big impact on your personality. Coding uses a lot of thinking patterns that I hadn't really used since my math and statistics classes in college, and even back then not in this intensity. As a result I've become more focused, more logical and smarter. But I've also become more detached from everyday life and less fun to hang out with.
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