This Summer, I finished “Mathematics: The Loss of Certainty”, an amazing book by Morris Kline. It’s a book that tells the history of mathematics, but with a particular theme. As the author boldly states in the introduction, it’s about the “rise and fall” of mathematics. While no one would argue that the utility of mathematics has in any way diminished, the “downfall” that the author speaks of is about the rise of doubts in the status of mathematics as our most trusted knowledge. It’s about whether the universe has a mathematical design or if “mathematization”, in the words of the mathematician Hermann Weyl, “may well be a creative activity of man, like language or music”.
Have you ever wanted a talkative ascii cow on your linux terminal? I’m going to guess yes.
The tale of a weekend project
I love the occasional weekend project. Getting something launched quickly can be rejuvenating, especially if you're in the middle of a long term project like a startup.
In this blog post I'm going to walk through the code that is at the core of a small site I built in a weekend called twtspire. The point of the site is to mine twitter for app and website ideas that would make for fun and/or useful projects to work on. I figured people would be venting on twitter about pain points that could be solved with an app or just tossing out app ideas, and I wanted to surface those ideas so that I could build stuff people actually wanted.
The linux command line has a rich set of utilities and functionality. One of its beauties is that there are many utilities with a simple purpose that are in themselves very useful, but can also be combined to do an amazing array of jobs. This is a fundamental part of linux with tricks built into the bash command line shell to make that very easy.
In this post I'm going to be talking about two such tricks that every command line warrior must know: IO redirection, and piping. Whether you're writing shell scripts, or doing one-off commands on the command line, both are very useful.
If you're not familiar with the Readability) project by Arc90, it is a bookmarklet that removes the clutter from web sites while you're surfing the web. When I say clutter I mean the ads, widgets, navigation elements etc. that often surround the main content of the website. Readability gives you a pristine view of the actual content.
Readability has been ported to many different languages including one in Python, which was written by Nirmal Patel (get the source here). Running readability server-side is useful if you're doing screen scraping and want to isolate the page content.
GNU Screen is one sweet linux program that has boosted my productivity a lot. You can read about some of its features here. As a developer who spends most of his time in the terminal, GNU Screen is a godsend. Notably, GNU Screen sessions persist even after you've lost a connection, so losing a work in progress before a save is one less thing to worry about, and you can also split the terminal screen into numerous windows using GNU Screen.
I find splitting the terminal screen useful because I can check the output of multiple programs simultaneously. Setting up a split screen and running the desired programs is a matter of typing a few commands, but I'm very lazy, so I wrote a python script to automate it and get rid of the tedium of repeating these same commands.