July 2011 Archives

AsciiDoc Syntax Highlighting and MacVim

I’ve recently joined the world of AsciiDoc. I’m also the kind of developer who leverages every tool she can find. Since there is no IntelliJ plugin for AsciiDoc, it looks like I’ll have to settle for MacVim as my editor since it supports syntax highlighting of just about everything.

AsciiDoc is not a built in type for the MacVim syntax highlighter, and while AsciiDocs is nice enough to attempt to install the vim highlighting during setup, I still had to complete a few manual steps.

  1. Follow the installation instructions through.
  2. If it does not exist already, create a ~/.vim folder for your user specific vim settings.
$ mkdir -p ~/.vim
  1. Copy the provided vim configuration files in their entirety from the distribution to your ~/.vim folder
$ cp -r ~/tools/asciidoc-8.6.5/vim/* ~/.vim
  1. Fire up MacVim and test out the syntax highlighting by opening the AsciiDoc user manual. How meta is that? :) asciidoc_meta.png

Ta da! Now get hacking! I mean docing!

Transferring your Number from AT&T GoPhone to Google Voice

Transferring your number to Google Voice is the best way to leverage all of the features available. It’s pretty easy to transfer from most providers, but I ran into a few bumps when transferring my AT&T prepaid GoPhone number. To make your transfer a little easier, here is what I learned.

  1. Realize that by transferring this number you will be forfeiting your remaining balance, so you may want to run it down first. Now that this disclaimer step is done, time to get to the actual steps!
  2. Get your account number. This is not on the website or on any documentation you have. You must call 611 from your cell phone, dial 0 at the menu and speak to a customer service representative. Your account number will be a 12 digit number in the form of ####-####-####.
  3. Create a Google Voice account and opt to transfer your cell phone number.
  4. During the flow when prompted for your cell phone information, provide the 12 digit account number in the field provided.
  5. Sit back and wait for the transfer to happen.
  6. If you’d like to use your handset as a forward target for Google Voice, you’ll need a new handset number. Once the transfer is complete, head on over to an AT&T store and ask for a new number for your cell phone. I’ve found the least confusing way is to show up with no SIM card and ask for a new one. They’re free with a new GoPhone plan.

And just like that you’re all set!

yourdomain.com/+: Google+ Profile From Your Domain

Google+ is pretty cool and getting cooler by the day. Circles are a great tool to connect with the people you’ve just met, but right now it’s a bit tricky to share your profile URL since they look something like this: https://plus.google.com/102817283354809142195 (that’s my profile if you’re wondering)

A lot of us already have a short, witty personal domain name, and on these domains the /+ path is almost always available. Wouldn’t it be cool if we could just tell people to find us at http://example.com/+?

Now that we have the awesome idea, how do we implement it? This will differ a bit based on how your web site is set up and how much access you have there.

With Apache .htaccess and mod_rewrite

If you have access to write .htaccess files on your web host, this is a great solution. If you do not know what a .htaccess file is, skip to the next option :)

  1. Create a .htaccess file in the root directory of your domain with the following contents:
RewriteEngine On
RewriteRule ^/?\+$ https://plus.google.com/NUMBER_PART_OF_YOUR_PROFILE [R=301,L]

On nginx

There are indeed web servers other than Apache. One popular alternative is the awesome nginx. I’ve never had the pleasure of using it, but luckily Chris Broadfoot was kind enough to share this nginx rewrite rule.

  1. Drop this configuration into your server’s configuration file.
server {
  server_name yourdomain.com;
  location ^/?\+$ {
    rewrite ^ https://plus.google.com/NUMBER_PART_OF_YOUR_PROFILE permanent;
  }
}

With JavaScript

What if you lack either SSH access or are not comfortable with mod_rewrite? All is not lost! If your website allows you to paste in some JavaScript code you can still set up a redirext. This method is not optimal, though, because it has a way of confusing web crawlers and primitive web browsers. In any case, here are instructions:

  1. Create directory + in the root of your domain.
  2. Add an index.html in that directory with the following contents:
<!doctype html>
<html>
<head>
<script type="text/javascript">
window.location="https://plus.google.com/NUMBER_PART_OF_YOUR_PROFILE_URL";
</script>
</head>
<body></body>
</html>

If you’d like to see this implemented on any other platforms, give me a hollar and I’ll add it :)

Thanks to: