Use htaccess to Rewrite Folder Structure

*geek alert*

I spent a long time trying to figure out this solution, so I wanted to share it here to possibly help someone else. If you are looking to redirect an existing path on your site, like:

www.mysite.com/old/folders/content
to something like:
www.mysite.com/new/directory/content

Add this (and tweek to your needs) to your .htaccess file on the root of your website.

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^old/folders(.*)$ http://www.mysite.com/new/directory$1 [L,R=301]

— December 30th, 2008

Christmas Mix 2008

I used to create Christmas mixes and burn CD’s for my family and friends. Consider yourself lucky if you are the proud owner of the famous “Pete’s Christmas Mix 2002″. It’s been a while since I put one together, I mean who listens to CD’s anyway?

This year I’m posting my mix on my site for your streaming enjoyment. Bonus: I threw in my favorite line from my favorite Christmas movie, Christmas Vacation.

http://www.paulmayne.org/music/christmas2008/

— December 18th, 2008

Twitter HTML Badge Code

I’ve had a some requests for the code that I use to populate my sidebar with my Twitter status in HTML. Twitter’s default badge offerings are mostly worthless and at this point very ugly. I basically stripped out some JavaScript to parse and display your Twitter JSON file using JavaScript.

If you view source on this page (twitter.html), you can copy and paste the needed parts into your own page.

  1. CSS Style (could be in an external CSS file or in the html head), customize to your liking.
  2. Two JavaScript functions (in the html head).
  3. HTML code – using span id’s to place the parsed data into.
  4. JavaScript command to initiate the functions – I recommend putting this as the last thing on your page before the </body> tag. Sometimes it may take a few seconds to get the data back from Twitter and you don’t want your page waiting on Twitter to finish loading.

Now you need to customize it for your own Twitter account:

  1. Change the “via Twitter” link to point to your Twitter page.
  2. Change the “51373.json” in the last javaScript call to your Twitter ID. To find your Twitter ID, clicking on the RSS link on your Twitter page and look at the number in the URL.

Use and customize as you wish, Enjoy.

UPDATE:

Thanks to Tuamo for pointing out a solution to a JavaScript bug in Internet Explorer. I have updated the sample code linked above. Cheers!

— December 3rd, 2008

Bishop Allen

There’s something about seeing a good band perform live that makes you appreciate their music even more. A couple of weeks ago my friends and I checked out Bishop Allen (photos | video) at the intimate venue, Kilby Court in Salt Lake City. They put on a fantastic and energetic set, they played most all the songs I love and a few new song from their upcoming album that sound really good. The new album is due in March ’09, Which I can’t wait for, and I think they said they are coming back to Salt Lake around that time.

Justin Rice

After the show I discovered the lead singer, Justin Rice, also does some acting. He starred in this little black and white art house film called Mutual Appreciation. I checked it out. Rice does a great job playing a young musician moving to New York. It’s pretty funny, ironic and awkward at times. Director Andrew Bujalski, who also acts in this film, has a great style.

— November 30th, 2008

Goodbye Grandpa Mayne

My Grandpa Mayne passed away last week (fascinating obituary below) at the age of 88. It was not a huge surprise as his health had been declining, but we thought he had at least another year in him. I was very close with my grandpa as he and grandma have always been very close with my mom and dad.

He built a cabin on Soldier Creek Reservoir which we’ve used as a family cabin my whole life and is one of my favorite places in the world. He and grandma also went on summer vacation with us every year in Sun Valley Idaho, my other favorite place on earth.

Working on the Cabin

He taught me how to fish, to drive a boat, fix cars and how to be deeply interested in the amazing things of this world. Along with a few of my cousins (who shared wonderful memories), I was asked to share a few memories at grandpa’s funeral, so I will share a few of those here as well.

From engines, to mechanics, to electrical to architectural to technological, it all just made sense in his mind. It was like he had a deep understanding of everything he ever saw. He was so inquisitive. I would show him my latest gadgets, computers or new software programs and he was so genuinely interested in how they were built. You could see it in his eyes, he just want to to remove the screws, take stuff apart and see how it worked on the inside.

We had a special connection with our shared interest in computers and technology. Grandpa was in his 80’s and without any training, he built, repaired and upgraded computer hardware and software for friends and family. My dad once told me, “it’s not that grandpa is interested in fixing computers, it’s that he’s too cheap to buy new ones.” There’s some truth to that for sure. He was always scanning the ads for the best deal on a new DVD burner or RAM upgrades.
Not to mention, him buying a ink refill kit online that allowed him to inject ink into his empty, disposable cartridges as he would not have to buy new ones. I tried to convince him it was not worth all the mess and hassle, but he was certain it would save him a buck. (Grandpa had plenty of money, but apparently growing up in the depression makes people conserve money, and grandpa would rather give his extra money to his kids, and he sure did generously.)

He never went anywhere without his pocket protector full of pens and his notepad. He took notes on everything interested for use in later research or thought.

As much as the new, fast moving technology baffled him at times, he was never afraid to dive in and figure out how to do something.

He devised a contraption that allowed him to record his 8mm reel videos and slideshows to DVDs with annotation. He shot them into a box that mirrored them into a digital video camera which he plugged into a DVD recorder. He would play these old videos and annotate as they went, complete with an old 70’s microphone and background music playing on an old tape player. He burned copies for all his family and they are truly special.

He was 86 years old when he was doing this stuff and playing around with stuff that scares most older people off. He had an email address he checked regularly and loved to receive photos of grandkids. Of course he would always print them off and be out of yellow toner. He was the sweetest.

My dad would say, it’s not fair! Grandpa gets to eat all the same junk food I eat and he never gains a pound. It’s true, grandpa was the biggest chocolate lover in the world. It was fun to keep offering him more cake and ice cream at parties and he would continue to put it down.

My sweet wife Jana’s favorite memory was watching my dad and grandpa sit ont he couch together, telling stories and neither one knew exactly what the other one was talking about because (both being hard of hearing) they were both too stubborn to wear hearing aids.
She said, at least now, in heaven, they can hear what they are saying to each other.

He confirmed me a member of this LDS church in a blessing I will never forget. He was a brilliant, inspiring man, full of life and lived his life to the fullest. I will miss grandpa Mayne dearly.

Grandpa Mayne and Me

Read the rest of this entry »

— October 16th, 2008