Ice Cubes

July 9th, 2008

Ice CubesI recently found some cube shaped ice cube trays at the supermarket. They’re made of silicone so as to be flexible enough to get the cubes out. Even though I have an automated ice machine in my freezer, I was rather excited to snatch these trays up and take them for a spin. Being a non-straw user, I think the shape of the ice has a huge impact on the enjoyment of the beverage. There are a multitude of reasons for this.

Melt speed. These 1 inch cubes have a very low surface to mass ratio. That means they cool the drink more slowly, but also take much less time to melt, thus diluting the drink less and keeping the drink pleasant for longer. Since I am a modern american, I have a refrigerator, which pre-cools my beverages for me. With rare exception, I want the ice to keep my drink cool rather than actually cool it. This lowers the impact of the afore mentioned downside.

Ice CubesDrinkability. Since I don’t use a straw, this is a big one for me. Small ice cube or, worse, crushed ice make it harder to consume the drink. When sipping a beverage containing small fragments of ice, you have to be careful not to let any of the small pieces in your mouth. If you do, and you will, let some through, you have to either spit the damn thing back into the glass, or chew it up. That’s not really the purpose of the ice. I don’t want to chew on it. I want it to keep my drink cool and stay the heck out of my way.

Aesthetics. I think the large, symmetrical cubes are far nicer to look at in the glass. As is true for any food product, people consume it first with their eyes. When I serve a beverage on the rocks, I want it to be as visually appealing as possible. There’s not a whole lot you can do to spruce up the appearance of, say, bourbon and ginger, without tainting the flavor. There are only three ingredients: bourbon, ginger ale (or ginger beer), and ice. You could serve it in a fancy glass, but I think simpler is better for a drink like that.

The two trays I bought can produce 30 one inch cubes in about two hours. When they’re done, I move them into freezer bags so they don’t take on freezer funk. These cubes are reserved specifically for presentation. The machine made stuff is still more than suitable for the blender or shaker.

FireFox 3 is Ugly

July 7th, 2008

I’m just starting to work with FireFox 3. The new text rendering system looks quite nice, but the browser chrome is so ugly. It’s just… really bad. What happened? Did they do it in house or is another group responsible for this? I know SilverOrange did the last skin, which was much nicer.

Since Safari 3 came out, I’ve been using it as my go-to browser. I still boot up the fox when I need to use FireBug, but I don’t live in it anymore. It seems like have been going downhill for them ever since version 0.9. Word on the street is, 3 is much better than the previous couple versions. I’ll have to see if I can stomach the new chrome long enough to decide for myself.

Backing up with S3

July 6th, 2008

Last night, I threw together a little script for backing up content from my web server to Amazon S3. It’s not really feature complete, but it is good enough for what I need for now. It provides a very simple DSL for specifying what content should be backed up.

Download it here.

To specify content:

backup :foo do
  folder '/path/to/stuff'
  folders ['/path/to/things', '/path/to/blah']
  file '/path/to/allyourbase.rb'
end

Will produce this in S3:

-{date stamp}
  -foo
    -stuff
      -..content of stuff
    -things
      -..content of things
    -blah
      -..content of blah
    -allyourbase.rb

The idea is that you could have one backup block for each site (notice how the symbol passed to the block becomes the root folder). You could backup all the different parts of the application under one umbrella without having to worry about any collisions with other apps.

You’ll need the ‘aws-s3′ gem. To deploy this on your server, just put the files somewhere on your server, modify the configuration in the run_backup.rb script and point a cron task at it.

Video Embedding Done Right

July 6th, 2008

After the disgraceful performance by the LA Times, here is funny or die to show us the proper way to provide embed tags. A simple button to push the tag right up into your clipboard. Very nice. Also, enjoy this hilarious interview with a classic American Gladiator.

See more funny videos at Funny or Die

Now that they’re free

July 5th, 2008

The LA Times website posted a clever short video poking fun at the new hands free cellphone law. In typical online video style, they provide an object/embed tag that you can use to stick this video on your own site. As seems typical of online versions of dead tree style publications, they just don’t get it. I first thought it was odd that their embed tag is about a kilobyte, and the UI for copying it makes it difficult to actually select the whole body, and they show an add before the video. What really gets me, though, is that the thing fucking auto starts. I had to move the think behind a link so you don’t see a fucking Lexus ad when you hit my homepage.

Video (and ad) after the jump:

Read the rest of this entry »

Proper DSLs

July 4th, 2008

Dave Thomas wrote a great article describing a troubling fad in Ruby development. Specifically, he addresses DSLs - Domain Specific Languages - that try too hard to look like English rather than trying to cleanly describe a problem domain. I’ve always had a distaste for things like RSpec and AppleScript, but had a hard time describing exactly why.

Ruby makes it easy to create a domain specific language and many of the existing ones make the language particularly compelling. Rails migrations are beautiful in their elegance and descriptiveness. Rake is a joy to use compared to most build systems. XMLBuilder is a very sexy way to build XML files. The things that I feel many new rubyists fail to grasp is that these DSLs are not trying to be English. They are trying to create a simple and clear way to solve a specific problem while adding as little unnecessary cruft as possible. Most importantly, they all remember the difference between code and human language. A good DSL is unapologetically code.

I’m testing out a new…

July 1st, 2008

I’m testing out a new service that’ll take your voice and turn it into a text and post on your blog or ___ someone as an e-mail. Check it out at Jott.com. listen

Powered by Jott

Search Wikipedia from Google

June 27th, 2008

I often use google to search wikipedia with keywords like “wikipedia little endian.” I discovered on accident this morning that if you just type wikipedia, Google actually supplies a search box for wikipedia within their result set. Pretty cool. Is this new? Is it just for wikipedia? Is there an API for defining this?

Why You’re not too Smart to Switch to Mac

June 26th, 2008

Somebody over at Gizmodo published an article on why he still uses Windows. He begins by saying that he’s “too smart for Macs” (emphasis his). No, dude. You’re not. Let’s go through your arguments one at a time and see what’s really what.

The first argument, “I’m a monster on Windows” has merit. If you’d expanded on this a little and let that be it, I’d have left you alone. If you’re comfortable and really productive on an OS, there’s really no reason for you to make the switch. You might find that you’re more productive on another OS once you get over the learning curve, but I’ll give you this one.

The next section describes how Macs used to be utter garbage. This is a statement I agree with. Mac OS and even OS X wasn’t always as awesome as it is today. But it is awesome today. Who cares about what it used to be. Windows used to be better. It’s not today. Welcome to the present.

The next section tries to make several points, most of which, are utterly misinformed. PCs are better for games. Agreed. “Windows is an OS that feels structured and it makes sense just because I’m used to them.”(sic) There’s always a period of getting used to something new. This is the same as the first point. Macs feel dumbed down. You can’t tinker or access low level system stuffs. Mac OS X is based on BSD Unix. I would argue that it’s more flexible/tweakable, though, fewer changes are necessary to get acceptable performance. There aren’t as many apps. True. But it’s not like it used to be. There may not be as many, but there are plenty, and they’re usually better. Limited hardware choices. The Mac Pro is very expandable. If you really want to build your own machine, and that’s more important than actually using the machine, I have nothing more to say to you. Nowadays, most people buy laptops, and nobody is really making laptops designed to be taken apart.

Next up, we have a section about the founders of the companies. This is irrelevant. It’s worth mentioning, however, that even Bill Gates thinks Windows sucks. This is followed up by a section about how Macs are too cool. This is another irrational decision that has nothing to do with the actual platform itself.

The last section is a gold mine. “The main reason I still use Windows is this: I’m stubborn and lazy.” Not too smart, too stubborn and too lazy. I believe that. “I don’t want to switch because it will amount to admitting that I’ve been wrong for the last 15 years or so.” First of all, so fucking what. I thought you didn’t care what people thought? What happened to “My computer is not a fashion statement”? Second, you don’t really have to admit anything. Windows used to be better. Now Mac is. You weren’t really wrong. I got razzed a little bit when I made the switch, but I’m still glad I did. There’s some more stuff about not wanting to learn something new. It takes about two weeks to get acclimated to the Mac. Ask your pals over there at Gizmodo for a few app suggestions to replace your Windows tools.

Get yourself a review MacBook Pro and use it for a month or so. You won’t want to give it back.

It doesn’t bother me so much that this guy uses Windows. If he’s comfortable, productive, and happy with it, there’s no reason to switch to something else. The thing that bothers me about this article is how ignorant most of his arguments are. In 2001, I would never have imagined myself using a Mac. The people over there have made some amazing achievements since then. I’m irritated when people compare today’s Windows with 1998 Macs and say they’re better. We should be looking at today’s realities and tomorrow’s prospects.

Smooth Scrolling with ScrollBox.js

June 26th, 2008

Somebody wrote an email asking for a good way to do smooth scrolling with my scrollbox library. If you have some code that will do smooth scrolling on a div, you can use it. The scrollbox will watch what’s going on and automatically update the handle as well as its internal state. If you’re looking for a good solution, here’s a simple one that uses scriptaculous.

	Effect.SmoothScroll = Class.create(Effect.Base, {
		initialize: function(scrollbox, options){
			this.scrollbox = scrollbox;
			this.options = Object.extend({
				to: scrollbox.scroll_pos,
				from: scrollbox.scroll_pos,
				duration: 0.5
			}, options || {});
			this.start(this.options);
		},
		update: function(position){
			this.scrollbox.scrollTo(Math.round(position));
		}
	});

If you have already created a scrollbox like this, var sb = new ScrollBox($('somebox'), {auto_hide: true});, you could trigger a smooth scroll like this:

	//scroll to the top over half a second (the default duration)
	new Effect.SmoothScroll(sb, {to: 0}); 

	// or

	// scroll from top to bottom over 5 seconds
	new Effect.SmoothScroll(sb, {from: 0, to: sb.scroll_max, duration: 5});

You can embellish this with any of the other scriptaculous goodness you see fit. I noticed when testing this that it automatically applied a nice ease in/out effect to the timing of the scroll. Pretty sweet.