<?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>Code That Matters</title>
	<atom:link href="http://www.codethatmatters.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codethatmatters.com</link>
	<description>Pylons, rails, jQuery and other stuff that matters</description>
	<lastBuildDate>Sat, 16 Jul 2011 10:57:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DiaProjector &#8211; a jQuery diapositive slideshow plugin</title>
		<link>http://www.codethatmatters.com/2010/09/diaprojector-a-jquery-diapositive-slideshow-plugin/</link>
		<comments>http://www.codethatmatters.com/2010/09/diaprojector-a-jquery-diapositive-slideshow-plugin/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 11:40:20 +0000</pubDate>
		<dc:creator>bjorn</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[diaprojector]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=207</guid>
		<description><![CDATA[UPDATE: Version 1.1 available! Sept 21, 2010
- Overlay prev/next buttons available. This option, &#8220;overlay&#8221;, is true by default.
- Some small bugfixes
- Clearer left and right keybuttons in the navigation box
Lightboxes, Liteboxes, Greyboxes and Fancyboxes, we have seen them all by now and they all work kind of well. However, they are not very original and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: Version 1.1 available! </strong><em>Sept 21, 2010</em><br />
- Overlay prev/next buttons available. This option, &#8220;overlay&#8221;, is true by default.<br />
- Some small bugfixes<br />
- Clearer left and right keybuttons in the navigation box</p>
<p>Lightboxes, Liteboxes, Greyboxes and Fancyboxes, we have seen them all by now and they all work kind of well. However, they are not very original and work in pretty much the same way. If you want something new and original, yet still oldschool and simple, say hello to the latest addition to the slideshow plugins &#8211; DiaProjector.</p>
<p>Remember watching photos with the help of <a href="http://ss11i01.stream.ip-only.net/images/blog/images/entries/43/45/39/2862/36f53b65b0c392a9" target="_blank">these slides</a>? All you needed was a screen, a diaprojector machine and a ton of slides and you were in for hours of fun with your friends or family. This neat jQuery plugin is almost as fun! At least it&#8217;s trying to be, simulating the very same old fuzzy diaprojector feeling. Try it out here on our site and then download it to use on your own site. Please drop a line here when you have it running or have some questions/comments <img src='http://www.codethatmatters.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><img class="size-full wp-image-210 aligncenter" title="DiaProjector Jquery Plugin" usemap="#imagemap" src="http://www.codethatmatters.com/wp-content/uploads/2010/08/diaprojectorplugin.jpg" alt="DiaProjector - world's only diapositive slideshow" width="490" height="500" /></p>
<map name="imagemap">
<area title="Download DiaProjector" shape="rect" coords="238,254,410,303" href="http://source.codethatmatters.com/DiaProjector/diaprojector.zip" />
<area title="Watch it in action!" shape="rect" coords="81,254,226,303" href="http://source.codethatmatters.com/DiaProjector/index.html" target="_blank" /> </map>
<p>The plugin should work in Internet Explorer 7+, Firefox, Opera and Safari.</p>
<p>Sites that are using the script at the moment are:<br />
- <a href="http://www.monkeyagency.com/portfolio/" target="_blank">Monkey Agency</a></p>
<p> <img src='http://www.codethatmatters.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/09/diaprojector-a-jquery-diapositive-slideshow-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Change permissions recursively in linux</title>
		<link>http://www.codethatmatters.com/2010/04/change-permissions-recursively-in-linux/</link>
		<comments>http://www.codethatmatters.com/2010/04/change-permissions-recursively-in-linux/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 19:37:32 +0000</pubDate>
		<dc:creator>jorgen</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[folders]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[permission]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=199</guid>
		<description><![CDATA[Quite often when you are working with files and folders on a server for a web project you need to change the permissions for these files and folders. Especially if they are part of a web app and uploaded with FTP/SFTP. Most of the time the chmod command is enough, but sometimes you need to [...]]]></description>
			<content:encoded><![CDATA[<p>Quite often when you are working with files and folders on a server for a web project you need to change the permissions for these files and folders. Especially if they are part of a web app and uploaded with FTP/SFTP. Most of the time the chmod command is enough, but sometimes you need to change a whole bunch of files and folders in a directory tree with different permissions for files and folders. This is easily done with the find command via a terminal over ssh.</p>
<p>Changes all files in my_folder to have have rw rw r (664) permission.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">sudo find my_folder/ -<span class="kw2">type</span> f -<span class="kw1">exec</span> chmod <span class="nu0">664</span> <span class="br0">&#123;</span><span class="br0">&#125;</span> \<span class="sy0">;</span></pre></div></div>

<p>Changes all folders (directories) in my_folder to have have rw rw r (775) permission.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">sudo find my_folder/ -<span class="kw2">type</span> d -<span class="kw1">exec</span> chmod <span class="nu0">775</span> <span class="br0">&#123;</span><span class="br0">&#125;</span> \<span class="sy0">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/04/change-permissions-recursively-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if an element exists in the DOM with jQuery</title>
		<link>http://www.codethatmatters.com/2010/04/check-if-an-element-exists-in-the-dom-with-jquery/</link>
		<comments>http://www.codethatmatters.com/2010/04/check-if-an-element-exists-in-the-dom-with-jquery/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 19:17:14 +0000</pubDate>
		<dc:creator>jorgen</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[exists]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=192</guid>
		<description><![CDATA[Need to check if an element exists in the page you have loaded using jQuery. It is very simple. The jQuery object encapsulates zero or more DOM elements, and allows us to interact with them in many different ways. Therefor, we can just use the length property to check if our jQuery object, that is [...]]]></description>
			<content:encoded><![CDATA[<p>Need to check if an element exists in the page you have loaded using jQuery. It is very simple. The jQuery object encapsulates zero or more DOM elements, and allows us to interact with them in many different ways. Therefor, we can just use the length property to check if our jQuery object, that is returned by our selector query has one or several DOM elements attached to it.</p>
<p>Check if a specific element exists based on ID.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span class="kw1">if</span><span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="st0">'#my-element'</span><span class="br0">&#41;</span>.<span class="me1">length</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// Action code goes here</span>
<span class="br0">&#125;</span></pre></div></div>

<p>Check if a specific or several elements exists based on CLASS.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span class="kw1">if</span><span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="st0">'.my-element'</span><span class="br0">&#41;</span>.<span class="me1">length</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// Elment found</span>
<span class="br0">&#125;</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span class="kw1">if</span><span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="st0">'.my-element'</span><span class="br0">&#41;</span>.<span class="me1">length</span> <span class="sy0">!=</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// Elements found</span>
<span class="br0">&#125;</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span class="kw1">if</span><span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="st0">'.my-element'</span><span class="br0">&#41;</span>.<span class="me1">length</span> <span class="sy0">&gt;</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// Elements found</span>
<span class="br0">&#125;</span></pre></div></div>

<p>Remy Sharp have written an excellent post and recorded a screencast that explains this further on <a href="http://jqueryfordesigners.com/element-exists/">jQuery for Designers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/04/check-if-an-element-exists-in-the-dom-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery image selector Facebook style</title>
		<link>http://www.codethatmatters.com/2010/02/jquery-image-selector-facebook-style/</link>
		<comments>http://www.codethatmatters.com/2010/02/jquery-image-selector-facebook-style/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 15:34:49 +0000</pubDate>
		<dc:creator>bjorn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=179</guid>
		<description><![CDATA[In late 2008, the guys over at emposha wrote an excellent image selector for jQuery. It works very similar to the friend chooser on Facebook. However, I wanted a way to limit the selections to only one friend/picture. With the current code there is no such possibility. So instead of complaining, I simply rewrote some [...]]]></description>
			<content:encoded><![CDATA[<p>In late 2008, the guys over at <a href="http://www.emposha.com/">emposha</a> wrote an excellent <a href="http://www.emposha.com/javascript/fcbklistselection-like-facebook-friends-selector.html">image selector for jQuery</a>. It works very similar to the friend chooser on <a href="http://www.facebook.com">Facebook</a>. However, I wanted a way to limit the selections to only one friend/picture. With the current code there is no such possibility. So instead of complaining, I simply rewrote some lines in the script. If you want to do the same thing, this is how you do it.</p>
<p>Row 80-84 in &#8220;fcbklistselection.js&#8221; looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">obj.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        addToSelected<span class="br0">&#40;</span>obj<span class="br0">&#41;</span><span class="sy0">;</span>                            
        obj.<span class="me1">toggleClass</span><span class="br0">&#40;</span><span class="st0">&quot;itemselected&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        obj.<span class="me1">parents</span><span class="br0">&#40;</span><span class="st0">&quot;li&quot;</span><span class="br0">&#41;</span>.<span class="me1">toggleClass</span><span class="br0">&#40;</span><span class="st0">&quot;liselected&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>                     
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

<p>Replace these lines with the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">obj.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
       <span class="co1">//check if this is already selected. in that case it should be deselected</span>
       deselect_this <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span>
       <span class="kw1">if</span><span class="br0">&#40;</span>parseInt<span class="br0">&#40;</span>obj.<span class="me1">attr</span><span class="br0">&#40;</span><span class="st0">&quot;class&quot;</span><span class="br0">&#41;</span>.<span class="me1">indexOf</span><span class="br0">&#40;</span><span class="st0">&quot;selected&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="sy0">-</span><span class="nu0">1</span><span class="br0">&#41;</span> deselect_this <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span>
&nbsp;
       <span class="co1">//deselecting all items</span>
       $<span class="br0">&#40;</span><span class="st0">&quot;li .fcbklist_item&quot;</span><span class="br0">&#41;</span>.<span class="me1">each</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>x<span class="sy0">,</span> obj2<span class="br0">&#41;</span> <span class="br0">&#123;</span>
              obj2 <span class="sy0">=</span> $<span class="br0">&#40;</span>obj2<span class="br0">&#41;</span><span class="sy0">;</span>
              obj2.<span class="me1">removeClass</span><span class="br0">&#40;</span><span class="st0">&quot;itemselected&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span> 
              obj2.<span class="me1">parents</span><span class="br0">&#40;</span><span class="st0">&quot;li&quot;</span><span class="br0">&#41;</span>.<span class="me1">removeClass</span><span class="br0">&#40;</span><span class="st0">&quot;liselected&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
              obj2.<span class="me1">parents</span><span class="br0">&#40;</span><span class="st0">&quot;li&quot;</span><span class="br0">&#41;</span>.<span class="me1">removeAttr</span><span class="br0">&#40;</span><span class="st0">&quot;addedid&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
              removeValue<span class="br0">&#40;</span>obj2<span class="br0">&#41;</span><span class="sy0">;</span>
              hiddenCheck<span class="br0">&#40;</span>obj2<span class="br0">&#41;</span><span class="sy0">;</span>
       <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
       <span class="co1">//if the clicked item should be deselected, do so</span>
       <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span>deselect_this<span class="br0">&#41;</span>
       <span class="br0">&#123;</span>
              addToSelected<span class="br0">&#40;</span>obj<span class="br0">&#41;</span><span class="sy0">;</span>                            
              obj.<span class="me1">toggleClass</span><span class="br0">&#40;</span><span class="st0">&quot;itemselected&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
              obj.<span class="me1">parents</span><span class="br0">&#40;</span><span class="st0">&quot;li&quot;</span><span class="br0">&#41;</span>.<span class="me1">toggleClass</span><span class="br0">&#40;</span><span class="st0">&quot;liselected&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
       <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

<p>To get rid of the selected/unselected, simply add &#8220;display: none;&#8221; below &#8220;#filters .selections&#8221; in the css file (fcbklistselection.css). Enjoy!</p>
<p>Original demo: <a href="http://www.emposha.com/demo/fcbklistselection/">http://www.emposha.com/demo/fcbklistselection/</a><br />
Demo with our solution: <a href="http://www.codethatmatters.com/source/fcbkListSelection/">http://www.codethatmatters.com/source/fcbkListSelection/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/02/jquery-image-selector-facebook-style/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Load that DOM, please. Thank you!</title>
		<link>http://www.codethatmatters.com/2010/01/load-that-dom-please-thank-you/</link>
		<comments>http://www.codethatmatters.com/2010/01/load-that-dom-please-thank-you/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 22:33:47 +0000</pubDate>
		<dc:creator>jorgen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Dojo]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[YUI3]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=167</guid>
		<description><![CDATA[Get started with 5 different JavaScript frameworks and how they handle DOM readiness. 
Frequently there is talk about to check if the DOM is loaded or not when using JavaScript today. There is quite a few ways to do this and it is an interesting story to read up about the origin of &#8220;DOM ready&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Get started with 5 different JavaScript frameworks and how they handle DOM readiness. </strong></p>
<p>Frequently there is talk about to check if the DOM is loaded or not when using JavaScript today. There is quite a few ways to do this and it is an interesting story to read up about the origin of &#8220;DOM ready&#8221;. We should just be thankful that we don&#8217;t have to think about this on a everyday basis and that guys like John Resig does what he does and just hands it over to us. So we can play with it and build businesses around it. Thank you all JavaScript framework creators and contributors.</p>
<p>There is a whole bunch of great JavaScript frameworks and libraries out there, with various specialities and pros and cons. I mainly use jQuery, Prototype and sometimes I play with YUI. jQuery and Prototype aren&#8217;t that different from each other on a high level and easy to get started with. YUI on the other hand requires a bit of more knowledge and works a bit different. Despite your choice of JavaScript framework, there is one thing that we all want to know when getting started with one. How to check if the DOM is loaded.</p>
<p>We&#8217;ll look at how to check if the DOM is loaded in five different JavaScript frameworks; Dojo, jQuery, MooTools, Prototype and YUI 3. First out is Dojo.</p>
<p><strong>DOM readiness in Dojo</strong><br />
Learn more about Dojo&#8217;s <a href="http://api.dojotoolkit.org/jsdoc/1.3.2/dojo.addOnLoad">addOnLoad</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">dojo.<span class="me1">addOnLoad</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
    <span class="co1">// The DOM is ready, lets say hello!</span>
    say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">function</span> say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Hello Dojo! DOM is loaded!'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

<p><strong>DOM readiness in jQuery</strong><br />
Learn more about jQuery&#8217;s <a href="http://docs.jquery.com/Events/ready">ready</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">ready</span><span class="br0">&#40;</span><span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// The DOM is ready, lets say hello!</span>
    say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">function</span> say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Hello jQuery! DOM is loaded!'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

<p><strong>DOM readiness in MooTools</strong><br />
Learn more about MooTools <a href="http://mootools.net/docs/core/Utilities/DomReady">DomReady</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">window.<span class="me1">addEvent</span><span class="br0">&#40;</span><span class="st0">'domready'</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// The DOM is ready, lets say hello!</span>
    say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">function</span> say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Hello MooTools! DOM is loaded!'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

<p><strong>DOM readiness in Prototype</strong><br />
Learn more about Prototypes <a href="http://api.prototypejs.org/dom/document.html">document observe and loaded</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span class="me1">observe</span><span class="br0">&#40;</span><span class="st0">&quot;dom:loaded&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// The DOM is ready, lets say hello!</span>
    say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">function</span> say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Hello Prototype! DOM is loaded!'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

<p><strong>DOM readiness in YUI 3</strong><br />
Learn more about YUI 3&#8217;s <a href="http://developer.yahoo.com/yui/3/event/#ondomready">domready</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">YUI<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="kw2">use</span><span class="br0">&#40;</span><span class="st0">'node'</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>Y<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
    <span class="kw2">function</span> init<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="co1">// The DOM is ready, lets say hello!</span>
        say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
     Y.<span class="me1">on</span><span class="br0">&#40;</span><span class="st0">&quot;domready&quot;</span><span class="sy0">,</span> init<span class="br0">&#41;</span><span class="sy0">;</span> 
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">function</span> say_hello<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Hello YUI 3! DOM is loaded!'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/01/load-that-dom-please-thank-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simulate download speeds on your local machine with Sloppy</title>
		<link>http://www.codethatmatters.com/2010/01/simulate-download-speeds-on-your-local-machine-with-sloppy/</link>
		<comments>http://www.codethatmatters.com/2010/01/simulate-download-speeds-on-your-local-machine-with-sloppy/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 21:26:17 +0000</pubDate>
		<dc:creator>jorgen</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[broadband]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[sloppy]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=164</guid>
		<description><![CDATA[Sloppy provides a great way to test locally how your web site or web application works and behaves when accessed using very low bandwidth. For example via a dial up connection, mobile phone or mobile internet via 3g modem. Sloppy is easy to use, just run the java file by double clicking on it. Are [...]]]></description>
			<content:encoded><![CDATA[<p>Sloppy provides a great way to test locally how your web site or web application works and behaves when accessed using very low bandwidth. For example via a dial up connection, mobile phone or mobile internet via 3g modem. Sloppy is easy to use, just run the java file by double clicking on it. Are you a windows user you might need to install Java. OS X and Linux users should be just fine.</p>
<p>Download and learn more about Sloppy on the following url:</p>
<p><a href="http://www.dallaway.com/sloppy/">http://www.dallaway.com/sloppy/</a></p>
<p>In todays world of broadband most web developers, web designers and people who work with the web in general doesn&#8217;t think about bandwidth as much as they should, since most of them work in countries with great infrastructure and have access to really fast internet connections. But even in countries like Sweden, Germany, France and UK where a large part of the population have access to fast broadband, there is a lot of people in these countries who doesn&#8217;t have access to broadband for one reason or another. And no, 1mb line, doesn&#8217;t count as broadband.</p>
<p>So this is quite an important topic, even if the days of dial up connections are long gone for most of us. The increase of accessing web services with handheld devices like mobile phones or using mobile internet via USB dongles is getting more and more popular by the minute. Not to mention the cost and ridiculous pricy data plans the operators are providing, it might be more important than ever to make highly accessible and bandwidth savvy web sites and web services.</p>
<p>Sloppy can be used for more than just see how fast a web site loads on a slow connection, it is also a great tool to see how JavaScript behaves and work on slow connections. Happy slow localhost surfing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/01/simulate-download-speeds-on-your-local-machine-with-sloppy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Studio 5.5 in Snow Leopard</title>
		<link>http://www.codethatmatters.com/2010/01/zend-studio-5-5-in-snow-leopard/</link>
		<comments>http://www.codethatmatters.com/2010/01/zend-studio-5-5-in-snow-leopard/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 20:09:42 +0000</pubDate>
		<dc:creator>jorgen</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Zend Studio]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=149</guid>
		<description><![CDATA[Sometimes you just have to brush off those PHP skills for some project updates or for a client that uses a PHP based platform. This was the case for me the other day. I&#8217;ve upgraded to Snow Leopard just before Christmas and the little PHP work I&#8217;ve done since then and now I&#8217;ve taken care [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you just have to brush off those PHP skills for some project updates or for a client that uses a PHP based platform. This was the case for me the other day. I&#8217;ve upgraded to Snow Leopard just before Christmas and the little PHP work I&#8217;ve done since then and now I&#8217;ve taken care of in TextMate.</p>
<p>I was not happy to see that there for some reason was a major display rendering problems in Zend Studio 5.5. I&#8217;m not a big fan of the whole Zend Eclipse thing. I have a commercial license for Zend Studio 6, but will not upgrade to Zend Studio 7. The 5.5 version is still leaner and a lot easier to use than Eclipse. Might just go over to NetBeans instead.</p>
<p>A quick google search showed that I was not the only one having this problem and that there was a few good solutions and explanations on why the display rendering problem occurred. There are also some other kind if problems reported here and there.</p>
<p>The main problem is that Apple removed Java 5 from Snow Leopard, in some ways it make sense, in other it doesn&#8217;t. The solution is easy, download the Java 5 package, put it in the right folder and change the symlinks. Open up Java Preferences and change the order in which the versions are loaded. I went with the first solution below and it works just fine. There are a few other solutions, I found those less clean, but they seem to work as well.</p>
<p>Solution 1 (I used this one)</p>
<p><a href="http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard">http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard</a></p>
<p>Solution 2</p>
<p><a href="http://daveyshafik.com/archives/721-fixing-zde-5-5-in-snow-leopard.html">http://daveyshafik.com/archives/721-fixing-zde-5-5-in-snow-leopard.html</a></p>
<p>Solution 3</p>
<p><a href="http://chxor.chxo.com/post/183013153/installing-java-1-5-on-snow-leopard">http://chxor.chxo.com/post/183013153/installing-java-1-5-on-snow-leopard</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/01/zend-studio-5-5-in-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Check for ajax requests in Pylons</title>
		<link>http://www.codethatmatters.com/2010/01/check-for-ajax-requests-in-pylons/</link>
		<comments>http://www.codethatmatters.com/2010/01/check-for-ajax-requests-in-pylons/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 15:00:11 +0000</pubDate>
		<dc:creator>jorgen</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[is_xhr]]></category>
		<category><![CDATA[pylons]]></category>
		<category><![CDATA[xmlHttpRequest]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=132</guid>
		<description><![CDATA[In todays world of web development Ajax is taken for granted and there is a ton of good JavaScript frameworks out there that makes Ajax development quite easy and enjoyable. Together with a nice MVC framework it is even better. Each framework has its own way of detecting Ajax calls or more correctly xmlHttpRequests, which [...]]]></description>
			<content:encoded><![CDATA[<p>In todays world of web development Ajax is taken for granted and there is a ton of good JavaScript frameworks out there that makes Ajax development quite easy and enjoyable. Together with a nice MVC framework it is even better. Each framework has its own way of detecting Ajax calls or more correctly xmlHttpRequests, which is a huge topic on its own.</p>
<p>For checking if a request is an Ajax request in Pylons you just use is_xhr in your controller, this is based on the fact that you are running your Pylons app as wsgi.</p>
<p>Make sure your importing the request class</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span class="kw1">from</span> pylons <span class="kw1">import</span> request</pre></div></div>

<p>Then in your controller function you can just do</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span class="co1"># Checks if request is a xmlHttpRequest (Ajax) and returns a def</span>
<span class="kw1">if</span> request.<span class="me1">is_xhr</span>:
&nbsp;
<span class="co1"># Code goes here</span>
&nbsp;
<span class="kw1">return</span> render_mako_def<span class="br0">&#40;</span><span class="st0">'template_path'</span>,<span class="st0">&quot;def_name&quot;</span><span class="br0">&#41;</span></pre></div></div>

<p>You can also return and render a full template if you need or think that works better with your function.</p>
<p>More information can be found at <a href="http://pylonshq.com/docs/en/0.9.7/advanced_pylons/paster/">PylonsHQ Paster &#8211; Documentation &#8211; WSGI, CLI scripts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/01/check-for-ajax-requests-in-pylons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git autocomplete in Mac OS X</title>
		<link>http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/</link>
		<comments>http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 08:23:32 +0000</pubDate>
		<dc:creator>henke</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=121</guid>
		<description><![CDATA[I always liked that my  Git installations on Unix and Linux comes with the contrib/complete/git-completion.bash script activated or easily activated. But its harder if you use the pre-built binaries for Mac OS X.
To get autocompletion to work on Mac OS X when installing the pre-built binaries do this.
UPDATE: Instead of step 1 and 2 [...]]]></description>
			<content:encoded><![CDATA[<p>I always liked that my  Git installations on Unix and Linux comes with the contrib/complete/git-completion.bash script activated or easily activated. But its harder if you use the pre-built binaries for Mac OS X.</p>
<p>To get autocompletion to work on Mac OS X when installing the pre-built binaries do this.<br />
<strong>UPDATE:</strong> Instead of step 1 and 2 below you can get the completion script directly from Github. <em>Thanks to Fredric.</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl http:<span class="sy0">//</span>github.com<span class="sy0">/</span>git<span class="sy0">/</span>git<span class="sy0">/</span>raw<span class="sy0">/</span>master<span class="sy0">/</span>contrib<span class="sy0">/</span>completion<span class="sy0">/</span>git-completion.bash <span class="re5">-O</span></pre></div></div>

<p><strong>UPDATE: 2011-01-03</strong> All github.com url are now https. <em>Thanks to Julio</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl https:<span class="sy0">//</span>github.com<span class="sy0">/</span>git<span class="sy0">/</span>git<span class="sy0">/</span>raw<span class="sy0">/</span>master<span class="sy0">/</span>contrib<span class="sy0">/</span>completion<span class="sy0">/</span>git-completion.bash <span class="re5">-O</span></pre></div></div>

<p><strong>UPDATE: 2011-07-15</strong> Added -L option to allow for curl to handle redirects.<em>Thanks to michaelyoung</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl https:<span class="sy0">//</span>github.com<span class="sy0">/</span>git<span class="sy0">/</span>git<span class="sy0">/</span>raw<span class="sy0">/</span>master<span class="sy0">/</span>contrib<span class="sy0">/</span>completion<span class="sy0">/</span>git-completion.bash <span class="re5">-OL</span></pre></div></div>

<p>1. Download the Git source from  <a href="http://git-scm.com/">git-scm.com</a>.<br />
2. Unpack and copy the completion script git-completion.bash found in contrib/completion to your home directory.</p>
<p>3. Add the following to your ~/.profile or ~/.bash_profile</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span class="kw3">source</span> ~<span class="sy0">/</span>git-completion.bash
&nbsp;
<span class="kw3">alias</span> <span class="re2">gco</span>=<span class="st_h">'git co'</span>
<span class="kw3">alias</span> <span class="re2">gci</span>=<span class="st_h">'git ci'</span>
<span class="kw3">alias</span> <span class="re2">grb</span>=<span class="st_h">'git rb'</span></pre></div></div>

<p>4. Add the following to your ~/.gitconfig</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span class="br0">&#91;</span><span class="kw3">alias</span><span class="br0">&#93;</span>
<span class="kw2">co</span> = checkout
ci = commit
rb = rebase</pre></div></div>

<p>Restart Terminal and start Tabbin&#8217;!</p>
<p>More Git tips that I found usefull can be found on Tim Dysinger&#8217;s blog <a href="http://dysinger.net/2007/12/30/installing-git-on-mac-os-x-105-leopard">http://dysinger.net/2007/12/30/installing-git-on-mac-os-x-105-leopard</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Table row highlight on hover using JQuery</title>
		<link>http://www.codethatmatters.com/2009/10/table-row-highlight-on-hover-using-jquery/</link>
		<comments>http://www.codethatmatters.com/2009/10/table-row-highlight-on-hover-using-jquery/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 20:38:43 +0000</pubDate>
		<dc:creator>jorgen</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[front end]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.codethatmatters.com/?p=98</guid>
		<description><![CDATA[It is a shame that IE6 doesn&#8217;t support hover on html elements other than a-tag. The support can be somewhat flakey in other browsers as well. So for make this work we need to use JavaScript and preferably some kind of JavaScript library which in this case is JQuery.
Here is the script in its full [...]]]></description>
			<content:encoded><![CDATA[<p>It is a shame that IE6 doesn&#8217;t support hover on html elements other than a-tag. The support can be somewhat flakey in other browsers as well. So for make this work we need to use JavaScript and preferably some kind of JavaScript library which in this case is JQuery.</p>
<p>Here is the script in its full glory, small and simple. It is assumed that this behaviour should be applied on all tables. You can easily modify the script to access just a single table with a specific ID or CLASS. A neater version would be to wrap the code into its own function that only is called when a certain ID or CLASS exists inside the DOM tree.</p>
<p><a href="http://source.codethatmatters.com/98/">View Table row highlight example</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">ready</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    $<span class="br0">&#40;</span><span class="st0">'tr'</span><span class="br0">&#41;</span>.<span class="me1">hover</span><span class="br0">&#40;</span>
        <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
            $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">addClass</span><span class="br0">&#40;</span><span class="st0">'hover'</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span><span class="sy0">,</span>
        <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
            $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">removeClass</span><span class="br0">&#40;</span><span class="st0">'hover'</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#41;</span><span class="sy0">;</span>
    $<span class="br0">&#40;</span><span class="st0">&quot;tr.table-header&quot;</span><span class="br0">&#41;</span>.<span class="me1">unbind</span><span class="br0">&#40;</span><span class="st0">'mouseenter mouseleave'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codethatmatters.com/2009/10/table-row-highlight-on-hover-using-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

