Tips & How To's

.htaccess Mobile Browser Redirect

Checkout the latest version of the ruleset first.
I just finished building out a simple little mobile site for When I asked Google the best way to detect mobile browsers with PHP, it led to me this PHP code by Andy Moore. After a few minutes of contemplating the best way to include the code in the existing CMS framework I realized that it would probably be best to move the functionality outside of PHP. I mean, why clutter up display code with HTTP traffic manipulation. The website’s main traffic cop Apache is already perfectly capable of handling the duties already.

Here’s how to redirect mobile traffic using a .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/m/.*$
RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser||windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteCond %{HTTP_USER_AGENT} !macintosh [NC] #*SEE NOTE BELOW
RewriteRule ^(.*)$ /m/ [L,R=302]

I did my best to translate the PHP code verbatim, if you want to understand what each line is doing you’ll want to check out the original code. Testing for all those user agents is probably a little overkill, but Mr Moore is a “dotMobi certified mobile web developer” I’m going to assume he knows what he’s talking about.

*The “tosh” user agent (I’m assuming this is for a Toshiba browser?) happens to catch browser on any browser on the Mac OS. I had to add !macintosh to skip macs. The iPhone/iPod Touch does not identify itself as “macintosh.”

Google Tips & How To's

Add Facebook Events to Google Calendar, 2 Simple Steps

I just discovered the most amazing, useful mashup. You can automatically add your Facebook events to your Google calendar! This way whenever you accept an event invite it shows up on your google calendar, with all the details! It just takes 2 simple steps.

  1. Pull up your facebook events page, click the “Export Events” link at the top. That brings up a little dialogue box with a URL. Copy that URL.fbevent.png
  2. Open your Google calendar settings page. Click the “Calendars” tab, under “other calendars” click “add calendar, click the “Add By URL” tab. You’ll be presented with a form that’s able to accept the URL you just copied from Facebook!

You’ll now see your Facebook events in Google calendar. Thusly, minimizing the amount of websites you have to open to figure out when you have time to visit your mother.

Tips & How To's Websites

WhyFireFoxIsBlocked is wrong! Adblock Plus is 100% Detectable! does not know what they’re talking about. Ad Block Plus is 100% lame and 100% detectable.

The following code detects ad block plus:

<script language="javascript"> var disabled = false; </script>
<script src="something.js?thisistotrickyou=
<script language="javascript">
// DO SOMETHING HERE, like a redirect
alert("You Are Using Ad Block Plus or some other blocking software! Please don\'t, our site operates on ad revenue."); }

disabled = true;

Proof of concept

Tips & How To's

Adding Linebreaks in Open Office Calc

To add a linebreak to open office’s version of excel – calc, use ctrl+enter.
Not alt+enter like in Excel or shift+enter like many web-based editors.

Tips & How To's

7 Tips On How To Talk To Customer Service Reps

I have more experience as a phone jockey than most people would be willing to admit to. I worked as a technical support (and sometimes billing) agent for Comcast High Speed Internet for over 2 years and I worked as a medical survey taker for about a year. Needless to say I have dealt with thousands of people over the phone, both as someone responsible for answering questions and solving problems; and as someone looking for answers to very specific questions, as a surveyor I was confronted by a lot of uncooperative secretaries and administrative assistants. These years of working on the phones have given me a lot of insight on how call centres operate, what needs to be done to get what you want and how people respond to certain lines of questioning. I have assembled some tips to help all you normals whos idea of a good job is not spending hours talking to people on the phone:

  1. Plan Ahead: Take 5 minutes before that call to jot down 3 or 4 distinct points that you need to resolve (if you have more than 4 issues you should probably just quit your service provider). During the call refer to each point separately, don’t move on to the next point until you have a satisfactory resolution to the first one. I usually plan out a flow chart of responses, counter responses and if/else statements in my mind ahead of time, I think this probably has more to do with the way my mind works than anything else. Though it may be helpful to you to try to anticipate what the rep’s response will be to a given question.
  2. Smile, Be Courteous: One of the first things they teach you in CSR training is to always smile, the customer can hear you smiling over the phone. As dumb as it sounds, it actually is true. The same thing holds true as the customer. If you’re too upset to be able to smile, you shouldn’t make the call. Be courteous and respectful, always assume that the rep knows what he or she is talking about – until they prove otherwise – and address them accordingly. If they do prove to be un-knowledgeable or uncooperative skip to #5.
  3. Be Logical: Complaining about the service, becoming angry about your last bill, or otherwise being overly emotioal generally won’t get you anywhere. Front line reps don’t usually have the ability or authority to give you a credit or fix your service just to make you happy and get you off the phone. Try to be logical, logic is hard to argue with. If you are unhappy with the service, have clear examples of what you are unhappy about and why. Ask the rep if they have any way of verifying your quality of service (such as connection logs on a cable modem), or if not what the best way is to report the problems and document them on your account. If you have a billing issue, make sure you understand the billing cycle properly, and clarify the line items you don’t understand, if there is a legitimate billing error, it should be totally obvious and you should not have a problem getting it corrected. Again if the rep is totally illogical or does not seem very knowledgeable about company policy, or if the just can’t do simple math, skip to #5.
  4. Don’t volunteer information: This one is a little counter-intuitive. If you have to call back more than once about an issue, don’t bother referring to the last phone call or volunteering any information – it’s a waste of time. Most companies keep sketchy notes at best, a lot don’t even bother to note your account. Start each call like a new call. An experienced customer service rep will be able to identify what your calling about and how to fix it within the first 30 – 45 seconds of your call – based solely on your choice of words and tone of voice. Talking about the last call usually just confuses the rep and complicates the conversation. If you’re finding yourself calling back about the same issue numerous times, see point #3 and #5.
  5. Escalate: Good call centres have a pool of agents acting as “supervisors” set aside to handle “escalations.” Although in most cases they are not actually supervisors, they are almost always much more experienced, they often have better training, access to more tools than a regular agent and they’ll usually have the authority to more liberaly apply credits to you account.  If you’re getting nowhere in the conversation with the front line rep, ask for a supervisor. Important insider note: Sometimes call centres have policies to discourage escalation. For instance, as an agent working for Comcast, I was not allowed to transfer a caller to a supervisor until they’d ask 3 times. Additionally: If you’re calling about a tech support issue, it may help to ask for a tier 2 tech. Tier 2 support doesn’t seem to be overly common, but it’s worth a shot.
  6. Ask for documentation: If you are ever given information that you have a hard time believing – like a super awesome calling plan or some sort of free kitten promotion – ask for documentation. Get the rep’s name and ask for a ticket number. Even if the rep completely fabricates this information, being able to say “last week so and so told me, she gave me ticket number 1337”  will give you some extra credibility if you ever need to call back about the issue, or verify the details. If you want to be a real jerk, ask the rep to read back the contents of the ticket.
  7. Know when to hang up: Any decent sized company – i.e. any company you might be having trouble communicating with – will have litteraly hundreds, if not thousands of agents taking calls at any given moment. If you’re not getting anywhere with a customer service rep, if you think you might start to yell, just hang up. You’ll probably get someone better when you call back.

If these tips don’t help, seriously consider switching to a different provider. Or quit whining!