Links from 2010

Ruby Hash Tricks

Some really cool tricks with Ruby hashes–if you supply a block to Hash.new, that will act as a default value for a given key. For example, here’s a Fibonacci hash I put together which caches the values (making it pretty quick):

fibonacci = Hash.new do |h,k|
  if k < 2
    h[k] = k
  else
    h[k] = h[k-1] + h[k-2]
  end
end

fibonacci[6]   # => 8
fibonacci[100] # => 354224848179261915075

Reblogged from: RailsTips
Posted on December 27, 2010 Leave a Comment
Tagged with: , ,

The Official Viddler Ruby Gem

I just announced our new Ruby gem over on the Viddler blog. It’s a fairly basic wrapper for our v2 API for now, but I definitely have plans for some really cool features, like having ActiveModel compatible classes for stuff like videos, playlists, users, etc., as well as making it easy to integrate into existing ActiveRecord models in Rails.

So, if you’re into Ruby and you’re looking for a way to integrate video into your site, definitely check us out. We have a really great API, and now that there’s an official gem, it’s easier than ever to get started.

Posted on December 15, 2010 Leave a Comment
Tagged with: , , , ,

Ajax Upload

This looks like a nice alternative to Flash-based uploaders like Uploadify:

This plugin uses XHR for uploading multiple files with progress-bar in FF3.6+, Safari4+, Chrome and falls back to hidden iframe based upload in other browsers, providing good user experience everywhere.

Reblogged from: RailsTips
Posted on October 17, 2010 Leave a Comment
Tagged with: , , , ,

What technologies are geeks pioneering today?

Marco Arment:

Even geeks (like us) have their limits of reasonability. At some point, we often decide that what we’ve been doing or what we think we should enjoy just isn’t worthwhile.

Marco absolutely nails it with this. I used to be all about building custom computers, but nowadays, I’d much rather buy a MacBook Pro that just works, because the extra aggravation of maintaining my own system just isn’t worth the price difference any more.

Posted on October 4, 2010 Leave a Comment
Tagged with: , , ,

GitHub Introduces Organizations

This is just awesome. Prices feel a little high (for private repositories, the plans start at $100/mo), but if you’re a business that needs this, you’re likely able to afford it.

Posted on June 29, 2010 Leave a Comment
Tagged with: ,

Install LAMP stack from source with Homebrew

A quick tutorial on installing PHP from source using Homebrew. I needed to recompile PHP and could not get things to work, until Ben Bleikamp pointed me towards Homebrew, and this tutorial worked great. One thing to note: the tutorial is a bit out of date, as it uses newer versions of the software, so make sure to check the versions in the commands. For me, I had to change this line:

sudo ln -s /usr/local/Cellar/php52/5.2.12/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.2.so

I updated it to 5.2.13:

sudo ln -s /usr/local/Cellar/php52/5.2.13/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.2.so

Posted on June 7, 2010 Leave a Comment
Tagged with: , , ,

Gruber's Google I/O Thoughts

The big loser this week, though, was Microsoft. They’re simply not even part of the game. RIM looms large, as BlackBerrys continue to reign as the best-selling smartphones in the U.S. But Microsoft? They’ve got nothing. No interesting devices, weak sales, and a shrinking user base. Microsoft’s irrelevance is taken for granted.

As usual, John Gruber nails it. Microsoft really has no chance at catching up with either Apple or Google at this point, and it’s pretty stunning. They entered the game way too late, and, as far as I know, it’s still going to be a while before the first Windows Phone 7 handsets come out. They’ve already lost the mobile war.

However, as Gruber mentions, things between Apple and Google are getting very interesting. While I admittedly have not been all that satisfied with my Droid experience so far, it’s a promising platform, and I really love how much Google is pushing cloud technology. A cell phone should operate completely separate from a computer, and that’s something Apple just hasn’t done right yet.

Posted on May 23, 2010 Leave a Comment
Tagged with: , , , , ,

Photos of Space Shuttle Atlantis' Final Launch

The end of an era. It will be a sad day when the final space shuttle mission is completed.

Posted on May 14, 2010 Leave a Comment
Tagged with: , , ,

Lazy Loading Asynchronous Javascript

A great summary of how to build a non-blocking JS widget.

Posted on May 7, 2010 1 Comment
Tagged with: , ,

Marco Arment on iPhone vs. Android

Apple’s feeling threatened by Android, as they should be. So they’re systematically targeting and eliminating major reasons why someone would choose Android over iPhone.

But they haven’t yet hit the biggest one: availability on different U.S. carriers, specifically a CDMA edition for Verizon.

Bingo. If the iPhone came to Verizon tomorrow, I would seriously consider ditching my Droid and paying full price for it.

Posted on April 27, 2010 Leave a Comment
Tagged with: , , , ,

Flot

A jQuery library for easy graphs using the <canvas> tag. It even works in IE6!

Posted on April 23, 2010 Leave a Comment
Tagged with: , , , , , ,

Git Autocompletion in OS X

Add the source line to your ~/.profile or ~/.bash_profile to enable tab autocompletion of branch names, remotes, etc.

Posted on April 23, 2010 1 Comment
Tagged with: , , ,