Finding a Pull Request

September 25th, 2012 • 0 commentspermalink

GitHub OctocatSometimes, you’re looking back through a git blame, and you want to find the context around that commit. A commit message is nice, but a full description in a pull request is even nicer. Hence, find_pull_request. It’ll just open the pull request that merged that commit into master, full of comments and descriptions about why that particular line was added. Hooray!

Source on GitHub. Dependency on hub.

Derp 2.0!

August 28th, 2012 • 0 commentspermalink

Derp I’m happy to announce that Ricky, Mike, and I have released Derp 2.0!

Rebuilt from the ground up, Derp 2.0 has beautiful new retina images across the entire app; supports iPad, iPhone, and iPod touch; and has a slick new interface, with incredibly innovative new features like a “pause button”. Derp 2.0 also has a completely new physics engine, which provides more realistic collisions and a much more polished experience on the whole.

Once you’ve played it for a while, check out the preferences! We created a hard mode, which adds a “void” across the center of the screen that hides the balls. It means you have much less time to react, and really adds a lot of suspense and excitement to Derp.

Quick Image Hosting from OS X

December 9th, 2011 • 0 commentspermalink

On OS X, Twitter.app’s image hosting services all have a nasty habit of shrinking the image to save bandwidth. Unfortunately, reducing the resolution really ruins screenshots — often, all of the text is lost, which can defeat the point of including it in a tweet.

At first, I turned to CloudApp. Their Mac app, which I highly recommend, has a system-wide hotkey to upload any file. Once it’s done uploading, CloudApp puts a link to the file on the clipboard. It’s a really great system, but it has one flaw for this use: the URLs it generates don’t end in an image extension (e.g. .jpg), so most twitter clients don’t recognize it as an image. Because of that, anyone that reads the tweets has to open their web browser to see the image.

To prevent that, I’ve been using imgur as a host, because they’re fast and free. Plus, they have a massive 1 MB cap on image size. That’s great, but compared to CloudApp, it’s still pretty slow: I have to go to the webpage, select the image, wait for it to upload, copy the URL, and then finally return to Twitter.app. What I really wanted is a CloudApp-like experience for Imgur on my Mac.

So I made one. It’s both a command-line utility and an OS X Service, for easy uploading from both the terminal and the Finder.

Github.

Florida: Right Next to Montréal!

December 6th, 2011 • 0 commentspermalink

A map of the NHL cities, with the new conferences colored in.Today, the NHL Board of Governors voted to approve a new plan to regroup the teams into four new conferences, based on the teams’ locations. That makes sense — some divisions are really spread out. For instance, Dallas is in the same division as San Jose, which is two time zones away. The long flights and big time changes between games are bad for everyone — the players spend a long time traveling and adjusting their daily schedules, and the fans stay up late or leave work early to watch the games.

That said, the re-conferencing could have been done a little better. According to the commissioner, Gary Bettman, the discussion to regroup the conferences only lasted about an hour. Remind me why the Florida teams are in the same conference as Montreal, Toronto, Buffalo, and Boston?

Unwrapped and Over-waxed

November 30th, 2011 • 1 commentpermalink

A Bag of Unwrapped Reese's MinisI love chocolate and peanut butter, especially together. So naturally, I’m a huge fan of Reese’s cups. But the normal ones have too much peanut butter in the middle, and so in the middle of each cup, you get these bites of candy that just aren’t chocolatey enough. But the Mini cups are perfect — they’re smaller, so you eat them all at once, giving an excellent blend of chocolate to peanut butter.

The other day, I tried Reese’s Minis “Unwrapped”. They’re like a small version of the mini cups, except that they’re, well, not wrapped! They look like an awesome product — it’s still the right ratio of chocolate to peanut butter, and they’re WAY easier to eat. Sounds great, right?

Nope. They’re terrible. Hershey’s puts some kind of wax on the outside of each cup, and there’s enough of it so that all you taste is wax. It pretty much destroys the flavor of the whole thing. Until they find a better way to keep the cups fresh without a wrapper, I don’t recommend them.

Gmail’s Welcome Email from 2004

November 16th, 2011 • 0 commentspermalink

I just reread the welcome email that Gmail sent me when I signed up back in 2004. Today, they have a series of welcome pages and emails that let you know how to use the service. It’s arguably more useful now, but they seem to have lost their personality. Gmail’s not awesome anymore — now it’s just boring.

Gmail is different. Here’s what you need to know.

First off, welcome. And thanks for agreeing to help us test Gmail. By now you probably know the key ways in which Gmail differs from traditional webmail services. Searching instead of filing. A free gigabyte of storage. Messages displayed in context as conversations. So what else is new? Gmail has many other special features that will become apparent as you use your account. To help you get started, we encourage you to visit our Help Center, there you can browse frequently asked questions, read our Getting Started guide, or contact the Gmail User Support Team. You’ll also find information in the Help Center on such topics as:
  • Importing your contacts from Yahoo! Mail, Outlook, and others to Gmail
  • Using address auto-complete
  • Setting up filters for incoming mail
  • Using advanced search options
You may also have noticed some text ads or related links to the right of this message. They’re placed there in the same way that ads are placed alongside Google search results and, through our AdSense program, on content pages across the web. The matching of ads to content in your Gmail messages is performed entirely by computers; never by people. Because the ads and links are matched to information that is of interest to you, we hope you’ll find them relevant and useful. We’re working hard during our limited test to improve Gmail and make it the best webmail service around. Thanks for taking the plunge with us. We hope you’ll enjoy Google’s approach to email. Thanks, The Gmail Team P.S. You can sign in to your account any time by visiting http://gmail.google.com

Ruby Extensions: A Brief Tutorial

November 3rd, 2011 • 0 commentspermalink

The Ruby ruby

Ruby is slow, compared to C. But if you write the critical parts of your program in C, you can have Ruby’s rapid development AND C’s runtime speed! Profile your program, and use the steps below to port the slowest inner loops to C!

  1. Download the skeleton of your extension (or look at it on Github). Unzip it into an empty folder.
  2. Read build.sh, which is a short bash script that shows you how to build your extension.
  3. Read extconf.rb, which is the extension configuration script.
  4. The datatype ‘VALUE’ represents EVERYTHING in Ruby. You’ll need to decode your data in order to work with it in C, and re-encode everything in order to return it to Ruby.
  5. When you call a C function from Ruby, the first argument is the receiver of the method, a VALUE called self. Basically, if you want a two-argument Ruby function, you’ll need three arguments in the C version of it.
  6. Read yourextension.c. It outlines the main steps in a simple Ruby extension.
  7. If you want to know more about how extensions work under the hood, or if something isn’t abundantly clear from the file, read the ruby-docs!

Tab Rescue!

August 28th, 2011 • 0 commentspermalink

Tab Rescue!I’ve been trying to find the Mac web browser with the best combination of RAM usage, speed, and graphics card usage. After flitting through Chrome, Firefox, Safari, and even Opera, I’ve come to the conclusion that Firefox is too slow, Chrome eats too much RAM, and Opera is just too foreign. Plus Chrome and Firefox turn on my MacBook Pro’s discrete graphics card, which seriously eats into my battery life. So I’m a Safari user now, which has fringe benefits like Full Screen mode on Lion.

But one thing I’ve missed from other browsers is the ability to quickly and easily bring back tabs and windows I’ve closed. Mostly that’s because I have a nasty habit of opening a ridiculous number of tabs — on the order of 40, 50, or even higher. I think at one point, I hit 100. Anyway, after opening tons of tabs, I’ll try and clean up my browser by closing a bunch of them. But once in a while, I’ll miss and close a tab that was actually important. Currently in Safari, you can bring back the one tab you closed last with ⌘Z, but that’s not really good enough — I tend to realize that I closed the wrong tab after closing a few more. So I needed a way to reanimate dead tabs.

So…I wrote a Safari extension to do just that. It creates a hotkey at I’m calling it Tab Rescue, and you can download it below! Hopefully you like it! Feel free to comment or drop me an email if you have questions, comments, or concerns.

Download

Ease of Use

February 1st, 2011 • 1 commentpermalink

That was easy!In computing as in everything else, the ease of use drives product adoption. We see this today with Apple — it’s decided that the most important thing about its products is that they MUST be as easy-to-use as humanly possible. Maybe even better than that. Steve Jobs is (in)famous for pushing his engineers beyond what they dreamt was possible. The iPad is what it is today because it’s ease of use makes it by far the best device on the market.

This isn’t a new trend; there are endless examples of this in history. Look at the TV dinner. Swanson had a huge surplus of frozen turkeys due to awful Thanksgiving sales one year, and turned them into the simplest three-part meal the world had ever seen. Put an aluminum tray in the oven for 25 minutes, and BAM! you have a complete dinner. They expected to sell about 5,000 of them during the first year on the market. They wound up selling more than ten million of them in the first year alone. The market grew and grew, and is now worth some $40 billion a year. Why? It’s the easiest dinner you can buy.

The invention of CDs revolutionized the markets for music. Why? Not because they were higher quality. Audiophiles today still claim that the vinyl record makes a better quality recording than a CD. People weren’t excited about the lighter weight of CDs. They were excited because you could instantly skip around the CD, listening to songs at random. People loved that you didn’t have to rewind the tape or re-place the needle anymore. Know what happened? CDs helped the industry nearly double music sales, shipping over 700 million units a year in 1995.

Now, I’m not trying to say that the ease of use is the only important thing about a product — far from it. Even if your product has a perfect UI, nobody will buy it if they don’t know about it. Having marketers that know what they’re doing is, well, important. And having engineers that can make a product work well is important too. Apple has a sensational marketing team and a world-class engineering team. Swanson copied the frozen meal idea from food on airplanes, but sold ten million of them with the name “TV Dinner,” piggybacking on television’s vast popularity at the time.

Sources: Wikipedia on TV dinners and CDs, and a Frozen Food Industry Guide.

Life Structure

January 14th, 2011 • 4 commentspermalink

Weekly Planner

At Oxford, there is the barest minimum of life structure. I’ll be in two tutorials and one lecture this term, which translates to two and a half meetings with professors a week. It’s not as if there is no work though; professors assign 500+ pages of reading and a 6-7 page paper between meetings.

Apart from their tutorials, though, students do their work whenever, wherever. Most days, there are no classes to wake up for, and nothing pushing you to work but you and your deadline two weeks away. From what I’ve heard so far, it’s a bit like telecommuting: most students keep 9-5 schedules, just to keep their lives together.

Contrast that to Tufts life, where students have two or three classes during each day, each with its own daily deadline. Professors split their classwork into manageable chunks that take a few hours to do. Students then motivate themselves with deadlines, and do the majority of your work on the night before it’s due. I certainly do.

But I’m at Oxford for the next six months, not at Tufts anymore. I suspect it will be a difficult paradigm shift for me — I’ve been deadline-motivating for almost ten years now, and here, there will be too much work for me to do on the last night. It’s a change I’ll welcome, though. The real world doesn’t break its work down into 3-hour chunks, and juggling multiple tasks with vague deadline expectations isn’t unusual. Hopefully by the end of these next two terms, I’ll be able to self-motivate and pace my own work much more effectively.