<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Clayton McIlrath</title>
	
	<link>http://thinkclay.com</link>
	<description>Creative Media Design, Powered by Wordpress</description>
	<lastBuildDate>Wed, 28 Oct 2009 15:39:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<itunes:explicit>no</itunes:explicit><itunes:subtitle>Creative Media Design, Powered by Wordpress</itunes:subtitle><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/thinkclay" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Add, Edit, Delete Cookies with JavaScript</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/qZxMORvs1r0/add-edit-delete-cookies-with-javascript</link>
		<comments>http://thinkclay.com/technology/add-edit-delete-cookies-with-javascript#comments</comments>
		<pubDate>Mon, 19 Oct 2009 19:30:55 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1187</guid>
		<description><![CDATA[<a href="http://thinkclay.com/wp-content/uploads/2009/10/cookie-in-js.jpg"><img src="http://thinkclay.com/wp-content/uploads/2009/10/cookie-in-js.jpg" alt="cookies in js" title="cookies in js" width="300" height="200" class="alignleft" /></a>There are many ways to communicate and store data from front-end to back-end, but many require AJAX which may take too much time to develop or might not fit the project correctly. A neat alternative to save data and be able to access that data from the server is using <strong>browser cookies</strong>. <a href="http://en.wikipedia.org/wiki/HTTP_cookie">Cookies</a> can be created and destroyed by javascript, and while the syntax can be confusing, I've gathered this little script that will make it easier to use...]]></description>
			<content:encoded><![CDATA[<p>There are many ways to communicate and store data from front-end to back-end, but many require AJAX which may take too much time to develop or might not fit the project correctly. A neat alternative to save data and be able to access that data from the server is using <strong>browser cookies</strong>. <a href="http://en.wikipedia.org/wiki/HTTP_cookie">Cookies</a> can be created and destroyed by javascript, and while the syntax can be confusing, I&#8217;ve gathered this little script that will make it easier to use:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/* COOKIES OBJECT */</span>
<span style="color: #003366; font-weight: bold;">var</span> Cookies <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// Initialize by splitting the array of Cookies</span>
	init<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> allCookies <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'; '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>allCookies.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> cookiePair <span style="color: #339933;">=</span> allCookies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>cookiePair<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> cookiePair<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #006600; font-style: italic;">// Create Function: Pass name of cookie, value, and days to expire</span>
	create<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #339933;">,</span>value<span style="color: #339933;">,</span>days<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>days<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> date <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			date.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span>date.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>days<span style="color: #339933;">*</span><span style="color: #CC0000;">24</span><span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">*</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> expires <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;; expires=&quot;</span><span style="color: #339933;">+</span>date.<span style="color: #660066;">toGMTString</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: #000066; font-weight: bold;">else</span> <span style="color: #003366; font-weight: bold;">var</span> expires <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
		document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;=&quot;</span><span style="color: #339933;">+</span>value<span style="color: #339933;">+</span>expires<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;; path=/&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #006600; font-style: italic;">// Erase cookie by name</span>
	erase<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> undefined<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
Cookies.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Unfortunately, there&#8217;s no easy way to simple update a cookie (correct me if I&#8217;m wrong) but this will allow you to delete and re-create as needed:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Erase cookie &quot;test&quot;</span>
Cookies.<span style="color: #660066;">erase</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Recreate cookie &quot;test&quot; with a new value of &quot;cookievalue&quot; and set to expire in 10 days</span>
Cookies.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'cookievalue'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/add-edit-delete-cookies-with-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thinkclay.com/technology/add-edit-delete-cookies-with-javascript</feedburner:origLink></item>
		<item>
		<title>jQuery Lightbox / Modal Plugin</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/Kktji-eb300/jquery-lightbox-modal-plugin</link>
		<comments>http://thinkclay.com/news/jquery-lightbox-modal-plugin#comments</comments>
		<pubDate>Fri, 25 Sep 2009 20:17:51 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1175</guid>
		<description><![CDATA[There are SO MANY different types of <a href="http://devsnippets.com/?cat=13">lightbox scripts in the wild</a>, and while most of them are absolutely fantastic (<a href="http://www.shadowbox-js.com/" title="Shadowbox Lightbox">shadowbox</a> being one of my favorites) most of them are very limited in the control that they give you over the style, function and code. To make things worse, most of these <strong>lightbox scripts</strong> are also 5k or bigger, which is 5k more than you need sometimes. If you're like me, and you do a lot of customization or want to tweak your code to be as fast as possible, then you'll want this simple little <strong>jquery lightbox plugin</strong>. <strong>Style your lightbox</strong> exactly how you'd like and then simple invoke the modal() function and you'll be able to trigger the lightbox.]]></description>
			<content:encoded><![CDATA[<p>There are SO MANY different types of <a href="http://devsnippets.com/?cat=13">lightbox scripts in the wild</a>, and while most of them are absolutely fantastic (<a href="http://www.shadowbox-js.com/" title="Shadowbox Lightbox">shadowbox</a> being one of my favorites) most of them are very limited in the control that they give you over the style, function and code. To make things worse, most of these <strong>lightbox scripts</strong> are also 5k or bigger, which is 5k more than you need sometimes. If you&#8217;re like me, and you do a lot of customization or want to tweak your code to be as fast as possible, then you&#8217;ll want this simple little <strong>jquery lightbox plugin</strong>. <strong>Style your lightbox</strong> exactly how you&#8217;d like and then simple invoke the modal() function and you&#8217;ll be able to trigger the lightbox.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">modal</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: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</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><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> ah <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> wh <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> nh <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>wh<span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>ah<span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> aw <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> ww <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> nw <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ww<span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>aw<span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// Trim body height, append overlay, and disable scrolling (this can be undone with a custom close button)</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span>wh<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'overflow'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'hidden'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div class=&quot;overlay&quot;&gt;&lt;<span style="color: #000099; font-weight: bold;">\/</span>div&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.overlay&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #339933;">,</span> .8<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">:</span>nh<span style="color: #339933;">,</span> <span style="color: #3366CC;">'left'</span><span style="color: #339933;">:</span>nw<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</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>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This code is what i use for the overlay, you can customize as you&#8217;d like. The actual div is appended to the body with JavaScript.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.overlay</span> <span style="color: #00AA00;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">0</span>%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">0</span>%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">110</span>%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1001</span><span style="color: #00AA00;">;</span>
	-moz-opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.8</span><span style="color: #00AA00;">;</span>
	opacity<span style="color: #00AA00;">:</span>.8<span style="color: #00AA00;">;</span>
	filter<span style="color: #00AA00;">:</span> alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">80</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This is an example of a <a href="http://mycalorienumber.com/mynumber">modal/lightbox</a> i did using this plugin. Very simple CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.modal</span> <span style="color: #00AA00;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#00121b</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">54.5em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">56.5em</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#111e24</span><span style="color: #00AA00;">;</span> 
	box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1em</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1em</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1em</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1002</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/news/jquery-lightbox-modal-plugin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thinkclay.com/news/jquery-lightbox-modal-plugin</feedburner:origLink></item>
		<item>
		<title>Magento: Display Categories in Sidebar</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/grQ5zmsQYkY/magento-display-categories-in-sidebar</link>
		<comments>http://thinkclay.com/technology/magento-display-categories-in-sidebar#comments</comments>
		<pubDate>Mon, 07 Sep 2009 00:34:01 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1168</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/magento-display-categories-in-sidebar"><img src="http://thinkclay.com/wp-content/uploads/2009/09/magento-product-navigation.jpg" alt="magento product navigation" title="magento product navigation" width="300" height="200" class="alignleft" /></a>It seems my posts lately are always in relation to solving a problem or answering a question for someone else. If you're looking for a way to <strong>display categories in the sidebar</strong>, <strong>change category display</strong>, or create a <strong>category menu</strong> then this post is probably for you.]]></description>
			<content:encoded><![CDATA[<p>It seems my posts lately are always in relation to solving a problem or answering a question for someone else. If you&#8217;re looking for a way to <strong>display categories in the sidebar</strong>, <strong>change category display</strong>, or create a <strong>category menu</strong> then this post is probably for you.</p>
<h2>Creating the Block</h2>
<p>The first thing you need to do is create a block in your layout. Navigate to <em>/app/design/frontend/default/default/layout/catalog.xml</em></p>
<p>The first thing in your layout is a definition of the default layout noted by the comment &#8220;Default layout, loads most of the pages&#8221; depending on where you want to put your category nav (right sidebar, left sidebar, footer, etc) you&#8217;ll need to define the block a little differently. I&#8217;m going to do it with the left sidebar so you see what&#8217;s going on.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;reference</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;catalog/navigation&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;catalog.leftnav&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;catalog/navigation/left_nav.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Okay, so what i did was locate the left sidebar which is referenced simply as &#8220;left&#8221; inside those tags i define my block type and template. The next thing you&#8217;ll want to do is create that template file, note that i defined it within /app/design/frontend/default/default/template/<em>catalog/navigation/left_nav.phtml</em> so i will need to create that file.</p>
<h2>Creating the Template</h2>
<p>Once I&#8217;ve created the file, it&#8217;s time to put in my code to populate my links automatically of all my categories:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;h2&gt;Browse&lt;/h2&gt;
&lt;div class=&quot;block&quot;&gt;
&lt;ul id=&quot;nav_category&quot; class=&quot;nav_category&quot;&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStoreCategories</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$_category</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">drawItem</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_category</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getChildHtml</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'topLeftLinks'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>If you want to take this a step further, you can target subcategories based on current page with this little script (via <a href="http://devzone.pratthost.com/2008/10/27/magento-displaying-categories-and-current-subcategories/">Pratthost</a></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;">$obj</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Mage_Catalog_Block_Navigation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$store_cats</span>	<span style="color: #339933;">=</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStoreCategories</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$current_cat</span> 	<span style="color: #339933;">=</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCurrentCategory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$current_cat</span>	<span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_cat</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$current_cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$store_cats</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$cat</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: #000088;">$cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$current_cat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li class=&quot;current&quot;&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cat</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;ul&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCurrentChildCategories</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$subcat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subcat</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$subcat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</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: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cat</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Now refresh the cache and you should be set!</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/magento-display-categories-in-sidebar/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thinkclay.com/technology/magento-display-categories-in-sidebar</feedburner:origLink></item>
		<item>
		<title>Magento Tips and Snippets</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/Z1PFgXDU84k/magento-tips-and-snippets</link>
		<comments>http://thinkclay.com/technology/magento-tips-and-snippets#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:47:55 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1061</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/magento-tips-and-snippets"><img src="http://thinkclay.com/wp-content/uploads/2009/07/magento.jpg" alt="magento" title="magento" width="300" height="200" class="alignleft" /></a>Magento has become quite a popular system in recent months.. snippets, tutorials, and other resources are in high demand for the system. Since I've been working with Magento for quite a while now, I feel like creating a page where I can continually add useful code snippets and tutorials for Magento. If you don't see what you're looking for here, tweet me @thinkclay or check back later! Let's look at some pros and cons of Magento and then some useful code snippets..]]></description>
			<content:encoded><![CDATA[<p><a href="http://thinkclay.com/technology/magento-tips-and-snippets"><img class="alignleft" title="magento" src="http://thinkclay.com/wp-content/uploads/2009/07/magento.jpg" alt="magento" width="300" height="200" /></a>Magento has become quite a popular system in recent months.. snippets, tutorials, and other resources are in high demand for the system. Let&#8217;s look at some pros and cons of Magento and then some useful code snippets..</p>
<h2>The Good</h2>
<p>All around, Magento beats the competition. Here are just a few highlights if you&#8217;re not familiar with Magento:</p>
<ul>
<li>Magento is Object Oriented</li>
<li>Magento is secure and scalable</li>
<li>Magento has a large community that is rapidly growing</li>
<li>Magento can be extended very easily</li>
<li>Magento allows for multiple stores and store fronts</li>
</ul>
<h2>The Bad</h2>
<p>Magento has a few things that I&#8217;m not too excited about:</p>
<ul>
<li>Magento is HUGE and bulky</li>
<li>Magento lacks a WYSIWIG and CMS</li>
<li>Magento uses a lot of JavaScript in a bad way</li>
</ul>
<h2>Some Useful Code</h2>
<p>I&#8217;ll feed you baby birds..</p>
<p><strong>Add a CMS Static Block to a page: </strong><br />
Within Magento:</p>
<pre>{{block type="cms/block" block_id="identifier"}}</pre>
<p>With PHP:</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: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createBlock</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cms/block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBlockId</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'identifier'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">toHtml</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Check with User Group a customer belongs to (based upon Group ID) </strong></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> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getSingleton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'customer/session'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCustomerGroupId</span><span style="color: #009900;">&#40;</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><strong>Check if user is logged in: </strong></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;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'customer'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isLoggedIn</span><span style="color: #009900;">&#40;</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><strong>Display products from a specific category on the page:</strong><br />
Many people ask how to display products on the home page.. this is the easiest and most universal solution. Replace category ID with whatever category you want to display</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">{{block type=&quot;catalog/product_list&quot; template=&quot;catalog/product/list.phtml&quot; catagory_id=&quot;0&quot;}}</pre></div></div>

<p><strong>Shortcuts:</strong><br />
Store URL within Magento:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">{{store url=&quot;&quot;}}</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/magento-tips-and-snippets/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://thinkclay.com/technology/magento-tips-and-snippets</feedburner:origLink></item>
		<item>
		<title>How to RISE despite the FALL in the economy</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/EXap8Hf4G28/how-to-succee-in-bad-economy</link>
		<comments>http://thinkclay.com/business/how-to-succee-in-bad-economy#comments</comments>
		<pubDate>Fri, 31 Jul 2009 18:09:05 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[leadership]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1145</guid>
		<description><![CDATA[A question that is brought to my attention almost daily is, "how do i succeed in this rough economy?" .. well today, I've put together a simple article for you (which is also going to be printed in our local newspaper), which should serve as a simple reminder and nothing more. YOU have the power and tools to change your circumstances, these notes will just remind you where to start.]]></description>
			<content:encoded><![CDATA[<p>A question that is brought to my attention almost daily is, &#8220;how do i succeed in this rough economy?&#8221; .. well today, I&#8217;ve put together a simple article for you (which is also going to be printed in our local newspaper), which should serve as a simple reminder and nothing more. YOU have the power and tools to change your circumstances, these notes will just remind you where to start.</p>
<h2>Forward thinking and positive attitude</h2>
<p>Often times when facing grim circumstances, its easy to get caught up in the problems at hand.  Instead look beyond the current situation to the solution that lies on the other side. You have the ability to overcome.</p>
<h2>Use technology to get ahead</h2>
<p>Regardless of your state in this economy, its important to recognize the simple fact that paper and pencil are less popular. You should have some form of digital presence or website if you’re going to compete.</p>
<h2>Set goals and plan for the future</h2>
<p>It’s naive to think that the economy is going to improve over night or that it won’t effect you. Take the steps necessary to ensure the quality of living you’d like to retain even if you lose your job or business.</p>
<h2>Avoid the easy way out</h2>
<p>Right now is the opportune time for someone to take advantage of you. Don’t buy into a service that is sounds easy and promising. Make a point to investigate and consult with someone that has your best interest in mind.</p>
<h2>Surround yourself with positive people</h2>
<p>We all know that times are tough, but if you focus on the problem, it just seems to get bigger. Avoid getting caught up in the poverty mentality by surrounding yourself with successful and optimistic people. </p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/business/how-to-succee-in-bad-economy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thinkclay.com/business/how-to-succee-in-bad-economy</feedburner:origLink></item>
		<item>
		<title>Pros and Cons of using sIFR</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/DHoDlBYdaHc/pros-cons-using-sifr</link>
		<comments>http://thinkclay.com/technology/pros-cons-using-sifr#comments</comments>
		<pubDate>Wed, 22 Jul 2009 07:56:58 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[web browser]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1068</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/pros-cons-using-sifr"><img class="alignleft" src="http://thinkclay.com/wp-content/uploads/2009/07/sifr.jpg" alt="sifr" title="sifr" width="300" height="200" /></a>sIFR (scalable Inman Flash Replacement): allows for dynamically-generated snippets of text to use any font supported in Flash using a combination of JavaScript and Flash embedding to replace characters on the page. 

In <a href="http://thinkclay.com/technology/cufon-sifr-flir" title="sIFR vs Cufon vs FLIR">my last post regarding sIFR</a>, I compared <strong>sIFR</strong> against <strong>Cufon</strong> and <strong>FLIR</strong>. Since there is a great deal of interest in them, I decided to go deeper into what I believe is the superior out of the three.. ]]></description>
			<content:encoded><![CDATA[<p><a href="http://thinkclay.com/technology/pros-cons-using-sifr"><img class="alignleft" src="http://thinkclay.com/wp-content/uploads/2009/07/sifr.jpg" alt="sifr" title="sifr" width="300" height="200" /></a>sIFR (scalable Inman Flash Replacement): allows for dynamically-generated snippets of text to use any font supported in Flash using a combination of JavaScript and Flash embedding to replace characters on the page. </p>
<p>In <a href="http://thinkclay.com/technology/cufon-sifr-flir" title="sIFR vs Cufon vs FLIR">my last post regarding sIFR</a>, I compared <strong>sIFR</strong> against a few of the other popular font replacement methods such as <strong>Cufon</strong> and <strong>FLIR</strong>. Since there is obviously a great deal of interest in the subject of font replacement, I figured it would be beneficial to show a deeper analysis at sIFR which I believe is the superior out of the three.</p>
<h2>A deeper look at pros of sIFR</h2>
<p>sIFR is quite different to the many font replacement techniques in the wild. Instead of manually generating each header through an image generator such as <strong>FLIR</strong> and <strong>Cufon</strong> do, sIFR is able to load a flash object and replace each element on the fly. The scripted effect works for roughly 95% of world wide web users according to statistics for Flash support and JavaScript support in modern browsers. Note also, that sIFR is by no means required, and degrades gracefully if the user does not have one of these components required. I&#8217;m sure some purists would react with contempt, but this method causes no harm to usability and only effects load time if used incorrectly (such as replacing body text rather than headers).</p>
<h2>sIFR&#8230; what&#8217;s not to love?</h2>
<p>First and foremost, implementation can be slaughtered. For an inexperienced developer, sIFR can take up to an hour to implement (from what I&#8217;ve heard in complaints anyways) and can cause pages to load slowly. From my experience, both are due to an incompetent developer, as sIFR is quite easy to implement if you understand all front-end technologies (which you should be a front-end developer) and only causes slow load time if its used for large blocks of text. Compare sIFR to the first wave of Web 2.0 technologies.. to this day I see wannabe developers implementing 20k+ javascript libraries to do one simple &#8220;jiggle&#8221; or &#8220;ajax&#8221; ability, which you can do with a few lines of code if you understand raw JavaScript. We can&#8217;t blame the technology for human error.. sIFR is brilliant. It may have a ways to go before it&#8217;s perfect, but respecting the principles of semantics, usability, and accessibility.. <strong>sIFR</strong> by far is winning the race against <strong>Cufon</strong> and <strong>FLIR</strong>.</p>
<p>Now to address the purists and their complaint about flash and JS dependency. Plain and simply, if a user falls within the 3-10% that doesn’t have Flash or JavaScript enabled, then BIG DEAL. That&#8217;s what good old HTML/CSS are for.. a fall back solution. Should we punish those with modern browsers and technologies for the minority that will get a slightly-less-quality rendering? I don&#8217;t punish modern browsers by neglecting the wonders of CSS 3. If Internet Explorer sees a box with square corners instead of rounded.. BIG DEAL. So why should we fight about whether a user has JS or Flash enabled? Heck, you can even use image replacement at that point, if you really want to. </p>
<h2>The Big Picture</h2>
<p>The real issue is that there aren’t enough fonts supported in Internet Explorer. If we want to point fingers and find something to criticize, there it is. Firefox, Safari, Chrome, Opera.. they&#8217;re all supporting more CSS properties such as <strong>@font-face</strong>. However, due to copyright laws and support from Internet Explorer we are bound to 5-10 fonts that we can reasonably assume the user has installed, and that’s ALL we&#8217;ve got. Solutions have been offered and argued but the problems are still much broader.. ranging from font licensing, support and rendering, with no clear solution in sight.</p>
<p>sIFR is one solution of many offered by developers fighting a war for creative freedom. It&#8217;s here and now, it&#8217;s legal despite the font, and regardless of the few quirks.. it’s usable. If you use it, then I hope you implement it well. If you protest it, then I hope you have valid reasons, and aren&#8217;t just complaining because you&#8217;re ignorant. Take this post with a grain of salt.. it&#8217;s my 2 cents and nothing more.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/pros-cons-using-sifr/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thinkclay.com/technology/pros-cons-using-sifr</feedburner:origLink></item>
		<item>
		<title>Starting a Business with little Capital</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/LJEfLk3BGlw/business-sense</link>
		<comments>http://thinkclay.com/business/business-sense#comments</comments>
		<pubDate>Wed, 08 Jul 2009 16:34:41 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[leadership]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1050</guid>
		<description><![CDATA[<a href="http://thinkclay.com/business/business-sense"><img class="alignleft" src="http://thinkclay.com/wp-content/uploads/2009/07/business-sense.jpg" alt="business sense, built on a few cents" title="business built with little capital" width="300" height="200" /></a>Everyone has opinions and advice for starting a business, but most  advice tells you how to start a business with a capital investment or loan.. but when we started Chosen we didn't want either.. we wanted to follow the same path that <a href="http://37signals.com">37 Signals</a> traveled by "getting real" with development and work-flow and then finding ways to have your money work for you rather than surviving on income alone. So we with little capital and a lot of heart we dove into this business head first...]]></description>
			<content:encoded><![CDATA[<p>Everyone has their opinions and advice for starting a business, the problem is most of the advice out there tells you how to start a business with a capital investment or loan.. but when we started Chosen we didn&#8217;t want either.. we wanted to follow the same path that <a href="http://37signals.com">37 Signals</a> traveled by &#8220;getting real&#8221; with development and work-flow and then finding ways to have your money work for you rather than surviving on income alone. So we did just that.. with little capital and a lot of heart we dove into this business head first. So far we&#8217;re still breathing.</p>
<h2>Starting a business without Capital Investment</h2>
<p>It&#8217;s easy to say that it can be done, but it&#8217;s a whole different story to actually execute. Like I mentioned before, take notes from the <a href="http://gettingreal.37signals.com/">Getting Real</a> plan. Start your business by moonlight.. don&#8217;t quit your day job and jump right in (of course we&#8217;re hypocrites saying this because we jumped in, but I wish we had moonlighted first). Either negotiate with your employer to work part-time for a while or start your business at nights.. that way you have the income still to support your bills, but you can start planning and developing your business. Begin networking with other businesses in your field and going to seminars on weekends, because one of the greatest tools in starting a business is connections.</p>
<p>Along with the moonlighting, establish a budget. You may not know all of the costs to operate your business, and you may not be able to prepare for every road block or pitfall. What you can do, however, is give yourself a cushion. Depending on your liabilities (bills), you may want anywhere from $5,000 to $20,000 saved up before you quit you job and go full-time as a business. </p>

<p></p>
<h2>About our Web Company</h2>
<p>This post is based on our opinions and testimonials with starting our <a href="http://bychosen.com" title="Lansing Web Development">Web Company</a>. Thinkclay is a blog by <a href="http://thinkclay.com">Clayton McIlrath</a> based out of <strong>Lansing, MI</strong>. You can find more us by searching: <strong>Lansing Web</strong>, <strong>Powered by Wordpress</strong> and <strong>Graphic Design Portfolio</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/business/business-sense/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>

<enclosure url="http://thinkclay.com/wp-content/uploads/2009/07/business-sense-with-a-few-cents-desktop.m4v" length="57151674" type="video/x-m4v" />
<enclosure url="http://thinkclay.com/wp-content/uploads/2009/07/business-sense-with-a-few-cents-desktop.m4v" length="57151674" type="video/x-m4v" />
		<media:content url="http://feedproxy.google.com/~r/thinkclay/~5/Q6oVvRXhzDo/business-sense-with-a-few-cents-desktop.m4v" fileSize="57151674" type="video/x-m4v" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Everyone has opinions and advice for starting a business, but most advice tells you how to start a business with a capital investment or loan.. but when we started Chosen we didn't want either.. we wanted to follow the same path that 37 Signals traveled b</itunes:subtitle><itunes:summary>Everyone has opinions and advice for starting a business, but most advice tells you how to start a business with a capital investment or loan.. but when we started Chosen we didn't want either.. we wanted to follow the same path that 37 Signals traveled by "getting real" with development and work-flow and then finding ways to have your money work for you rather than surviving on income alone. So we with little capital and a lot of heart we dove into this business head first...</itunes:summary><itunes:keywords>Business, freelance, goals, leadership, personal</itunes:keywords><feedburner:origLink>http://thinkclay.com/business/business-sense</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/thinkclay/~5/Q6oVvRXhzDo/business-sense-with-a-few-cents-desktop.m4v" length="57151674" type="video/x-m4v" /><feedburner:origEnclosureLink>http://thinkclay.com/wp-content/uploads/2009/07/business-sense-with-a-few-cents-desktop.m4v</feedburner:origEnclosureLink></item>
		<item>
		<title>RFP Application for Download</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/T3WC1yih55o/rfp-application-for-download</link>
		<comments>http://thinkclay.com/technology/rfp-application-for-download#comments</comments>
		<pubDate>Tue, 23 Jun 2009 16:37:24 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1024</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/rfp-application-for-download" title="Chosen RFP Application"><img class="alignleft" src="http://thinkclay.com/timthumb.php?src=/wp-content/uploads/2009/06/rfp.jpg&#38;w=300&#38;h=200&#38;zc=1" alt="Chosen RFP Application" title="rfp application" width="300" height="200" /></a>A while back, I developed an application to automate our workflow and gather information from potential clients before meeting with them. This was a pretty basic RFP form, but I had many people tell me how interested they were in it, and that they wanted to use it for themselves. Within a few weeks of launching that RFP we had finished our new brand and it was already outdated. Rather than updating and re-skinning I decided to start from scratch and share the old one with whoever wants it. You can customize this application as necessary, but please give credit to Chosen with a link back to this site or the main Chosen site.. even if the link is hidden, we still like it there for SEO.]]></description>
			<content:encoded><![CDATA[<p><a href="http://thinkclay.com/technology/rfp-application-for-download" title="Chosen RFP Application"><img class="alignleft" src="http://thinkclay.com/timthumb.php?src=/wp-content/uploads/2009/06/rfp.jpg&amp;w=300&amp;h=200&amp;zc=1" alt="Chosen RFP Application" title="rfp application" width="300" height="200" /></a>A while back, I developed an application to automate our workflow and gather information from potential clients before meeting with them. This was a pretty basic RFP form, but I had many people tell me how interested they were in it, and that they wanted to use it for themselves. Within a few weeks of launching that RFP we had finished our new brand and it was already outdated. Rather than updating and re-skinning I decided to start from scratch and share the old one with whoever wants it. You can customize this application as necessary, but please give credit to Chosen with a link back to this site or the main Chosen site.. even if the link is hidden, we still like it there for SEO.</p>
<p><a href="http://demo.bychosen.com/rfp/" title="demo and preview the RFP application">View Demo</a> or <a href="http://chosendevelopment.com/wp-content/plugins/download-monitor/download.php?id=6" title="download RFP application">Download</a></p>
<h3>Lansing Web and Technology</h3>
<p>If you are a <strong>web design</strong> or <strong>web development</strong> firm in <strong>Lansing, MI</strong> then talk to me personally about an even better version of this application. I&#8217;m offering it only to <strong>Lansing Web Design</strong> Companies because I believe in giving the <strong>Lansing Area</strong> a competitive advantage when it comes to technology. Feel free to contact me at the email in my header.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/rfp-application-for-download/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<media:content url="http://feedproxy.google.com/~r/thinkclay/~5/38TQs_oo5Ps/download.php" fileSize="230402" type="application/zip" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>A while back, I developed an application to automate our workflow and gather information from potential clients before meeting with them. This was a pretty basic RFP form, but I had many people tell me how interested they were in it, and that they wanted </itunes:subtitle><itunes:summary>A while back, I developed an application to automate our workflow and gather information from potential clients before meeting with them. This was a pretty basic RFP form, but I had many people tell me how interested they were in it, and that they wanted to use it for themselves. Within a few weeks of launching that RFP we had finished our new brand and it was already outdated. Rather than updating and re-skinning I decided to start from scratch and share the old one with whoever wants it. You can customize this application as necessary, but please give credit to Chosen with a link back to this site or the main Chosen site.. even if the link is hidden, we still like it there for SEO.</itunes:summary><itunes:keywords>Technology, automate, developer tools, freelance, jQuery, PHP, resources</itunes:keywords><feedburner:origLink>http://thinkclay.com/technology/rfp-application-for-download</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/thinkclay/~5/38TQs_oo5Ps/download.php" length="230402" type="application/zip" /><feedburner:origEnclosureLink>http://chosendevelopment.com/wp-content/plugins/download-monitor/download.php?id=6</feedburner:origEnclosureLink></item>
		<item>
		<title>Where to start learning Web Development</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/CsTXfSPM0rg/where-to-start-learning-web-development</link>
		<comments>http://thinkclay.com/technology/where-to-start-learning-web-development#comments</comments>
		<pubDate>Thu, 11 Jun 2009 20:13:29 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=1016</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/where-to-start-learning-web-development" title="Learn Web Development"><img src="http://thinkclay.com/wp-content/uploads/2009/06/start-web-development.jpg" alt="Start Learning Web Development" title="start-web-development" width="300" height="200" class="alignleft" /></a>There are SO MANY articles out there that get very deep into <strong>web development</strong> and programming concepts, but not many people know what to start learning if you're just starting in this field. I've put together a well-rounded list of resources and websites to read on a regular basis and learn as much as you can. If you become familiar with all of these websites, you'll quickly be the best in your field. All the information is free to anyone with a passion or desire to learn.]]></description>
			<content:encoded><![CDATA[<p><a href="http://thinkclay.com/technology/where-to-start-learning-web-development" title="Learn Web Development"><img src="http://thinkclay.com/wp-content/uploads/2009/06/start-web-development.jpg" alt="Start Learning Web Development" title="start-web-development" width="300" height="200" class="alignleft" /></a>There are SO MANY articles out there that get very deep into <strong>web development</strong> and programming concepts, but not many people know what to start learning if you&#8217;re just starting in this field. I&#8217;ve put together a well-rounded list of resources and websites to read on a regular basis and learn as much as you can. If you become familiar with all of these websites, you&#8217;ll quickly be the best in your field. All the information is free to anyone with a passion or desire to learn.</p>
<h2>Validators</h2>
<ul>
<li><a href="http://www.totalvalidator.com">Total Validator</a>: simple HTML/CSS Validator with browser plugin support</li>
<li><a href="http://validator.w3.org/">W3C Validator</a>: the organization that defines markup standards, and validates according to those standards</li>
<li><a href="http://www.cynthiasays.com/">Cynthia Says</a>: screen reader which will help you with accessibility in mind</li>
</ul>
<h2>Accessibility</h2>
<ul>
<li><a href="http://www.webaim.org/intro/">WebAIM</a>: Introduction to Accessibility</li>
<li><a href="http://www.w3.org/TR/WCAG10/">WCAG</a>: Web Content Accessibility Guidelines</li>
<li><a href="http://www.w3.org/WAI/intro/wcag.php">WCAG Overview</a>: Overview of WCAG Standards</li>
<li><a href="http://www.w3.org/WAI/wcag-curric/overgid.htm">WCAG Tutorial</a>: A useful educational resource to learn the standards</li>
<li><a href="http://www.section508.gov/index.cfm?FuseAction=Content&#038;ID=11">Section 508</a>: Federal requirements for web accessibility</li>
</ul>
<h2>Javascript Libraries</h2>
<ul>
<li><a href="http://jquery.com">jQuery</a></li>
<li><a href="http://script.aculo.us">Prototype / Scriptaculous</a></li>
<li><a href="mootools.net">MooTools</a></li>
</ul>
<h2>Firefox Plugins for Developers</h2>
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2289">CSS Validator</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2104">CSS Viewer</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer Toolbar</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a></li>
</ul>
<h2>Tutorials</h2>
<ul>
<li><a href="http://www.w3schools.com/">W3Schools</a>: Very in-depth, free tutorials on the most commonly used web markup and programming languages</li>
<li><a href="http://www.alistapart.com">A List Apart</a>: Articles and tutorials on an extensive list of topics</li>
<li><a href=" http://www.quirksmode.org/resources.html">QuirksMode</a>: Good articles and test pages concerning javascript and CSS</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/where-to-start-learning-web-development/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://thinkclay.com/technology/where-to-start-learning-web-development</feedburner:origLink></item>
		<item>
		<title>AppleScript: YUI Compression</title>
		<link>http://feedproxy.google.com/~r/thinkclay/~3/kqGdSGOMVRU/applescript-yui-compression</link>
		<comments>http://thinkclay.com/technology/applescript-yui-compression#comments</comments>
		<pubDate>Tue, 09 Jun 2009 23:42:26 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[MAC]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://thinkclay.com/?p=995</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/applescript-yui-compression"><img class="alignleft" src="http://thinkclay.com/wp-content/uploads/2009/06/apple-script.jpg" alt="applescript" title="apple script" width="300" height="200" /></a>I love learning new programming languages, especially if it solves a need that I have and automates my process a bit more. I spent a couple hours learning AppleScript which is a programming language for Mac that let's you access the API and make basic function calls to cocoa based programs and applications. One such need that I had is compressing my JavaScript and CSS files before uploading to the web server. There are many applications and ways to this online, but they all are three or more steps to get the compressed file. A while back I downloaded the YUI java applet to do the compression on my desktop via Terminal, which sped up my process a bit, but since I only used it once in a great while, I'd always have to look up the parameters that I needed to pass to it. So today when I went to look it up, I decided I was going to be adventurous and try something new. That adventure led me to a solution that I'm happy with, and you may enjoy as well. ]]></description>
			<content:encoded><![CDATA[<p>I love learning new programming languages, especially if it solves a need that I have and <strong>automates</strong> my process a bit more. I spent a couple hours learning AppleScript which is a programming language for Mac that let&#8217;s you access the API and make basic function calls to cocoa based programs and applications. One such need that I had is compressing my <strong>JavaScript</strong> and <strong>CSS</strong> files before uploading to the web server. There are many applications and ways to this online, but they all are three or more steps to get the compressed file. A while back I downloaded the <a href="http://developer.yahoo.com/yui/compressor/">YUI java applet</a> to do the compression on my <strong>Mac</strong> via Terminal, which sped up my process a bit. However, since I only used it once in a great while, I&#8217;d always have to look up the parameters that I needed to pass to the compressor. So today when I went to look up the syntax, I decided I was going to be adventurous and try something new. That adventure led me to an <strong>applescript</strong> solution that I&#8217;m happy with, and you may enjoy as well. </p>
<h2>Download the YUI Compression AppleScript</h2>
<p><a href='http://thinkclay.com/wp-content/uploads/2009/06/yui-compressor-script.zip'><img src="http://thinkclay.com/wp-content/uploads/2009/06/download-yui-compressor-applescript.png" alt="download the YUI compressor applescript" title="download the YUI compressor applescript" width="490" height="96" /></a></p>
<h2>The AppleScript Source:</h2>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #0066ff;">run</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">set</span> this_item <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">choose file</span> <span style="color: #ff0033; font-weight: bold;">with</span> prompt <span style="color: #009900;">&quot;Choose CSS or JS file:&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">set</span> dir <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033;">the</span> <span style="color: #0066ff;">selection</span> <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">alias</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> mypath <span style="color: #ff0033; font-weight: bold;">to</span> posix_path<span style="color: #000000;">&#40;</span>this_item<span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> dirpath <span style="color: #ff0033; font-weight: bold;">to</span> posix_path<span style="color: #000000;">&#40;</span>dir<span style="color: #000000;">&#41;</span>
&nbsp;
	runCompression<span style="color: #000000;">&#40;</span>mypath, dirpath<span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #0066ff;">run</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> posix_path<span style="color: #000000;">&#40;</span>mac_path<span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> mac_path <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>mac_path <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span><span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> root <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">offset of</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #ff0033; font-weight: bold;">in</span> mac_path<span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> rootdisk <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>characters <span style="color: #000000;">1</span> <span style="color: #ff0033;">thru</span> <span style="color: #000000;">&#40;</span>root <span style="color: #000000;">-</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">of</span> mac_path<span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">disk</span> <span style="color: #000000;">&#40;</span>rootdisk <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">the</span> startup <span style="color: #0066ff;">disk</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> unixpath <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>characters <span style="color: #000000;">&#40;</span>root <span style="color: #000000;">+</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">thru</span> <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">of</span> mac_path<span style="color: #000000;">&#41;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> unixpath <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;/Volumes:&quot;</span> <span style="color: #000000;">&amp;</span> mac_path
		<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033;">every</span> character <span style="color: #ff0033; font-weight: bold;">of</span> unixpath
	<span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> i <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #000000;">2</span> <span style="color: #ff0033; font-weight: bold;">to</span> length <span style="color: #ff0033; font-weight: bold;">of</span> chars
		<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;:&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;/&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;'&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\\</span>'&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\\</span>&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\&quot;</span>&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;*&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\\</span>*&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;?&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\\</span>?&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\\</span> &quot;</span>
		<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\\</span>&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;<span style="color: #000000; font-weight: bold;">\\</span><span style="color: #000000; font-weight: bold;">\\</span>&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
	<span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #ff0033;">every</span> <span style="color: #0066ff;">item</span> <span style="color: #ff0033; font-weight: bold;">of</span> chars <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span>
<span style="color: #ff0033; font-weight: bold;">end</span> posix_path
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> runCompression<span style="color: #000000;">&#40;</span>mypath, dirpath<span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Terminal&quot;</span>
		<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;java -jar &quot;</span> <span style="color: #000000;">&amp;</span> dirpath <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;yuicompressor-2.4.2.jar &quot;</span> <span style="color: #000000;">&amp;</span> mypath <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; -o &quot;</span> <span style="color: #000000;">&amp;</span> mypath <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;.min.js&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> runCompression</pre></div></div>

<p>If you like this <strong>YUI Compression AppleScript</strong> please do share that with me, as praise is my sole motivation for producing scripts for others. I&#8217;ve only skimmed the surface of applescript, but with so few scripts out there that meet the needs that I have, I&#8217;m sure I could quickly make some other web developer tools for Mac as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/applescript-yui-compression/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<media:content url="http://feedproxy.google.com/~r/thinkclay/~5/8DuK9XB9edg/yui-compressor-script.zip" fileSize="816995" type="application/zip" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>I love learning new programming languages, especially if it solves a need that I have and automates my process a bit more. I spent a couple hours learning AppleScript which is a programming language for Mac that let's you access the API and make basic fun</itunes:subtitle><itunes:summary>I love learning new programming languages, especially if it solves a need that I have and automates my process a bit more. I spent a couple hours learning AppleScript which is a programming language for Mac that let's you access the API and make basic function calls to cocoa based programs and applications. One such need that I had is compressing my JavaScript and CSS files before uploading to the web server. There are many applications and ways to this online, but they all are three or more steps to get the compressed file. A while back I downloaded the YUI java applet to do the compression on my desktop via Terminal, which sped up my process a bit, but since I only used it once in a great while, I'd always have to look up the parameters that I needed to pass to it. So today when I went to look it up, I decided I was going to be adventurous and try something new. That adventure led me to a solution that I'm happy with, and you may enjoy as well. </itunes:summary><itunes:keywords>Technology, automate, desktop, developer tools, MAC, programming, resources</itunes:keywords><feedburner:origLink>http://thinkclay.com/technology/applescript-yui-compression</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/thinkclay/~5/8DuK9XB9edg/yui-compressor-script.zip" length="816995" type="application/zip" /><feedburner:origEnclosureLink>http://thinkclay.com/wp-content/uploads/2009/06/yui-compressor-script.zip</feedburner:origEnclosureLink></item>
	<media:rating>nonadult</media:rating></channel>
</rss>
