Skip to main content

Benjamin Oakes

Photo of Ben Oakes

Hi, I'm Ben Oakes and this is my geek blog. Currently, I'm a Ruby/JavaScript Developer at Liaison. Previously, I was a Developer at Continuity and Hedgeye, a Research Assistant in the Early Social Cognition Lab at Yale University and a student at the University of Iowa. I also organize, ICRuby, OpenHack Iowa City, and previously organized NewHaven.rb. I have an amazing wife named Danielle Oakes.

Filtering for the month January, 2011. Clear

WebKit-specific CSS rules (or hacks, if you prefer)

by Ben

There are many things about WebKit-based browsers like Chrome and Safari that I really like. One of them is the file selector widget; I’ve grown so used to being able to drag-n-drop files onto the control to upload that I really miss it when I use Firefox, IE, or when the developer decided to only give a Flash-based file uploader. It’s definitely saved me hours in poking around in my files.

Even though I think the widget is great usability-wise, it only really looks good on light backgrounds. It’s completely impossible to tell what file you’re uploading if the widget is on a black background:

That’s definitely not the case in Gecko (Firefox, etc.) or Internet Explorer. They don’t give the same readability problems on a dark background.

What can you do about it?

Well, it turns out you can target WebKit-based browsers with a relatively simple media query. Conceptually, it’s similar to using a conditional comment to have an “IE-hacks” stylesheet.

In that spirit, I decided to make a webkit.css file with WebKit-only rules. Given the support of media queries across browsers and the WebKit-specific -webkit-min-device-pixel-ratio, the following makes it possible to give CSS that only affects WebKit.

Within <head> add:

<link href="webkit.css" media="screen and (-webkit-min-device-pixel-ratio:0)" rel="stylesheet" type="text/css" />

Or, if you don’t want a separate file, you can avoid that by embedding the rule into an existing stylesheet like so:

@media screen and (-webkit-min-device-pixel-ratio:0) {
  /* Your CSS */

Within <head> add:

Then, to style all the background colors so that <input type="file" /> is readable, you can do something like this:


input[type="file"] {
  background-color: white;
  padding: 3px;
  -webkit-border-radius: 7px;

That’s simple enough to fix all file inputs in WebKit, but IE 6, 7, 8 and Firefox continue to work the same way.

Here’s the result:


Captions on Sanyo TV with Universal Remote

by Ben

Another in my series of random electronics I’ve repaired
around the house: we have a Sanyo DS20930 TV and a universal remote (a Philips SRU2103/27 to be exact). The code we were using seemed to work for almost everything, except for captions and a couple other odd functions. After scouring a couple of manuals, menus, etc. I decided to try more codes and ended up using code 0612.

Now all the buttons work, even though 90% of them did before. We were just using subtitles on DVDs, etc. but a couple things we watch only have closed captioning. Just a note to other people in the same type of situation.

Fixing Tracking on a Sharp VC-A593 VCR

by Ben

Sharp VC-A593 VCR

Alright, you may be wondering why I’m making a blog post about a VCR in 2011. Blu-Ray is supposed to kill DVD any year now, right?

A VCR is actually a more relevant device in 2011 than I would have originally thought, mostly because of one reason: lots of people don’t want VHS tapes anymore. It’s really easy to find all sorts of free and cheap copies of movies you would want but wouldn’t buy otherwise. Goodwill and Salvation Army are good examples; we’ve spent a few dollars and ended up with a dozen movies, including older Star Trek movies I’d never seen (picked up for $0.25 a piece), along with lots of good 80s, 90s, and early 2000s movies. Freecycle and “urban recycling” (or “curb shopping”) often turn up with good offers too, but for free. They all play with better quality than I seem to remember, too.

When it comes down to it, price really is king. Sure, they may not play that great on a HDTV, but since we’re not planning to upgrade soon (or re-buy all our movies on Blu-Ray as Hollywood seems to be hoping), it’s a great option for getting a lot of good movies for next to nothing — especially since we don’t have cable.

That said, we recently had a problem with our VCR (also free, of course): The tracking looked to be completely off, leaving us with nothing but static. We had thought Delta ruined some tapes in our recent holiday trip (they ruined enough of our other things), since we’ve previously used the VCR just fine.

My first instinct was to use the channel up/down buttons on our universal remote to try to adjust the tracking. That didn’t help at all. The menu wasn’t very helpful, either. It’s a Sharp VC-A593, which I couldn’t find more than a few questions about and dead links to manuals online. After testing cable connections and with tapes we’ve previously viewed, it definitely was a tracking problem. But I did find a solution.

Solution: Use the channel up/down butons on the VCR itself. You may have to rapidly push up/down 50+ times to see any difference at all, but eventually it came back to life.

At some point, the tracking fell out of alignment and we hadn’t noticed. We were about to throw it out, until I played around with it some more.