Trash aware rm for OSX — never lose a file again

OK, so let’s say you’re an OSX user, and you use the command line a lot. I bet you’ve accidentally deleted a file using rm, and wished that it had gone to the Trash.

We had this problem a few days ago, and fortunately the file was under version control. But we looked for a solution that would rm into the trash. There was only one solution and it didn’t work in Leopard (10.5)

I mentioned this on Twitter, and my buddy Jason threw a working version of trash-aware-rm for OSX together in no time flat. Check it out.

I love Science.

I love Science. I don’t just love Science, I *fucking* love it. Maybe I’ll do a post on the Science sticks someday.

There’s a webcomic I particularly like, called XKCD.  It’s Science-y, Math-y, geek humor. Perfect for me.

One of the best is the following comic, good old #397. I love it because Feynman (one of the most significant scientific figures of the 20th century) shows up *as a zombie*, to defend the Mythbusters (who are awesome). On top of it, he makes a great point about Science, and Science in culture.

Zombie Feynman defends the Mythbusters

That, and I love the phrase “drag humanity out of the unscientific darkness”. Science!

The power of compounding

I’m sharing the link love today. This is a link to Futility Closet, a blog run by a very nice (and presumably well-educated) guy named Greg Ross. He updates often with lots of odd bits of trivia.

He had a post the other day, discussing the price that was paid to the Native Americans for the island of Manhattan. Maybe they didn’t get ripped off, after all.

Pro Tip: How to block calls from any cell phone

My coworker Jacob shared a neat cell phone tip with me. If you often get solicitations from a particular phone number (especially those annoying automated ones), you might find this useful.

Next time you get a call from a number you’d rather not hear from again, add them to your phone book — maybe with the name of “Ignore” — and assign a silent ringtone to that contact.

Win!

Firefox extension debugging

One hugely important thing in coding is debugging. Unfortunately, a lot of Javascript debugging gets done via alert() calls. This gets awkward quickly, with the alerts affecting timing, and just being annoying if you have to dump large amounts of data out.

Firebug is a great development tool, and has a really handy logging interface that you can dump debugging info to. Just calling console.log(whatever) will dump it to the main Firebug interface as text that you can copy/paste, scroll through, etc.

If you’re developing a Firefox extension, this debugging capability is really useful. Except, calling console.log() doesn’t work, console isn’t defined for the browser, only for each window.

The trick? Call it directly from the Firebug extension object.

Firebug.Console.log()

Be sure to capitalize both Firebug and Console, and you’ll be good to go. In addition to having great capabilities for logging, the console will prevent your debugging messages from popping up to your users, in case you leave some code where it shouldn’t be.

By the way — if you found this helpful, check back here in a few days. I’ve submitted a presentation proposal to SXSW for Firefox extension development, where I’ve got tons of info for creating extensions for web applications. They collect votes from the community, and I’d like your support. Plus, if the presentation goes through, I’ll be collecting lots of my best tips and putting them online as a resource for the attendees. That means you’ll get all of them too, and you don’t have to go anywhere! 😀

Edit (2008-08-21: Added link for SXSW voting panel)

What makes a great wine?

Saw a post on the Freakonomics blog about wines, and people’s abilities to tell the difference between good and bad wines. I love Levitt for his willingness to piss people off in the pursuit of truth (read the part about the scholar who stormed out of the room!) Anyways, there was a large study done, and the conclusion is that people generally can’t taste the difference between “great” wines, and ordinary wines (link goes to original paper).

Don’t get me wrong, I’ve had some reasonably pricey bottles of wine. And I’ve enjoyed some of them. I appreciate that there’s people who really take care of their vines; who pick the best grapes; who use classic equipment and methods. But, I’ve also had bottles that cost under $20 and tasted quite nice.

Generally (and with no expertise to back this up) I think the knowledge of how to produce a decent wine has spread very far, and snobbery is mostly a hangover from the past few hundred years when lots of wines were actually quite bad.

Of course, I know the true secret behind great wine. It’s that any average wine becomes great when you drink it with great people. Salud!

This gives me hope.

This post is for those of you who follow international politics on any level.

The US has had a policy of not speaking to Iran for many years. There’s even a debate in the current presidential election around “should we talk to our enemies?”.  Well, apparently someone in the current US administration thinks so.

There’s a lot of people who pooh-pooh talking, and I understand and agree with them. If you need to put up a building, standing around and talking about it won’t put the building up. If you have to make food for dinner, talking about it won’t make a nice beef stew. Talking is basically useless.

Unless you’re doing something that involves people. In that case, talking is hugely important.