<?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>The Internet Jungle Gym</title>
	<atom:link href="http://adambecker.info/feed" rel="self" type="application/rss+xml" />
	<link>http://adambecker.info</link>
	<description>Come play with me</description>
	<lastBuildDate>Sat, 27 Feb 2010 09:57:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New front page</title>
		<link>http://adambecker.info/blog/blog/new-frontpage</link>
		<comments>http://adambecker.info/blog/blog/new-frontpage#comments</comments>
		<pubDate>Sat, 27 Feb 2010 09:55:52 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[front]]></category>
		<category><![CDATA[no-sleep]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://adambecker.info/?p=59</guid>
		<description><![CDATA[I&#8217;ve updated the front page to help prepare for some great stuff that I am working on. Enjoy the new looks and also start checking out a brand new sub website: Web Dev Tools.
Sorry for the short post, but much more to come in the near future (plus is is almost 2 am and I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated the front page to help prepare for some great stuff that I am working on. Enjoy the new looks and also start checking out a brand new sub website: <a href="http://webdevtools.adambecker.info" target="_blank">Web Dev Tools</a>.</p>
<p>Sorry for the short post, but much more to come in the near future (plus is is almost 2 am and I need to get some sleep).</p>
<p>Peace out!</p>
]]></content:encoded>
			<wfw:commentRss>http://adambecker.info/blog/blog/new-frontpage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to serve files with mod rewrite</title>
		<link>http://adambecker.info/blog/development/how-to-serve-files-with-mod-rewrite</link>
		<comments>http://adambecker.info/blog/development/how-to-serve-files-with-mod-rewrite#comments</comments>
		<pubDate>Wed, 09 Dec 2009 18:23:03 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod rewrite]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://adambecker.info/?p=23</guid>
		<description><![CDATA[Have you ever wondered how some websites seem to serve files in a way that looks like folders instead of actual file names? For instance this website. To see this blog post you are linked to the URL http://adambecker.info/development/how-to-serve-files-with-mod-rewrite/ but in actuality the web server is running a PHP file and serving it as if [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wondered how some websites seem to serve files in a way that looks like folders instead of actual file names? For instance this website. To see this blog post you are linked to the URL <span id="sample-permalink">http://adambecker.info/development/</span>how-to-serve-files-with-mod-rewrite/ but in actuality the web server is running a PHP file and serving it as if it is being run from the location I just pasted.</p>
<p>Why do this? There are some good reasons for doing this:</p>
<ul>
<li>You can make your URLs friendlier to the people who are visiting your website</li>
<li>Having friendlier URLs means easier to understand URLs for search engines, which is good for search engine optimization</li>
<li>Better security. With the way I&#8217;ve setup this model all of the server files are outside of the browse-able web directory, which means they can only be accessed through the index.php file.</li>
</ul>
<p>Besides your normal code, you basically need two additional files: an <strong>.htaccess</strong> file and a redirection file which I&#8217;ve named <strong>index.php</strong>.</p>
<p>The .htaccess file lives in your root directory and should look something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>IfModule mod_rewrite.<span style="color: #202020;">c</span><span style="color: #339933;">&gt;</span>
RewriteEngine On
RewriteBase <span style="color: #339933;">/</span>
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>REQUEST_FILENAME<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!-</span>f
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>REQUEST_FILENAME<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!-</span>d
RewriteRule . <span style="color: #339933;">/</span>index.<span style="color: #202020;">php</span> <span style="color: #009900;">&#91;</span>L<span style="color: #009900;">&#93;</span>
<span style="color: #339933;">&lt;/</span>IfModule<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>If you aren&#8217;t familiar with htaccess files, Google it and you will find some great information about them.</p>
<p>The index.php file also lives in the root directory and should look something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'/index.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Location:/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// due to mod_rewrite every path comes to this file</span>
	<span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REDIRECT_URL'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// we're going to remove all of the empty arguments</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arg</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$pages</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$arg</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// if we don't get any arguments we want to give it our main page</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$pages</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'main'</span><span style="color: #339933;">;</span>	
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// in this model the area's main page is named after the area</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$pages</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pages</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// in this model we can accept as many nested areas</span>
	<span style="color: #000088;">$includePath</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'../lib/pages/'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pages</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.php'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #b1b100;">include</span> <span style="color: #000088;">$includePath</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #b1b100;">include</span> <span style="color: #0000ff;">'../lib/pages/error/404.php'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'There was a serious error, and we\'re sorry for the inconvenence. Please try again soon.'</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<div id="attachment_35" class="wp-caption alignleft" style="width: 272px"><img class="size-full wp-image-35" title="Sample File Structure" src="http://adambecker.info/wp-content/uploads/2009/12/files.png" alt="Sample File Structure" width="262" height="292" /><p class="wp-caption-text">Sample File Structure</p></div>
<p>The file is pretty self explanatory, but it is important to know that this isn&#8217;t the only way to do it. I&#8217;ve added some functionality for error 404 pages, and an even bigger fatal error. Last, I wanted to include a picture of a sample file structure that this particular example works for. Keep in mind that the <strong>htdocs</strong> directory is the only publicly browsable folder via a web browser in this sample.</p>
]]></content:encoded>
			<wfw:commentRss>http://adambecker.info/blog/development/how-to-serve-files-with-mod-rewrite/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X: end and home keys</title>
		<link>http://adambecker.info/blog/mac/mac-os-x-end-and-home-keys</link>
		<comments>http://adambecker.info/blog/mac/mac-os-x-end-and-home-keys#comments</comments>
		<pubDate>Wed, 02 Dec 2009 07:45:15 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[end]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[keys]]></category>

		<guid isPermaLink="false">http://adambecker.info/?p=13</guid>
		<description><![CDATA[I have been using Macs over five years and it has always bothered me that the home and end keys didn’t do what they do on every other computer. For whatever reason, in Mac OS X, when you hit the home or end key your view of the text document is moved to the beginning [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using Macs over five years and it has always bothered me that the home and end keys didn’t do what they do on every other computer. For whatever reason, in Mac OS X, when you hit the home or end key your view of the text document is moved to the beginning or end respectively. This wouldn’t be an issue if every other computer hadn’t taught me that these keys are supposed to move me to the beginning and end of the line of text that I am on. I finally get annoyed enough to figure out the answer.</p>
<p>After a quick Google search I found the answer from a blog called Phatness. You can read the article <a href="http://phatness.com/node/1661">here</a>, but if you don’t want to read all the introduction over there, which was decently funny, here is what you do to fix it yourself:</p>
<p>1. Create a new file called DefaultKeyBinding.dict in the directory Users/%YOUR USERNAME%/Library/KeyBindings/<br />
* Note: This folder won’t exist if you haven’t setup non-standard key bindings<br />
2. Copy the following code into the file, and save the file<br />
3. The new key bindings won’t take affect in any applications that are open without re-opening them</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>
<span style="color: #ff0000;">&quot;\UF729&quot;</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;moveToBeginningOfLine:&quot;</span><span style="color: #339933;">;</span>
<span style="color: #ff0000;">&quot;$\UF729&quot;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;moveToBeginningOfLineAndModifySelection:&quot;</span><span style="color: #339933;">;</span>
<span style="color: #ff0000;">&quot;\UF72B&quot;</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;moveToEndOfLine:&quot;</span><span style="color: #339933;">;</span>
<span style="color: #ff0000;">&quot;$\UF72B&quot;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;moveToEndOfLineAndModifySelection:&quot;</span><span style="color: #339933;">;</span>
<span style="color: #ff0000;">&quot;\UF72C&quot;</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;pageUp:&quot;</span><span style="color: #339933;">;</span>
<span style="color: #ff0000;">&quot;\UF72D&quot;</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;pageDown:&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://adambecker.info/blog/mac/mac-os-x-end-and-home-keys/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A nerd blog</title>
		<link>http://adambecker.info/blog/blog/a-nerd-blog</link>
		<comments>http://adambecker.info/blog/blog/a-nerd-blog#comments</comments>
		<pubDate>Sun, 22 Nov 2009 02:37:27 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[nerd]]></category>
		<category><![CDATA[video games]]></category>

		<guid isPermaLink="false">http://adambecker.info/?p=6</guid>
		<description><![CDATA[There is no denying it, I am a big nerd. I play video games and I program for a living. I mean, I have my own domain name and that means something because I know some &#8220;nerds&#8221; that don&#8217;t have their own domain name.
I&#8217;ve decided that it is time to embrace my inner nerd and [...]]]></description>
			<content:encoded><![CDATA[<p>There is no denying it, I am a big nerd. I play video games and I program for a living. I mean, I have my own domain name and that means something because I know some &#8220;nerds&#8221; that don&#8217;t have their own domain name.</p>
<p>I&#8217;ve decided that it is time to embrace my inner nerd and take it to the next level. If you&#8217;re interested in web development, gaming, and other nerdy adventures stay tuned! I am very much interested in what the viewers think, so please comment and I look forward to start writing dome good entries very soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://adambecker.info/blog/blog/a-nerd-blog/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
