How To Clear an Obstruction in a Child’s Nose

March 10, 2008 by Eric

I know, I know, this title sounds like a joke, but it’s not! We recently learned a neat trick, something that every parent should know. Our three-year-old daughter was playing with little beads and somehow got one stuck up her nose. It was lodged way up the nasal cavity, likely because she had been picking at it trying to get it out. We briefly tried getting it out ourselves, but quickly gave up out of fear that we were only pushing it further in.

We rushed her to the emergency room, and the nurse taught us a neat trick: simply plug the other nostril (the one without the obstruction) with your finger and blow into the child’s mouth. The important thing is to seal your mouth over the child’s (like you would for CPR) and to blow forcefully.

A couple of strong puffs later, the bead popped out. No big deal!

How to Embed Quicktime Videos on your Website

February 18, 2008 by Eric

I spent the better part of today trying to figure out how to host and play video files on my website. This caused me endless hours of frustration, probably because I was trying to use Dreamhost’s QuickTime streaming service. It doesn’t work…or at least I wasn’t able to figure out how to make it work, and believe me I tried (grr). In the course of surfing around the web to find help (could Dreamhost’s support wiki be any more worthless??), I pieced together a solution. Here are the steps:

1. Prepare your video file with QuickTime.

  • Open the file with Quicktime
  • Export the file using “Movie to QuickTime Movie” setting (see below). Make sure you select the “Prepare for Internet Streaming” option and select “Fast Start”

quicktime export settings

2. Upload the file to your site. I created a new “media” folder (e.g., domain.com/media) for all my movie files.

3. Create a new html page and save as a regular html file (i.e., with .htm or .html extension). Here is the code to embed the video file:

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="640"
height="496"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<embed src="/media/sample.mov" width="640" height="496" autoplay="false"></embed>
</object>

Note that you want to add 16px to the height value to show the controls on the bottom of the video player.

I have tested this in Firefox and Safari and it works fine, still need to get on a PC to test it in IE. I’m using QuickTime Pro Version 7.4.1 hosting with Dreamhost.

Here’s an example of the final product.

Dreamhost, PHP Scripts and cURL

February 16, 2008 by Eric

In an effort to teach myself basic programming, I have been playing around with stuff on my personal site. One thing I wanted to do was take the RSS feed from my blog and put headlines on the homepage of my site. I briefly considered trying to figure out how to do this myself, but quickly decided I would be better off just looking for an existing script that I could modify. I found a great PHP script (RSS2HTML) that seemed to fit my purpose perfectly. So I downloaded the script, customized it in TextWrangler, uploaded it to my Dreamhost server, tried to run it and…got the following error:

URL file-access is disabled in the server configuration

Well, this meant nothing to me. After a lot of research and trial and error, I found an article on the Dreamhost support wiki that says:

DreamHost has disabled the PHP option allow_url_fopen. This would normally allow a programmer to open, include or otherwise use a remote file using a URL, rather than a local file path.

I took this to mean that the script as written would not work on Dreamhost. Apparently the problem was the use of an ‘include‘ command in the script.

Here is the snippet I was trying to use:

include("http://www.example.com/script.php");

The alternative, according to this article, is to use cURL. Well, long story short, this solved the problem and now it works great. Here is the new code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/script.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);

You can see the final product here. :)

How to Change the Host File on a Mac

February 16, 2008 by Eric

Changing the host file on a Mac is very easy, but it’s certainly not intuitive. This little tutorial will show you how.

Launch Terminal

Type:

sudo su
vim /etc/hosts
shift-a

Scroll to your desired insertion point and enter the info in this format:

IP address [space] www.example.com [space] example.com

Then the following to save and close the file:

esc
:wq
enter
exit

Done!

This comes in handy when doing development on a new site — point your host file to the dev server and test the site before pushing it live.

Remember to delete the entry when you want to go back to the live site. You can also comment out the entry (if you think you may want to use it in the future) by prepending the entry with a # — example:

# IPaddress www.example.com example.com

Thanks Casey!

Bonus:  Disabling the Firefox DNS cache

Sun Valley Dining Guide

February 16, 2008 by Eric

Here’s a list of my favorite restaurants in Sun Valley:

  • Best of Ketchum: Riccabona’s ($$$$) (map). Formerly Felix’s, Steve Riccabona purchased the restaurant and has continued its tradition of welcoming charm, friendly and attentive service, and simply terrific food. If you’re looking for a great night out, Riccabona’s is not to be missed.
  • Best Date Night: Michel’s Christiania ($$$$) (reviews) (map). Fine French cuisine in an intimate setting, Michel’s is a Ketchum landmark. Best French onion soup anywhere! They also have a great bar if you just want a cocktail and light appetizers.
  • Best “gotta go” Tourist Spot: Pioneer Saloon ($$$) (website) (menu) (reviews) (map). Known for its prime rib and baked potatoes, the “Pio” is another Ketchum landmark. No reservations and very popular, so get there early or be prepared to wait at the bar. The portions are huge so come hungry! Full of neat memorabilia showing Ketchum history.
  • Best Comfort Food: CK’s Real Food ($$$) (website) (menu) (reviews) (map). CK’s is a relaxed eatery in Hailey serving regional northwest cuisine. CK’s uses local organic produce when in season, and also works with local ranchers for their meats. They feature a daily “slow cooked” entree that is not to be missed, literally melts in your mouth.
  • Best for Families: Rico’s Pizza and Pasta ($$) (website) (menu) (map). Simple — but good — pizza and pasta and very reasonably priced. Try their lasagna, some of the best around. Casual atmosphere, lots of families and very kid-friendly. This is a great place to go with the kids and not have a stressful dinner.
  • Best for Appetizers: Sun Valley Wine Co. ($$) (map). This is a terrific wine shop in the heart of Ketchum that also doubles as a wine bar. Couches and comfy chairs in front of a roaring fire, with a few tables to either side, this is the perfect late afternoon escape. Grab a bottle of wine from the extensively-stocked wine racks and order a tasty panini or antipasto plate. More likely than not, you’ll see the owner running around the shop; he clearly loves what he does!
  • Best Burgers: Grumpy’s ($) (reviews) (map). A local favorite for great burgers and beer. The burgers are huge, fast and fresh and the atmosphere is laidback and local. Paired with their classic schooner of beer (32 oz!), this is the perfect afternoon treat. Just don’t whip out your cell phone, Grumpy’s is a place to unwind and disconnect (they don’t even have a phone). Remember to order at the bar, there are no waitresses at Grumpy’s.
  • Best for Groups: Sawtooth Club Restaurant & Bar ($$$) (website) (menu) (map).
  • Best Lunch: Perry’s ($$) (map).