While preparing eccola for an open source release, I ran into the issue of scrubbing/restoring the Yelp API keys that it uses.
Maybe you’ve also been there - you don’t want to commit your sensitive data (unless you get a certain kick out of rewriting your version control history), nor can you be bothered to replace it after each commit (but it has to be done so your code will continue working). So you sign up for Bitbucket, throw your project in a private repository, and lose all potential project contributors.
If only there were an easier way!
Well, of course there is. (I wouldn’t be writing this elevator pitch if there weren’t.)
lucido is a Python script designed to eliminate all of the hassles involved with the scrubbing and restoration of sensitive data. It can be used both within and independent of a git repository, though its true power really shines when it sits between you and your commit history.
It’s as easy as this:
Yup, absurdly simple. And that only needs to be done once.
Oh, the joys of automation.
VisualPHPUnit finally underwent a long-overdue rewrite this past week. The most obvious change is reflected in the UI (huge thanks to everyone involved in Twitter Bootstrap, as it alleviates so much of the usual suffering for non-designers), but a few new features (e.g., the ability to use XML configuration files, the ability to automate generation of test results via cron) were added as well. And, most importantly, the code is no longer a nightmare (thanks, in part, to NX).
eccola - a restaurant suggestion service
We’ve all been there - you’re out and about, completely ravaged by hunger, and you have no idea where to go for food. You also can’t be bothered to sift through hundreds of reviews about things that don’t matter (décor?) to your raging stomach. You want a good suggestion, now.
Choose a cuisine and a distance radius. That’s it.
You’re then presented with five top-rated restaurant suggestions (courtesy of Yelp). And with integrated directions, you’re free to use that last remaining bit of mental energy to think about how amazing your next meal is going to be.
4clojure.com solutions 1-50
Having dabbled loosely with Lisp for about a year now, I’ve finally settled on learning Clojure. One fabulous resource (built specifically to help people achieve that end) is 4clojure, where you can put your knowledge to the test without having to worry about Nailgun servers, project structures, .jar files…
Here are my solutions to the first 50 problems (yes, not all 50 are listed - I’ve omitted the trivial ones):
chronos gets a facelift
Not content to leave well enough alone, I decided to give chronos’s UI an overhaul.
(In case it isn’t obvious, the UI is modeled after tig, the gorgeous ncurses front-end for git.)
Along the way, program usage was simplified - modifications are made to timers by selecting them, rather than by specifying them via the Vim-like command line. Most commands have helper prompts, and those that involve “sensitive” timer operations (like deleting or resetting) prompt for confirmation before making any alterations. And, while technically implemented before the cosmetic surgery, the ability to add to and subtract from individual timers is useful for those occasions when you switch directions and forget to start or stop a timer.
Check out the project page for more information.
chronos - an ncurses stopwatch/timer
Since going back into the magical world of freelancing, keeping track of how I spend my time has been a little tedious. I did some searching around, but I don’t use a Mac, am generally anti-GUI, and wanted to be able to display multiple timers without needing to be tied to a browser/internet connection.
So, I rolled my own solution, using Python and ncurses.
Source (and more information) here.
Recursive, synchronous removal of a directory in node.js
I’m sure someone could boil this down to a one-liner.
file = require('./file') file.rmRecursiveSync '/path/to/delete'
Highlighting and removing non-ASCII characters in a file
Perl to the rescue:
This script simply highlights the non-ASCII characters in a given file and prints the line number where they can be found. Usage is as follows:
# clone it, if you don't feel like copy-pasting git clone git://gist.github.com/1651603.git highlight cd highlight chmod u+x highlight.pl ./highlight.pl /path/to/file
If, after reviewing the file, you want to remove the offending characters:
# everything looks okay, let's make the replacements perl -pi -e 's/[^\s\t\n\x20-\x7E]+//g' /path/to/file
Downgrading from PHPUnit 3.6.x to 3.5.15
Not everything can have the elegance of npm. Unfortunately.
Clone it here:
git clone git://gist.github.com/1612957.git phpunit_downgrade