Archive for the ‘BlogTorials’ Category

03 May 09 _ How to flip text upside-down on Twitter

Here’s a little trick I just saw on Twitter that will let you tweet upside down. All you do is go to this website and enter the text that you want to flip and reverse:

http://www.revfad.com/flip.html

¡ǝldɯıs ʇɐɥʇ s,ʇı
It’s that simple!

Follow us on Twitter: @AWPNY

21 Mar 09 _ How to change the default server time on GoDaddy (linux)

I found this easy solution for changing GoDaddy’s default server time so my PHP 4 scripts would display the proper dates and times when fetching and displaying an RSS feed with Simplepie. Just add this code to your script before you include the “simplepie.inc” file (or before you begin to calculate dates or times on the page):

<?php
//set timezone
putenv ('TZ=America/New_York');
mktime(0,0,0,1,1,1970);
?>

Just replace America/New_York with whatever your local time zone is. Check this page for valid entries: http://us.php.net/manual/en/timezones.america.php

For PHP5.1 or newer use date_default_time(’America/New_York’).

Also check this page in the Simplepie docs for reference.

Cheers!

09 Mar 09 _ How to get CakePHP to work in a subdirectory

I recently had trouble getting CakePHP running properly in a subdirectory on the Mosso cloud. The main site URL is http://thinkandthrive.com, and the Cake app lives in a folder off the site root called “tw”. So I was able to connect to http://thinkandthrive.com/tw/, but not to http://thinkandthrive.com/tw (without the trailing slash).

The fix to get Cake working in the subdirectory was to add a single line to the .htaccess file in the Cake root directory ( the “/tw” folder in my case). The .htaccess file should look something like this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]

Add this line after “RewriteEngine on”:

RewriteRule /YOURCAKESUBDIR$ /YOURCAKESUBDIR/ [L]

Obviously, replace “YOURCAKESUBDIR” with the subdirectory your Cake app in running in. So my .htaccess file now looks like this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /tw/
RewriteRule /tw$ /tw/ [L]
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]

(The third line, “RewriteBase /tw/”, is necessary to get CakePHP working in the Mosso hosting environment. If your Cake installation is at the server web root (the Mosso “content” directory) then it should read simply “RewriteBase /”. If your site is not hosted at Mosso just eliminate this line.)

Thanks to Jeff Loiselle for the quick fix: http://jeff.loiselles.com/wordpress/?p=22

13 Nov 08 _ Real Life Tutorial: Removing Cream Cheese From Apple’s Tiny Keyboard

No Cream Cheese

We love our tiny, shiny Apple Keyboards (aside from the ridiculous USB placement/depth). We also love eating lunch at our desks. Today happened to be one of those days where lunch somehow ended up on my glorious keyboard. It could have been worse (soup). It could have been better (soft dinner rolls). But it was a bagel with cream cheese. Face down.

It wasn’t pretty, and rather than taking photos of the incident (depressing and poorly lit) I’ll walk you through how to remove a slightly messy substance from a slightly ridiculous keyboard. (more…)

20 Oct 08 _ WordPress Permalink Redirect (Archive 404)

After upgrading our AWP Blog to WordPress to 2.6 (we are eagerly awaiting the 2.7 visual transformation, by the way), we noticed in the shuffle our Permalinks got messed up. For example, searching for my post div align top center, which is #1 right now, Google gives us blog.awpny.com/archives/206 (not a permalink). Following that URL used to get us to our 404 Error page. Whoops! Not so great for SEO ratings, not to mention reader frustration!

WordPress doesn’t automatically redirect your old permalinks to the new permalinks, unfortunately. The permalink for the above post is http://blog.awpny.com/2008/03/position-a-div-element-absolute-and-align-it-top-center/. I did a little research. More than a few people have been frustrated with this problem, as you can imagine. I discovered this plugin Permalink Redirect WordPress Plugin. It works perfectly! Thank you Scott Yang’s Playground.

Simply download & install the plugin. Edit the plugin settings (under Settings>Permalink Redirect). For our blog, in the ‘Path pairs to redirect from and to’ box, I used:

[from] /archives/%post_id% [to] /%year%/%monthnum%/%postname%/

And now, Google search results take me to the post, rather than a 404 Error page!