HOWTO read and pronounce URLs
URLs usually appear in written form — online or on paper. Sometimes, URLs are spoken aloud. You’ll often hear URLs read out:
- during television and radio advertisements
- in voicemail messages
- on conference calls
So what? Well, almost everyone gets it wrong.
And you sound like an idiot when you do.
I’ve seen directors of national political organizations and billion-dollar public companies make these mistakes.
In the interest of saving you and your organization future embarrassment, let’s run through a quick example. Suppose we want to give out the URL for Google Voice, the replacement for GrandCentral.
The URL for Google Voice is:
http://www.google.com/voice
You would read it aloud like so:
w-w-w dot google dot com slash voice
What not to do:
- Don’t read out “http://”. Nobody needs to hear “h-t-t-p colon slash slash.” It’s at the beginning of every URL. That’s eight syllables you waste.
- Don’t say “backslash.” A backslash looks like this:
\
. If you type a backslash instead of a slash, your web browser will give you an error. - Don’t say “forward slash.” A forward slash is the default type of slash. It’s either slash or backslash. Don’t waste those three syllables.
Suppose you want to read about my house concerts. The URL for my house concerts site is:
http://concerts.shrub.ca/
You would read it aloud like so:
concerts dot shrub dot c-a
- Don’t read out “http://”. Nobody needs to hear “h-t-t-p colon slash slash.” It’s at the beginning of every URL. That’s eight syllables you waste.
- Don’t say “www” — it’s not in the URL.
- Don’t pronounce the trailing slash. (I’ve never heard anyone do this, but you never know.)
A note about top-level domains
The last part of the hostname is the top-level domain (TLD). For google.com, it’s “com.” For concerts.shrub.ca, it’s “ca.”
If you have a three-or more letter TLD (com, net, org, info, biz), pronounce it like a word. For “eff.org,” say “e-f-f dot org,” not “e-f-f dot o-r-g.”
If you have a two-letter (country code) TLD, spell it out. For Canada (.ca), say “c-a,” not “ka”; for Switzerland (.ch), say “c-h.”
Michelle Obama awes London (and me too)
Visit msnbc.com for Breaking News, World News, and News about the Economy
Dallas police officer Robert Powell is a jackass (and probably racist)
Jackass “officer” pulls his gun during a traffic stop, then takes 13 minutes to write a ticket. Oh yeah, Moats’ mother-in-law died while he waited for the ticket to be written.
Kunkle said Officer Robert Powell has been placed on paid administrative leave in connection with an incident last week in which he stopped a family rushing to visit a dying mother, detaining them for 13 minutes to write a traffic ticket.
…
During the traffic stop, caught on the officer’s in-car camera, Powell berated the driver, 26-year-old NFL running back Ryan Moats, and threatened him with arrest for running a traffic light.“I can screw you over,†said Powell, 25. “I’d rather not do that.â€
…
Powell drew his gun and yelled at her to get back in.
…
Moats and Collinsworth’s father went into the hospital, where they found Collinsworth had died, with her daughter at her side.
HOWTO deploy PHP sites with Capistrano 2
When I learned Ruby on Rails, I found out about Capistrano. This whole automated deployment thing seemed pretty neat. But then my Rails project finished, and I was back to working on a PHP site. There I was, coding along in naive bliss.
Then I started working on voteforchange.com for the Obama Campaign. Nick and I didn’t have the biggest iron or the most … process. But we did have Capistrano for PHP.
A little light bulb went off in my head.
Heather’s sites were a great candidate for Capistrano deployments. I could stick everything in subversion … develop on my PowerBookMacBook Pro and deploy to the DreamHost web server. Professional deployment techniques for a site with an engineering team of one.
One thing was bothering me, though. The VFC Capistrano script was so much longer than the ones I was using for my Rails site. Longer. More complicated. Less elegant.
We were making our own folder structure:
t = Time.now folder = "#{t.year}"+"#{t.month}"+"#{t.day}"+"#{t.hour}"+"#{t.min}"+"#{t.sec}"
Wasn’t Capistrano supposed to do that for me? Yes, it was. So I started looking around. Everyone was pointing at Jon Maddox’s instructions. Those were a good starting point, but I had to make a few changes. Here’s what I learned.
How to deploy PHP sites with Capistrano 2
- Cache your authentication credentials
- Configure Capistrano
- Run Capistrano’s initial setup
- deploy
Cache your authentication credentials
You’re going to want to set up passwordless authentication for both SSH and Subversion. Otherwise, you’ll get prompted every time you check in or deploy. (This also makes using TextMate‘s subversion bundle harder.)
- Cache your SSH credentials. Generate your keypair. On your local machine, do this:
ssh-keygen -t rsa chmod -R 700 ~/.ssh
Repeat this on the web and svn servers.
-
Upload your public key from your local machine to the web (svn) server:
ssh www.mysite.com "echo '`cat $HOME/.ssh/id_rsa.pub`' >> .ssh/authorized_keys"
Do the same thing from the web server to the svn server.
-
Often, your username on your local machine is not the same as your username on the subversion server. To tell subversion what name to use, edit
~/.ssh/config
, adding lines like these:Host svn.mysite.com User joeblow Host www.mysite.com User joeblow
Test this out by typing
ssh www.mysite.com
. If you still get prompted for a password, make sure the permissions are correct on the webserver (chmod -R 700 ~/.ssh
). - On the web server, cache the subversion credentials. Just check out the repository:
svn co svn+ssh://svn.mysite.com/svn/mysite/trunk
Enter your password when prompted. Subversion will cache this information in
~/.subversion/auth/
. You can now delete the trunk directory.
Configure Capistrano
Normally, you prepare a project for Capistrano by typing capify
. You don’t really need to do that for PHP sites, because you don’t need a two-part Capistrano script. Instead, just create a text file called Capfile
that looks like this:
load 'deploy' if respond_to?(:namespace) # cap2 differentiator Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } set :use_sudo, false set :home_path, "/var/www/mysitename" set :checkout, "export" set :repository, "svn+ssh://svn.mysite.com/svn/mysite/trunk" role :web, "www.mysite.com" namespace :deploy do task :restart do end end
Run Capistrano’s initial setup
Run the Capistrano setup command: cap setup
. This creates the releases/
and shared/
directories on the server.
Deploy
To get the site up, just run cap deploy
.
Tips, tricks and notes
- Following DreamHost’s Capistrano instructions, I set
use_sudo
to false. On a shared hosting site, I didn’t have root. Duh. Why is this the default option on Capistrano? Dunno. - You need to disable Capistrano’s restart task. Since we aren’t using Rails, there was no mongrel, and nothing to restart.
So I tried this:
task :restart do end
I still got an error. It turns out you have to specify the Capistrano namespace:
namespace :deploy do task :restart do #nothing end end
-
What about database passwords for your web site? You don’t want to store those in the subversion repository. As the Cap FAQ explains, stick a configuration file elsewhere on the server, and copy in a post-deploy task.
task :copy_database_configuration do run "cp #{home_path}/config/#{config_file} #{release_path}/helpers/config.php" end after "deploy:update_code", :copy_database_configuration
-
If you’re developing with other people, having your SSH script prompt for your SSH username can be helpful:
set(:user) { Capistrano::CLI.ui.ask("SSH username: ") }
-
You can configure your script to do different work on staging versus production deployments. There are probably better ways to do this, but here’s what I have working for me. Suppose you have staging and production on the same server:
if ENV['PRODUCTION'] set :home_path, "/var/www/production" else set :home_path, "/var/www/stage" end
By default,
cap deploy
deploys to stage. To deploy to production, runPRODUCTION=1 cap deploy
(assuming bash). -
If you’re deploying WordPress, you will want to make sure the uploads directory is writeable. You might also want a special .htaccess file put in place (I use different ones for localhost and production). Here’s how to do this:
task :after_symlink do run "cp #{current_path}/config/show_htaccess #{current_path}/.htaccess" run "chmod -R a+w #{current_path}/wp-content/uploads/" end
Of course, your subversion deployment will overwrite your existing uploads directory, so this particular example is of limited value.
More details
Clayton Lengel-Zigich’s tips for using Capistrano with PHP and the Capistrano FAQ are very helpful.
Jim Cramer: He’s like a dartboard that talks
REI grammar fail
HOWTO stop receiving phone books
You can call the following Yellow Pages producers to be removed from their lists:
- AT&T/YellowPages (formerly SBC/Bellsouth): 800-792-2665 or 800-248-2800
- Verizon (Idearc): 888-266-5965 or 800-888-8448 or 800-555-4833
- Valley Yellow Pages: 800-350-8887
- Dex: 877-243-8339
- Yellow Book: 800-373-3280 or 800-373-2324 or 800-929-3556
You can also sign a petition to request that the Yellow Pages Association use an opt-in or at least create an opt-out registry.
A site called Yellow Pages Goes Green says they will do the legwork for you. I can’t vouch for them.
Apparently the Yellow Pages folks are really sktechy, hiring lobbyists to quelch opt-out movements.
HOWTO set the default target in Xcode
Your Xcode project has one or more targets. Each target builds something—a command-line tool, a framework or an application.
The Target popup menu lets you determine the active target. The active target gets built when you click “Build” or “Build & Go.”
But what about the default target? What is it, and why do you care? Well, if you build from the command line—using xcodebuild
—the default target (and only the default target) gets built.
So how do you set it? I looked around in the help, and it wasn’t obvious. Turns out the answer is in the xcodebuild
man page:
By default, xcodebuild builds the first target listed in your project, with the default build configuration. The order of the targets is a property of the project and is the same for all users of the project. The active target and active build configuration properties are set for each user of the project and can vary from user to user.
The default target is the first target listed. In this example, the default target and active target are the same — The “Palm Pre UI” Cocoa application:
Suppose we wanted to make the “Shell tool” command-line tool the default target. Simply drag it so it becomes the first item on the list:
Now we’re done. The active target is still the “Palm Pre UI” Cocoa application, but the default target is the “Shell tool” command-line tool:
gap.com == fail
Store hours? What store hours?
The Gap web site was clearly not designed by anyone who actually wanted to shop. It might have been designed by people who wanted to sell things, but that doesn’t help me.
So what’s wrong?
- Store hours are not listed. Anywhere! (I tried calling the Burlingame store, hoping to get voicemail, but instead got nothing.)
- Search is almost useless. I can search for jeans in my size, but I can’t restrict the search to items in a price range or search by colour.
- You cannot tell which Gap stores have which items in stock.
- The store locator is broken. When you search for stores in “San Francisco,” you get this error:
We couldn’t find your exact address. Please choose a location from the list below or try another address.
1. San Francisco, California
United States
Use this address2. San Francisco (county), California
United States
Use this addressNext, you can search for all Gap-affiliated stores. You can also search for specific subbrands (GapKids, babyGap, GapBody, GapMaternity, GapOutlet). What you can’t do is search for Gap stores only, excluding the subbrands.
- Why isn’t “in-store pickup ($0)” one of the shipping options? It works really well for REI.
- Why are some sizes out of stock? I can understand that individual stores can’t stock every size-item-colour combination, but the web site (warehouse) has no excuse. If something isn’t in, at least let me order the backordered item.
People, if you want my money, don’t make it hard for me to give it to you.