<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Travis Beck</title>
	<atom:link href="http://travisjbeck.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://travisjbeck.com/blog</link>
	<description>The Modern Web</description>
	<lastBuildDate>Thu, 10 Nov 2011 07:31:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Solved php curl unable to resolve host</title>
		<link>http://travisjbeck.com/blog/php/solved-php-curl-unable-to-resolve-host/</link>
		<comments>http://travisjbeck.com/blog/php/solved-php-curl-unable-to-resolve-host/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 07:31:31 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=153</guid>
		<description><![CDATA[I had a problem on a new rackspace cloud server i had just set up where curl called from php was unable to resolve hosts, but that same curl command called from the command line ran just fine.  Turns out the problem was that apache was unable to read /etc/resolv.conf because of the file permissions. [...]]]></description>
			<content:encoded><![CDATA[<p>I had a problem on a new rackspace cloud server i had just set up where curl called from php was unable to resolve hosts, but that same curl command called from the command line ran just fine.  Turns out the problem was that apache was unable to read /etc/resolv.conf because of the file permissions. Change the permissions to 644 and it works fine now.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/php/solved-php-curl-unable-to-resolve-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone 4s and iPhone 3gs Network Speeds Comparison</title>
		<link>http://travisjbeck.com/blog/iphone/iphone-4s-and-iphone-3gs-network-speeds-comparison/</link>
		<comments>http://travisjbeck.com/blog/iphone/iphone-4s-and-iphone-3gs-network-speeds-comparison/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 22:27:30 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=144</guid>
		<description><![CDATA[I just got my 4s and decided to check how much faster the network is with the new antennae than my old 3gs.  Here&#8217;s the outcome, I am using  the speedtest.net mobile speedtest app.]]></description>
			<content:encoded><![CDATA[<p>I just got my 4s and decided to check how much faster the network is with the new antennae than my old 3gs.  Here&#8217;s the outcome, I am using  the <a href="http://itunes.apple.com/us/app/speedtest.net-mobile-speed/id300704847?mt=8">speedtest.net mobile speedtest app</a>.<span id="more-144"></span><a href="http://travisjbeck.com/blog/wp-content/uploads/2011/10/photo.jpg"><img class="aligncenter size-medium wp-image-145" title="photo" src="http://travisjbeck.com/blog/wp-content/uploads/2011/10/photo-300x226.jpg" alt="" width="300" height="226" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/iphone/iphone-4s-and-iphone-3gs-network-speeds-comparison/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Twiki on a Media Temple DV Server</title>
		<link>http://travisjbeck.com/blog/random/installing-twiki-on-a-media-temple-dv-server/</link>
		<comments>http://travisjbeck.com/blog/random/installing-twiki-on-a-media-temple-dv-server/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 21:09:18 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=133</guid>
		<description><![CDATA[After many failed attempts at getting twiki to work on our server by following their installation guide, i finally figured it out. The trick is to turn off mod_perl and set the correct permissions of the twiki folder. Problem The problem i was running into was when i got to the /twiki/bin/configure part of the [...]]]></description>
			<content:encoded><![CDATA[<p>After many failed attempts at getting twiki to work on our server by following their installation guide, i finally figured it out.  The trick is to turn off mod_perl and set the correct permissions of the twiki folder.<span id="more-133"></span></p>
<h2>Problem</h2>
<p>The problem i was running into was when i got to the /twiki/bin/configure part of the twiki install instructions i would get a white page and the error log simply said &#8220;Premature end of script headers&#8221;. I would then tweak endlessly with different configurations only to come up with the same error.  It wasnt until i looked in the suexec_log on the server under /var/logs/httpd that i was able to solve the problem</p>
<h2>Solution</h2>
<p>This particular install was on a subdomain of wiki. I unzipped the installation files to &#8220;/var/www/vhosts//subdomains/wiki/httpdocs/twiki/&#8221;.  The installation docs tell you to chown the entire directory as apache:apache.  This will not work on your DV.  Instead you need to use the ftp user as the user and psacln as the group.  so you would do &#8220;chown -R :psacln twiki&#8221;  replace  with the ftp user for that subdomain. Most of the time this is already the case if you uploaded via ftp under that username.  The other thing you want to make sure of is to turn off mod_perl.  You can do this in the domains apache config file.  This should be located at &#8220;/vaw/www/vhosts//conf/httpd.include&#8221; Now i know the comments at the top of the file tell you not to modify it but to use vhost.conf file instead, but i do not know how to turn off mod_perl that way,  If you do please let me know in the comments.  So we&#8217;re looking for the vhost declaration for our subdomain of wiki and looking for the line that says:<br />
<code><br />
SetHandler perl-script<br />
PerlHandler ModPerl::Registry<br />
Options ExecCGI<br />
allow from all<br />
PerlSendHeader On<br />
</code></p>
<p>This will probably be listed twice for your subdomain, once for :80 and once for :443<br />
<strong>Change that in both places to </strong><br />
<code><br />
# SetHandler perl-script<br />
# PerlHandler ModPerl::Registry<br />
Options ExecCGI<br />
allow from all<br />
PerlSendHeader On<br />
</code><br />
Basically just comment out the lines to set perl scripts to execute under mod_perl. So that should do it, save that, restart apache and give it a whirl.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/random/installing-twiki-on-a-media-temple-dv-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the Zip Code from an HTML5 GeoLocation API Call</title>
		<link>http://travisjbeck.com/blog/javascript/getting-the-zip-code-from-an-html5-geolocation-api-call/</link>
		<comments>http://travisjbeck.com/blog/javascript/getting-the-zip-code-from-an-html5-geolocation-api-call/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 20:40:06 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=120</guid>
		<description><![CDATA[The HTML5 Geolocation API is built into newer browsers and returns the approximate latitude and longitude of the device in JSON format. View Demo Latitude and longitude is great for maps, but sometimes you need additional information, like an address or zip code. Unfortunately the native Geolocation API does not provide this functionality, but luckily [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.w3.org/TR/2008/WD-geolocation-API-20081222/">HTML5 Geolocation</a> API is built into newer browsers and returns the approximate latitude and longitude of the device in JSON format.<span id="more-120"></span></p>
<p><a href="/files/getzipcode/">View Demo</a></p>
<p>Latitude and longitude is great for maps, but sometimes you need additional information, like an address or zip code. Unfortunately the native Geolocation API does not provide this functionality, but luckily <a href="http://code.google.com/apis/maps/documentation/geocoding/">Google&#8217;s Geocoding API</a> does.  Google&#8217;s Geocoding API has the ability to do what&#8217;s called reverse geocoding.  You give it latitude and longitude and it gives you nearby addresses in a nice neat JSON package.  Here&#8217;s an <a href="http://maps.google.com/maps/api/geocode/json?latlng=40.714224,-73.961452&amp;sensor=false">example</a> of the JSON returned by a reverse geocode lookup.  As you can see, it contains a lot of information about addresses around that area.  However for this particular article we are only interested in the Zip Code of the first result.</p>
<p>One caveat of using Google&#8217;s Geocoding API in JavaScript is that there is no way to add a callback to the end of the request. This rules out the cross-domain AJAX method of dynamic script tag embedding as a method of retrieving the data.  Currently the easiest way to achieve cross-domain AJAX calls is by using a proxy. A proxy is a server-side script that resides on the same domain as your client script and acts as a middle man between the two domains.  Your script makes an ajax call to the proxy, the proxy retrieves the data from the other domain and returns it back to your script.</p>
<p>Heres my proxy.php file</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$path</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'path'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'path'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'path'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$path</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Open the Curl session</span>
<span style="color: #000088;">$session</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// If it's a POST, put the POST data in the body</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'path'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$postvars</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$element</span> <span style="color: #339933;">=</span> <span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$postvars</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'='</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$element</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #990000;">curl_setopt</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #000088;">$postvars</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Don't return HTTP headers. Do return the contents of the call</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Make the call</span>
<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// does the service return XML or JSON? Set the Content-Type appropriately</span>
<span style="color: #000088;">$headerType</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// 'text/xml' or 'application/json'</span>
<span style="color: #000088;">$headerType</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$headerType</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$headerType</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'text/xml'</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//default</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$headerType</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Here&#8217;s the JavaScript.  Notice I&#8217;m using jQuery.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> GETZIP <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
      getLocation<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#status'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'searching...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">geolocation</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            navigator.<span style="color: #660066;">geolocation</span>.<span style="color: #660066;">getCurrentPosition</span><span style="color: #009900;">&#40;</span>GETZIP.<span style="color: #660066;">getZipCode</span><span style="color: #339933;">,</span> GETZIP.<span style="color: #660066;">error</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>timeout<span style="color: #339933;">:</span> <span style="color: #CC0000;">7000</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//cache it for 10 minutes</span>
         <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
            GETZIP.<span style="color: #660066;">error</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Geo location not supported'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
      index<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
      error<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>msg.<span style="color: #660066;">code</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">//this is a geolocation error</span>
            <span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>msg.<span style="color: #660066;">code</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">:</span>
               $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#status&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Permission Denied'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">:</span>
               $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#status&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Position Unavailable'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">:</span>
               GETZIP.<span style="color: #660066;">index</span><span style="color: #339933;">++;</span>
               $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#status&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Timeout... Trying again ('</span> <span style="color: #339933;">+</span> GETZIP.<span style="color: #660066;">index</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">')'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               navigator.<span style="color: #660066;">geolocation</span>.<span style="color: #660066;">getCurrentPosition</span><span style="color: #009900;">&#40;</span>GETZIP.<span style="color: #660066;">getZipCode</span><span style="color: #339933;">,</span> GETZIP.<span style="color: #660066;">error</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>timeout<span style="color: #339933;">:</span> <span style="color: #CC0000;">7000</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">default</span><span style="color: #339933;">:</span>
               <span style="color: #006600; font-style: italic;">//nothing</span>
            <span style="color: #009900;">&#125;</span>
         <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">//this is a text error</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#error'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'failed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
      getZipCode<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>position<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         <span style="color: #003366; font-weight: bold;">var</span> position <span style="color: #339933;">=</span> position.<span style="color: #660066;">coords</span>.<span style="color: #660066;">latitude</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;,&quot;</span> <span style="color: #339933;">+</span> position.<span style="color: #660066;">coords</span>.<span style="color: #660066;">longitude</span><span style="color: #339933;">;</span>
         $.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'proxy.php'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
            path <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://maps.google.com/maps/api/geocode/json?latlng=&quot;</span><span style="color: #339933;">+</span>position<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&amp;sensor=false&quot;</span><span style="color: #339933;">,</span>
            type<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;application/json&quot;</span>
         <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>json<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">//Find the zip code of the first result</span>
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>json.<span style="color: #000066;">status</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;OK&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
               GETZIP.<span style="color: #660066;">error</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Zip Code not Found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #003366; font-weight: bold;">var</span> found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span>json.<span style="color: #660066;">results</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">address_components</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> el<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
               <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">inArray</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;postal_code&quot;</span><span style="color: #339933;">,</span> el.<span style="color: #660066;">types</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#status&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Your Zip Code: '</span> <span style="color: #339933;">+</span> el.<span style="color: #660066;">short_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                  found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                  <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
               <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>found<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
               GETZIP.<span style="color: #660066;">error</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Zip Code not Found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
         <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
   GETZIP.<span style="color: #660066;">getLocation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>
<b>A note on Safari 5:</b> It seems that the current implementation of geolocation is a bit buggy.  Sometimes it returns results almost immediately, other times it takes more than 10 seconds, but more often than not it runs for eternity without success. Firefox, on the other hand, seems pretty stable.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/javascript/getting-the-zip-code-from-an-html5-geolocation-api-call/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Pure CSS3 Card Flip (webkit only)</title>
		<link>http://travisjbeck.com/blog/browsers/pure-css3-card-flip-webkit-only/</link>
		<comments>http://travisjbeck.com/blog/browsers/pure-css3-card-flip-webkit-only/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 06:15:04 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[browsers]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=117</guid>
		<description><![CDATA[Put together a quick css3 demo of a dashboard style card flip using pure CSS for the transitions. Javascript is only used for toggling the class name on click and the animation property sliders. Currently only works in Safari 5. View Demo]]></description>
			<content:encoded><![CDATA[<p>Put together a quick css3 demo of a dashboard style card flip using pure CSS for the transitions.  Javascript is only used for toggling the class name on click and the animation property sliders. Currently only works in Safari 5.</p>
<p><a href="/files/css3cardflip/">View Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/browsers/pure-css3-card-flip-webkit-only/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Late night php and javascript coding</title>
		<link>http://travisjbeck.com/blog/random/late-night-php-and-javascript-coding/</link>
		<comments>http://travisjbeck.com/blog/random/late-night-php-and-javascript-coding/#comments</comments>
		<pubDate>Fri, 21 May 2010 05:54:10 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[random]]></category>
		<category><![CDATA[coding funny]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=114</guid>
		<description><![CDATA[Got this email from Gary. Epic]]></description>
			<content:encoded><![CDATA[<p>Got this email from Gary. Epic<br />
<span id="more-114"></span><br />
<a href="http://travisjbeck.com/blog/wp-content/uploads/2010/05/Screen-shot-2010-05-21-at-12.49.26-AM.png"><img class="aligncenter size-full wp-image-113" title="Screen shot 2010-05-21 at 12.49.26 AM" src="http://travisjbeck.com/blog/wp-content/uploads/2010/05/Screen-shot-2010-05-21-at-12.49.26-AM.png" alt="" width="455" height="190" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/random/late-night-php-and-javascript-coding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Photoshop CS5 Content Aware Fill is Pretty Amazing</title>
		<link>http://travisjbeck.com/blog/photoshop/photoshop-cs5-content-aware-fill-is-pretty-amazing/</link>
		<comments>http://travisjbeck.com/blog/photoshop/photoshop-cs5-content-aware-fill-is-pretty-amazing/#comments</comments>
		<pubDate>Sun, 02 May 2010 20:31:23 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=108</guid>
		<description><![CDATA[So i have this profile pic that i use almost everywhere, my hair was pretty crazy and i took a picture of it in a mirror to send to my girlfriend while i was on the phone with her, so i had my blutooth in at the time. Today, I installed Photoshop CS5 trial and [...]]]></description>
			<content:encoded><![CDATA[<p>So i have this profile pic that i use almost everywhere, my hair was pretty crazy and i took a picture of it in a mirror to send to my girlfriend while i was on the phone with her, so i had my blutooth in at the time.</p>
<p>Today, I installed Photoshop CS5 trial and used content-aware fill on a selection of the blutooth and i was pretty blown away at the results.<br />
<span id="more-108"></span><br />
Below is the results. Before is on top, After is on bottom.</p>
<p><img class="aligncenter size-full wp-image-109" title="content-aware-delete" src="http://travisjbeck.com/blog/wp-content/uploads/2010/05/content-aware-delete.jpg" alt="content-aware-delete" width="250" height="500" /></p>
<p>Of course i could clean it up a bit more, but this was just 2 simple steps.  Make a quick selection and hit delete.  Amazing.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/photoshop/photoshop-cs5-content-aware-fill-is-pretty-amazing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Full Size Photoshop Canvas on a Mac</title>
		<link>http://travisjbeck.com/blog/general/full-size-photoshop-canvas-on-a-mac/</link>
		<comments>http://travisjbeck.com/blog/general/full-size-photoshop-canvas-on-a-mac/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 17:06:25 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=95</guid>
		<description><![CDATA[So i recently acquired a new uni body macbook and have since been getting used to the switch from windows to mac. I gotta say I&#8217;m very much loving the OS X experience and the multi-touch gestures on the giant new track pad. That being said, one of the things that was really annoying me [...]]]></description>
			<content:encoded><![CDATA[<p>So i recently acquired a new uni body macbook and have since been getting used to the switch from windows to mac.  I gotta say I&#8217;m very much loving the OS X experience and the multi-touch gestures on the giant new track pad.  That being said, one of the things that was really annoying me was the default modal disjointed photoshop experience.  I like all my apps to be in a nice neat <del datetime="2009-02-20T16:35:16+00:00">window</del> container.</p>
<p><span id="more-95"></span></p>
<p>Here&#8217;s the default &#8220;disjointed&#8221; photoshop setup on a mac</p>
<p><a href="http://travisjbeck.com/blog/wp-content/uploads/2009/02/disjointed-lrg.jpg"><img src="http://travisjbeck.com/blog/wp-content/uploads/2009/02/disjointed-sml.jpg" alt="" title="Photoshop Disjointed Window" width="500" height="312" class="aligncenter size-full wp-image-99" /></a></p>
<p>Now i wanna contain all those wild modal panels into one cohesive application window. So i choose &#8220;Application Frame&#8221; From the &#8220;Window&#8221; menu like so:</p>
<p><img src="http://travisjbeck.com/blog/wp-content/uploads/2009/02/menu.jpg" alt="" title="Application Frame" width="176" height="270" class="aligncenter size-full wp-image-100" /></p>
<p>That leaves me with a beautifully framed and contained photoshop with a full size canvas.  This is much easier to work with since i am no longer accidentally clicking the desktop and losing my application focus.</p>
<p><a href="http://travisjbeck.com/blog/wp-content/uploads/2009/02/contained-lrg.jpg"><img src="http://travisjbeck.com/blog/wp-content/uploads/2009/02/contained-sml.jpg" alt="" title="Nicely Contained" width="500" height="312" class="aligncenter size-full wp-image-97" /></a></p>
<p>Keep in mind that this is CS4 and your mileage may vary depending on what version you are using.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/general/full-size-photoshop-canvas-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Auditorium &#8211; I want this on my iPhone&#8230; now</title>
		<link>http://travisjbeck.com/blog/general/auditorium-i-want-this-on-my-iphone-now/</link>
		<comments>http://travisjbeck.com/blog/general/auditorium-i-want-this-on-my-iphone-now/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 21:31:07 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=93</guid>
		<description><![CDATA[Auditorium is an amazingly fun and beautiful flash game. If you haven&#8217;t checked it out yet, stop reading now and take a look. The site hints that the creators are working on an iPhone and console version. I want this on my iPhone now.]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://www.playauditorium.com">Auditorium</a> is an amazingly fun and beautiful flash game.  If you haven&#8217;t checked it out yet, stop reading now and take a look.  The site hints that the creators are working on an iPhone and console version.  I want this on my iPhone now.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/general/auditorium-i-want-this-on-my-iphone-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooTools HideThisMessage plugin</title>
		<link>http://travisjbeck.com/blog/javascript/mootools-hidethismessage-plugin/</link>
		<comments>http://travisjbeck.com/blog/javascript/mootools-hidethismessage-plugin/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 05:07:00 +0000</pubDate>
		<dc:creator>Travis</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://travisjbeck.com/blog/?p=74</guid>
		<description><![CDATA[I&#8217;ve written another MooTools plugin (class) for facilitating the hiding of various help messages you may have scattered throughout your app. Download the script and demoView the demoDownload the MooTools framework What does it do? The basic premise is that you have a help message on one or more of your site&#8217;s pages which are [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve written another MooTools plugin (class) for facilitating the hiding of various help messages you may have scattered throughout your app.
</p>
<p><span id="more-74"></span></p>
<p>
<a onclick="javascript: pageTracker._trackPageview('/files/hidethismessage.zip'); " href="/files/HideThisMessage.zip">Download the script and demo</a><br/><a href="/demos/hidethismessage/">View the demo</a><br/><a href="http://mootools.net/download">Download the MooTools framework</a></p>
<p><h2>What does it do?</h2>
<p>The basic premise is that you have a help message on one or more of your site&#8217;s pages which are incredibly useful the first few times the user visits that section.  However, once the user understands how that page works, that once useful help message is now just in the way.   So to solve this problem you might put a &#8220;Close this message&#8221; or &#8220;Hide this message&#8221; link in there so that your users can get it off their screen since it&#8217;s no longer needed. That&#8217;s where HideThisMessage comes in.
</p>
<p>
HideThisMessage finds all the elements with the className you specify, hides them (with or without a snazzy animation) when the user clicks on the link within that element with the className you specify, and remembers via cookies which elements should be shown and which should be hidden/removed.  Each element needs its own unique id and the user must have cookies enabled.
</p>
<h2>Linking the required JavaScript files</h2>
<p>
You need to link the appropriate JavaScript files in the head of your document. HideThisMessage requires <a href="http://mootools.net/download">MooTools 1.2</a> or MooTools 1.11.  I&#8217;ve created classes for both versions. It also requires the <a href="http://mootools.net/docs/Plugins/Hash.Cookie">Hash.Cookie</a> Plugin for MooTools which i&#8217;ve included  in my download package for your convenience. Place the following lines before the closing<code> head </code> tag in the top of your document.
</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/path_to/mootools.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/path_to/hidethismessage.min.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>
Make sure you call the hidethismessage script AFTER mootols or it won&#8217;t work
</p>
<h2>Initializing HideThisMessage</h2>
<p>
Now you need to call the HideThisMessageclass passing to it the variables needed to get the plugin working. HideThisMessage takes 2 required and 1 optional arguments.
</p>
<ul class="argumentsList">
<li>
     <code>elementClass:</code> REQUIRED (String)(default: &#8216;hideWindow&#8217;) &#8211; The ClassName of the element that is to be hid.
   </li>
<li>
   <code>hideBtnClass:</code> REQUIRED (String)(default: &#8216;hideWindowBtn&#8217;)   &#8211; The ClassName of the link contained within elementClass that, when clicked, hides the window.
   </li>
<li>
<code>animate:</code> OPTIONAL (Boolean)(default: true)  &#8211; Whether or not the window animates closed when the hideBtnClass link is clicked.
</li>
</ul>
<p>
Now lets create a new instance of our HideThisMessage class.
</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">         window.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domready'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> myMessageHider <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> HideThisMessage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
               elementClass<span style="color: #339933;">:</span> <span style="color: #3366CC;">'hideWindow'</span><span style="color: #339933;">,</span>   
               hideBtnClass<span style="color: #339933;">:</span> <span style="color: #3366CC;">'hideWindowBtn'</span><span style="color: #339933;">,</span>
               animate<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span>                 
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Public Methods</h2>
<p>
HideThisMessage only has 1 public method
</p>
<ul class="argumentsList">
<li><code>reset()</code> Resets the hidden status of all hidden windows.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://travisjbeck.com/blog/javascript/mootools-hidethismessage-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

