<?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>somedirection &#187; Work</title>
	<atom:link href="http://somedirection.com/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://somedirection.com</link>
	<description></description>
	<lastBuildDate>Mon, 19 Jul 2010 21:21:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=8749</generator>
		<item>
		<title>Oh no my site is down! Be notified as soon as it happens.</title>
		<link>http://somedirection.com/2008/09/30/oh-no-my-site-is-down-be-notified-as-soon-as-it-happens/</link>
		<comments>http://somedirection.com/2008/09/30/oh-no-my-site-is-down-be-notified-as-soon-as-it-happens/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 00:10:53 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[montastic]]></category>
		<category><![CDATA[up-time]]></category>
		<category><![CDATA[website monitoring]]></category>

		<guid isPermaLink="false">http://somedirection.com/?p=302</guid>
		<description><![CDATA[These are exciting times. Halloween is my favorite holiday, not because I like blood and guts or horror movies or scaring people. It&#8217;s when the companies I do work for make $$$$$$. Plus, it&#8217;s a fun holiday to just let loose, relax and have fun. Who doesn&#8217;t like a costume party? Although the days of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/splat/282780263/"><img class="img pic right" src="http://farm1.static.flickr.com/95/282780263_c2898aaa9d_m.jpg" alt="Halloween Party, Ashley and I" /></a>
These are exciting times. <strong>Halloween is my favorite holiday</strong>, not because I like blood and guts or horror movies or scaring people. It&#8217;s when the companies I do work for make $$$$$$. Plus, it&#8217;s a fun holiday to just let loose, relax and have fun. Who doesn&#8217;t like a costume party? Although the days of <a href="http://flickr.com/photos/somedirection/sets/1002315/">throwing</a> <a href="http://flickr.com/photos/somedirection/sets/1256990/">parties</a> has passed, I still eagerly anticipate the holiday. I honed my skills as a web developer on a <a href="http://frightcatalog.com">few</a> <a href="http://costumzee.com">big</a> <a href="http://www.costumes4fun.com/">Halloween</a> <a href="http://importcostumes.com">sites</a>.</p>

<p>October pwns. The climate cools to the point where it&#8217;s actually enjoyable, leaves turn here in New England, baseball playoffs, and Halloween to name a bit of awesomeness. The lovely October holiday has kept a roof over my head since I graduated from <a href="http://wpi.edu">WPI</a>, minus a short stint <a href="http://quibblo.com">distracting tweens</a>.</p>

<p>On the eve of October, it&#8217;s worth mentioning that if you work with websites that <a href="http://siteanalytics.compete.com/frightcatalog.com+importcostumes.com+costumzee.com/?metric=uv">spike ginormously</a> in a short amount of time that <strong>up-time</strong> is critical. Each minute of downtime can have huge revenue ramifications.</p>

<p>At <a href="http://frightcatalog.com">Fright Catalog</a> I employed a free way of instantly being alerted via txt message if any of our sites were struggling. </p>

<h2>Montastic</h2>

<p><a href="http://montastic.com"><img class="img right" src="http://www.montastic.com/images/montasticman.jpg" alt="" /></a>
<a href="http://montastic.com">Montastic</a> is a free service that will constantly ping your domain and alert you via email when there is a problem. It&#8217;s rock solid and it just <strong>works</strong>. </p>

<h3>Send a text to my iPhone</h3>

<p>It took a bit of research to figure out which email address on AT&amp;T worked with my iPhone but after testing out a few:</p>

<ul>
<li><del>phone#@mmode.com</del></li>
<li><del>phone#@txt.att.com</del></li>
<li><del>phone#@mms.att.com</del></li>
<li>phone#@cingularme.com &#8211; works, but on it&#8217;s way out</li>
</ul>

<p>I finally found a winner: <strong>phone#@txt.att.net</strong> (Thanks to Ryan for the update)</p>

<p>It&#8217;s not sexy but it will work as an email address that when emailed will send an MMS message to your iPhone.</p>

<p>I&#8217;ve seen the recently popular <a href="http://downforeveryoneorjustme.com/">downforeveryoneorjustme.com</a> advertise <a href="http://uptimeparty.com/">uptimeparty.com</a>. They&#8217;ll let you monitor 1 site for free, but otherwise you pay. <a href="http://montastic.com">Montastic</a> does the same job and it&#8217;s free, so it makes a great alternative.</p>

<p>Montastic has helped me sleep easy many-a-night if we hit some up-time snags earlier that day. It could easily be used for your own personal blog as well. </p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2008/09/30/oh-no-my-site-is-down-be-notified-as-soon-as-it-happens/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Squatting on Multiple Usernames at Twitter</title>
		<link>http://somedirection.com/2008/04/01/squatting-on-multiple-usernames-a-twitter/</link>
		<comments>http://somedirection.com/2008/04/01/squatting-on-multiple-usernames-a-twitter/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 03:40:50 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Shameless Promotion]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://somedirection.com/?p=261</guid>
		<description><![CDATA[Recently I blogged about Controlling Your Online Persona which was the inspiration for this method I&#8217;m employing for aggregating my tweets across multiple Twitter accounts. Recently I&#8217;ve been using Twitter more and more. What was initially an annoyance of a service (first time I saw a tweet about having to take a deuce I checked [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/ky"><img class="right" src="http://somedirection.com/wp-content/uploads/2008/04/twitters.png" alt="twitters.png" border="0" width="337" height="127" /></a>
Recently I blogged about <a href="/2008/03/30/controlling-your-online-persona/">Controlling Your Online Persona</a> which was the inspiration for this method I&#8217;m employing for aggregating my tweets across multiple Twitter accounts.</p>

<p>Recently I&#8217;ve been using Twitter more and more. What was initially an annoyance of a service (first time I saw a tweet about having to take a deuce I checked out) has become my office water cooler from my virtual home office where I spend my days toiling away working on the pipes of the interwebs. </p>

<p>Initially when I signed up for Twitter back in March of 2007 I chose a different moniker <a href="http://twitter.com/ky">&#8220;<strong>ky</strong>&#8220;</a> because the big thing about Twitter was that you could use it on your cell with SMS. I figured if people were going to txt me via twitter that &#8220;ky&#8221; would be a hell of a lot easier to type than &#8220;somedirection&#8221; so I went with it. </p>

<p>I think Twitter as a service is starting to catch on &#8211; even Obama has 2 channels: <a href="http://twitter.com/BarackObama">BarackObama</a> and <a href="http://twitter.com/ObamaNews">ObamaNews</a>. Seeing that use of twitter was probably the first time I thought &#8211; hey Twitter is mainstream. Obama is using technology in his campaign exceptionally well I might add. But I digress..</p>

<p>I realized recently that I don&#8217;t want to be boxed into the &#8220;ky&#8221; username. It&#8217;s nice to have and people recognize me (once they see my avatar) but it&#8217;s not me, it&#8217;s not my brand. So I went about changing this and stumbled upon the realization that Twitter actually handles for multiple Twitter personas quite nicely.</p>

<h3>The Primary User Method on Twitter</h3>

<ol>
<li>You need a unique email address for each name</li>
<li>Choose 1 handle as your master account from which you&#8217;ll send all updates. For me I&#8217;m going to stick with <a href="http://twitter.com/ky">ky</a> because it&#8217;s what I started with and I have a handful of followers.</li>
<li>Create your other usernames. For my purposes I wanted to make sure I wouldn&#8217;t lose <a href="http://twitter.com/somedirection">somedirection</a>, nor did I want one of my clones to snatch <a href="http://twitter.com/KyleBradshaw">KyleBradsaw</a> from my grasp.</li>
<li>Now here&#8217;s how you can funnel people into your primary username. For myself I have just 1 tweet for both users somedirection and KyleBradshaw &#8220;<abbr title="Doing Business As">DBA</a> @ky&#8221;. This will give the surfer a link directly to my primary account while also letting them know that the account they&#8217;re looking at isn&#8217;t where I update.</li>
<li>Now ONLY <strong>follow</strong> your primary account from your alternate(s). Every time you twitter under your primary account and some one visits one of your alternate handles, when they look under the &#8220;<a href="http://twitter.com/KyleBradshaw/with_friends">With Others</a>&#8221; tab they will see all of your primary holders&#8217; tweets!</li>
</ol>

<p>Each user can have it&#8217;s own style. I like having a couple of different looks across all of my users.</p>

<div class="left" style="width:310px;">
<a href="http://twitter.com/KyleBradshaw"><img rel="facebox" src="http://somedirection.com/wp-content/uploads/2008/04/twitter-kylebradshaw-300x225.jpg" alt="twitter-KyleBradshaw.jpg" border="0" /></a>

<a style="margin-top: 20px;display:block;" href="http://twitter.com/somedirection"><img rel="facebox" src="http://somedirection.com/wp-content/uploads/2008/04/twitter-somedirection-300x225.jpg" alt="twitter-somedirection.jpg" border="0" /></a>
</div>

<div class="left" style="margin-left:15px;">
<a href="http://twitter.com/ky"><img rel="facebox" src="http://somedirection.com/wp-content/uploads/2008/04/twitter-ky-181x300.jpg" alt="twitter-ky.jpg" /></a>
</div>

<p><br class="clear"/></p>

<p>Initially I was thinking I&#8217;d have to kill off <strong>ky</strong> goodnesss for <strong>somedirection</strong> to keep my brand in tact, but this is a suitable workaround and I can have the best of both worlds. While I was at it I also grabbed <strong>KyleBradshaw</strong> for good measure. If Twitter becomes popular like myspace or gmail I&#8217;ll be glad I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2008/04/01/squatting-on-multiple-usernames-a-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Ratings &#8211; A Progressive Enhancement Approach</title>
		<link>http://somedirection.com/2008/03/24/jquery-ratings-a-progressive-enhancement-approach/</link>
		<comments>http://somedirection.com/2008/03/24/jquery-ratings-a-progressive-enhancement-approach/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 12:26:01 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://somedirection.com/2008/03/24/jquery-ratings-a-progressive-enhancement-approach/</guid>
		<description><![CDATA[There are some site behaviors that are primed for progressive enhancement in this example we&#8217;ll look at a ratings system and how easy it is to transform a simple form to make it more visually appealing and also improve usability. For a simple rating system we want a radio button list (1-10) and a &#8216;vote&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>There are some site behaviors that are primed for progressive enhancement in this example we&#8217;ll look at a ratings system and how easy it is to transform a simple form to make it more visually appealing and also improve usability. For a simple rating system we want a radio button list (1-10) and a &#8216;vote&#8217; button to submit our rating. The html would look something like this:</p>

<div class='code_parent'><div class='code_child'><code><pre>&#60;form id="rate_this" action="/process/rating/" method="post">
    &#60;div id="rating_scores">
        &#60;label>&#60;input type="radio" value="1" name="rating" />1&#60;/label>
        &#60;label>&#60;input type="radio" value="2" name="rating" />2&#60;/label>
        &#60;label>&#60;input type="radio" value="3" name="rating" />3&#60;/label>
        &#60;label>&#60;input type="radio" value="4" name="rating" />4&#60;/label>
        &#60;label>&#60;input type="radio" value="5" name="rating" />5&#60;/label>
        &#60;label>&#60;input type="radio" value="6" name="rating" />6&#60;/label>
        &#60;label>&#60;input type="radio" value="7" name="rating" />7&#60;/label>
        &#60;label>&#60;input type="radio" value="8" name="rating" />8&#60;/label>
        &#60;label>&#60;input type="radio" value="9" name="rating" />9&#60;/label>
        &#60;label>&#60;input type="radio" value="10" name="rating" />10&#60;/label>
        &#60;input type="submit" value="Vote" />
    &#60;/div>
&#60;/form></pre></code></div></div>

<p>Which gives us this:</p>

<form id="rate_this" action="" method="post">
    <div id="rating_scores">
        <label><input type="radio" value="1" name="rating" />1</label>
        <label><input type="radio" value="2" name="rating" />2</label>
        <label><input type="radio" value="3" name="rating" />3</label>
        <label><input type="radio" value="4" name="rating" />4</label>
        <label><input type="radio" value="5" name="rating" />5</label>
        <label><input type="radio" value="6" name="rating" />6</label>
        <label><input type="radio" value="7" name="rating" />7</label>
        <label><input type="radio" value="8" name="rating" />8</label>
        <label><input type="radio" value="9" name="rating" />9</label>
        <label><input type="radio" value="10" name="rating" />10</label>        <input type="submit" value="Vote" />
    </div>
</form>

<p>A simple radio list and a simple button to submit the form.</p>

<p>How can we make this 100x&#8217;s better? Simply clicking on a number to submit the form automagically would be the easiest and most friendly user interaction. So we lean on jQuery to provide progressive enhancement. Using these methods we can create a rating behavior infinitely better and more appealing like this:</p>

<p><img src="http://somedirection.com/wp-content/uploads/2008/03/rating-enhanced.png" alt="rating_enhanced.png" border="0" width="500" height="49" /></p>

<h3>jQuery</h3>

<p><div class='code_parent'><div class='code_child'><code><pre>// hides the vote button
  $("form#rate<em>this input#vote</em>button").hide();</p>

<p>// hides all radio buttons
    $("form#rate_this input[@type=radio]").hide();</p>

<p>// format the labels to look clickable
    $("form#rate<em>this label").addClass("contest</em>selector");</p>

<p>// change the formatting of the label when it is hovered over
// by assigning a different class
    $("label.selector, #rating<em>scores a").hover(function(){ 
      $(this).addClass("selector</em>h");
      }, function() {
      $(this).removeClass("selector_h");<br />
    });</p>

<p>// submit the form when a label is clicked
    $("form#rate<em>this label").click(function() {
      $(this).find("input").attr("checked","checked");
      $("input#vote</em>button").trigger('click');
    });
}</pre></code></div></div></p>

<h3>CSS</h3>

<p><div class='code_parent'><div class='code_child'><code><pre>#rating<em>scores {
margin: 20px 0 10px;
border: 1px solid #cacaca;
background-image: url("/images/rating</em>scores<em>bck.gif");
background-position: 0% 45%;
background-repeat: no-repeat;
background-color: #efefef;
padding: 5px 0;
padding-left: 130px;
}
.contest</em>selector {
color: #000;
text-transform: uppercase;
cursor: pointer;
font-size: 167%;
font-weight:bold;
padding: 10px 13px 9px;
margin: 1px;
}
.contest<em>selector</em>h {
background: #c00;
border: 1px solid #a00;
background: #00c705;
border: 1px solid #008004;
color: #fff !important;
text-decoration: none !important;
margin: 0px;
}</pre></code></div></div></p>

<p>Why hide all the radio buttons? Aside from the fact that they&#8217;re ugly we don&#8217;t need to worry about them because we&#8217;re using &lt;label&rt;s effectively.</p>

<p>The labels are surrounding the buttons with so they will still get focus
<div class='code_parent'><div class='code_child'><code><pre>&#60;label>&#60;input type="radio" value="1" name="rating" />1&#60;/label></pre></code></div></div></p>

<p>We let the user know that the numbered hot spots are indeed buttons by applying a mouseover behavior.</p>

<p>We submit the form when a label is clicked &#8211; not when the Vote Now button is pressed.</p>

<p>If Javascript was not available or the jQuery rules were not applied then the html would perfectly degrade and would be entirely usable otherwise.</p>

<p>For an example of this method in action venture over to the <a href="http://www.costumzee.com/costume-contest/">Costumzee Costume Contest</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2008/03/24/jquery-ratings-a-progressive-enhancement-approach/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Debugging Internet Explorer  CSS &#8211; My Methods</title>
		<link>http://somedirection.com/2008/03/22/debugging-internet-explorer-css-my-methods/</link>
		<comments>http://somedirection.com/2008/03/22/debugging-internet-explorer-css-my-methods/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 22:27:47 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Agile Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://somedirection.com/2008/03/22/debugging-internet-explorer-css-my-methods/</guid>
		<description><![CDATA[I recently spent the day debugging Internet Explorer. I save it for the absolute last step in front end development before pushing a site live. I want to avoid Explorer as much as possible. I figured my process would be worth sharing. This is my setup. MacBook running Firefox with the Web Developer Plugin and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/somedirection/2342051020/" title="How I Debug by somedirection, on Flickr"><img class="pic" src="http://farm4.static.flickr.com/3247/2342051020_8d3519fb22.jpg" width="500" height="375" alt="How I Debug" /></a></p>

<p>I recently spent the day debugging Internet Explorer. I save it for the absolute last step in front end development before pushing a site live. I want to avoid Explorer as much as possible.</p>

<p>I figured my process would be worth sharing. This is my setup. </p>

<ol>
<li>MacBook running Firefox with the Web Developer Plugin and Firebug plugins installed.</li>
<li>Old Toshiba Laptop 1.8ghz barebones Windows XP installation with IE6</li>
<li>Parallels installed on the MacBook with IE7 on Windows XP SP2</li>
</ol>

<p>With this setup I can test for any modern browser with any kind of significant market share.</p>

<ul>
<li>Firefox Mac</li>
<li>Firefox Win</li>
<li>IE 6 + 7 (soon to be 8 as well)</li>
<li>Camino</li>
<li>Safari</li>
</ul>

<p>Debugging IE issues is probably the most painful thing about my job, but one that&#8217;s made a little bit easier because of my approach so I thought it&#8217;d be useful to share.</p>

<p>I develop 9-5 in Firefox so any rendering bugs usually come to my attention right away and I&#8217;ll fix them immediately. Camino is based on the same Gecko rendering engine so I don&#8217;t have to worry about anomalies there. Safari does a good job rendering everything and my colleagues use it as their day to day browser so we usually catch any rendering bugs that way.</p>

<p>Then it comes down to IE debugging. I only concern myself with IE6 and above, I can handle well for modern browsers, besides the market share of browsers that fall outside this range is really insignificant statistically. For small development teams it&#8217;s hardly worth the extra effort to pay attention to the long tail of browsers.</p>

<p>Looking at Google Analytics for a heavy traffic site that I work on:</p>

<p><strong>5.6m Visitors</strong> from 8/1/07 &#8211; 3/20/08 </p>

<p><img class="pic" src="http://somedirection.com/wp-content/uploads/2008/03/6mo-browsers.png" alt="6+mo-browsers.png" border="0" width="553" height="147" />&lt;br/>
<em>IE is still dominant &#8211; so testing for these browsers is essential.</em></p>

<p><img class="pic" src="http://somedirection.com/wp-content/uploads/2008/03/ie-last-6-mo.png" alt="ie-last-6+-mo.png" border="0" width="553" height="118" />&lt;br/>
<em>If we look at the last 6 months, IE7.0 and IE6.0 are neck and neck ~50/50, however:</em></p>

<p><img class="pic" src="http://somedirection.com/wp-content/uploads/2008/03/ie-last-3mo.png" alt="ie-last-3mo.png" border="0" width="555" height="120" />&lt;br/>
<em>In the first 3+ months of 2008 you can see that IE7 has taken a significant leap above IE6 in the market 61/39 and IE 5.5 has gone to a 0.12% market share to a meager 0.07% market share.</em></p>

<p>That leaves us only concerned with IE6 and IE7 (and hopefully upcoming IE8 will be a non factor). The best way to deal with CSS and IE is by leveraging something called <a href="http://www.quirksmode.org/css/condcom.html">conditional comments</a></p>

<p>Before conditional comments I relied on browser hacks to differentiate between browsers, but conditional comments are a lot easier and so much more effective. Currently I use these declarations:</p>

<div class='code_parent'><div class='code_child'><code><pre>&#60;!--[if IE 6]>
&#60;link rel="stylesheet" href="/stylesheets/ie6.css" type="text/css" />
&#60;![endif]-->
&#60;!--[if IE 7]>
&#60;link rel="stylesheet" href="/stylesheets/ie7.css" type="text/css" />
&#60;![endif]--></pre></code></div></div>

<p>I start with IE6 and clean up any rendering issues &#8211; then I move on to IE7, which invariably has fewer issues to deal with. Because IE does not have a handy dandy tool like <a href="http://getfirebug.com/">Firebug</a> to help me diagnose the problem this process usually involves a lot of trial and error. It&#8217;s a very iterative process and one that my <a href="/2007/05/27/agile-development-workflow-part-1-setup/">Agile Development Workflow</a> is well suited for.</p>

<p>One technique I&#8217;ve found to be indispensable is assigning various background colors to the markup that I&#8217;m trying to debug. Often this is all I need to target CSS rules run amok. Over time you can avoid generating certain CSS + HTML that will break IE altogether &#8211; and that&#8217;s what separates the experts from novices. </p>

<p>Was this helpful? How do you approach debugging CSS in IE? Share!</p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2008/03/22/debugging-internet-explorer-css-my-methods/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Structuring jQuery For Speed and Efficiency</title>
		<link>http://somedirection.com/2008/03/14/structuring-jquery-for-speed-and-efficiency/</link>
		<comments>http://somedirection.com/2008/03/14/structuring-jquery-for-speed-and-efficiency/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 23:04:18 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://somedirection.com/2008/03/14/structuring-jquery-for-speed-and-efficiency/</guid>
		<description><![CDATA[I jQuery. There I said it loud and clear across the Internet so everyone knows it. I don&#8217;t ever want to use another framework. When I work with large sites with many jQuery rules that have to be applied, sometimes this can cause sluggishness &#8211; especially if you&#8217;re using jQuery for progressive enhancement. I was [...]]]></description>
			<content:encoded><![CDATA[<p><img class="right" src="http://somedirection.com/wp-content/uploads/2008/03/jquery-logo.gif" alt="jQuery-logo.gif" border="0" width="132" height="132" />
I <img src="http://somedirection.com/wp-content/uploads/2008/03/heart.png" alt="love" border="0" width="16" height="16" /> jQuery. There I said it loud and clear across the Internet so everyone knows it. I don&#8217;t ever want to use another framework.</p>

<p>When I work with large sites with many jQuery rules that have to be applied, sometimes this can cause sluggishness &#8211; especially if you&#8217;re using jQuery for progressive enhancement.</p>

<p>I was recently hit with a performance snag with jQuery &#8211; I just had too much going on in my jrules.js file &#8211; this is what I use to apply all of my <abbr title="Document Object Model">DOM</abbr> methods with jQuery. jQuery performance is great &#8211; and with the  packed version it&#8217;s footprint is miniscule but when you parse a massive <abbr title="Document Object Model">DOM</abbr> and apply a ton of rules sluggishness ensues especially when using progressive enhancement to hide/show multiple objects.</p>

<p>Right now I have a jrules.js file that is big, mean and has over 200+ lines of jQuery goodness to apply every time a page loads. </p>

<p>I hit performance issues when I have pages with hundreds of tags in the markup and a ton of content &#8211; you can see where I&#8217;m going with this. </p>

<p>What I came up with and use for most of my recent projects is a way to pass over those jQuery rules that don&#8217;t <strong>need</strong> to be applied or even looked at on certain pages. This is how I go about it:</p>

<p>First I break up my rules according to what page they&#8217;re on. </p>

<div class='code_parent'><div class='code_child'><code><pre>document.ready(function() {

// GLOBAL

// HOME

// LOGIN

});</pre></code></div></div>

<p>If you can segregate rules and only apply them when they&#8217;re needed you&#8217;ll significantly improve the speed with which jQuery can handle it all, especially when you&#8217;re dealing with massive <abbr title="Document Object Model">DOM</abbr> trees.</p>

<p>I leverage top level CSS inheritance to bring it together. On my pages assign an ID to the body tag from which all my jQuery rules will be executed upon.</p>

<div class='code_parent'><div class='code_child'><code><pre>&#60;body id="home"></pre></code></div></div>

<p>You can use <a href="http://docs.jquery.com/Core/length">.length</a> or <a href="http://docs.jquery.com/Core/size">.size()</a> &#8211; they&#8217;re synonymous to test if the jQuery object is <span class="underline">avaiable</span> in the <abbr title="Document Object Model">DOM</abbr>, if it doesn&#8217;t exist jQuery doesn&#8217;t have to bother with it. </p>

<p>Rules only used on certain pages can now be filtered and jQuery can pass over huge blocks of declarations of whom we know don&#8217;t exist in the current <abbr title="Document Object Model">DOM</abbr> anyhow.</p>

<div class='code_parent'><div class='code_child'><code><pre>document.ready(function() {

// GLOBAL
// DOM elements that exist on every page

$("input[@type=password], input[@type=text]").addClass("text");

$("input[@type=password], input[@type=text], textarea").focus(function() {
    $(this).addClass("focus");
});

// HOME body#home

if ($("body#home").size()) {
    // only applies rules on the homepage
    $("p").hover(function() {
        $(this).addClass("change")
    }, function() {
        $(this).removeClass("change")
    );
}

// LOGIN

if ($("body#login").size()) {
    // only applies rules on the login page
}

});</pre></code></div></div>

<p>For simple pages with a few rules and a small <abbr title="Document Object Model">DOM</abbr> this is definitely overkill, but if you&#8217;ve noticed even a nano second of lag when jQuery applies your rules and see the <abbr title="Document Object Model">DOM</abbr> rearrange itself at page load try this out and let me know how it worked for you.</p>

<p>Last night when I attended a meeting of <a href="http://markupandstyle.org/">The Markup &amp; Style Society</a> at the <a href="http://www.filamentgroup.com/">Filament Group</a> office. I got a chance to speak with Mr. jQuery himself &#8211; <a href="http://ejohn.org">John Resig</a> about my performance issue and I shared my solution to the problem. I was unsure I approached it the best way and there wasn&#8217;t a better solution available out there, but he assured me the way I was going about it was sound so consider this method <strong>Resig Approved</strong>&trade;.</p>

<h3>UPDATE</h3>

<p>John alerted me to this: Seems that <a href="http://www.google.com/trends?q=jquery%2C+prototype">jQuery is now more popular than Prototype</a> &#8211; far as search queries go at least. Congrats John &amp; the jQuery team!</p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2008/03/14/structuring-jquery-for-speed-and-efficiency/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Agile Development Workflow Part 2 &#8211; Love the sync</title>
		<link>http://somedirection.com/2008/01/12/agile-development-workflow-part-2-love-the-sync/</link>
		<comments>http://somedirection.com/2008/01/12/agile-development-workflow-part-2-love-the-sync/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 05:13:26 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Agile Development]]></category>
		<category><![CDATA[Shameless Promotion]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://somedirection.com/2008/01/12/agile-development-workflow-part-2-love-the-sync/</guid>
		<description><![CDATA[Continuation of Agile Development Workflow Part 1 &#8211; Setup (I&#8217;d start there). My lively-hood depends on the sync. It&#8217;s really what pulls all my projects together and unifies my workflow. It allows me to develop in numerous web technologies like Ruby On Rails, PHP, Django, Catalyst with relative ease, all at once. The Sync process [...]]]></description>
			<content:encoded><![CDATA[<p>Continuation of <strong><a href="/2007/05/27/agile-development-workflow-part-1-setup/">Agile Development Workflow Part 1 &#8211; Setup</a></strong> (I&#8217;d start there).
<img class="right" src='http://somedirection.com/wp-content/uploads/2008/01/the_sync.png' alt='sync' />
My lively-hood depends on the <strong>sync</strong>. It&#8217;s really what pulls all my projects together and unifies my workflow. It allows me to develop in numerous web technologies like Ruby On Rails, PHP, Django, Catalyst with relative ease, all at once. The Sync process is based on customized <a href="http://samba.anu.edu.au/rsync/">rsync commands</a>. Assuming that you set up ssh properly (see Part 1), all we have to do now is create our shell script that does the heavy lifting for us. Essentially we&#8217;re <em>pushing</em> all of our changes up to the server as we see fit. Rsync can be customized to upload only the files that change with relative ease.</p>

<p>The first thing we&#8217;ll want to do is create the sync file which will be responsible for handling the rsync process.
In the command line do:
<div class='code_parent'><div class='code_child'><code><pre>macAttack: kb$ sudo touch /usr/bin/sync 
macAttack: kb$ sudo chmod +x /usr/bin/sync 
macAttack: kb$ mate /usr/bin/sync</pre></code></div></div></p>

<p>You should be staring at an empty file. What we want to do is replicate the process you would usually do to push the site up live, or upload it to your development server via ftp.</p>

<p>It&#8217;s important that you have a consistent directory structure for your websites to get all of these &#8220;rules&#8221; setup (assuming that you&#8217;ll be working with multiple sites) properly. It will allow us to setup new rules with minimal effort.</p>

<p>I use Subversion (svn) for all of my projects and because of this I have a common directory structure for most of my web apps. It looks like this:
<div class='code_parent'><div class='code_child'><code><pre>macAttack: kb$ /Development/Project/trunk/</pre></code></div></div></p>

<p>For branches the directory structure looks like this:
<div class='code_parent'><div class='code_child'><code><pre>macAttack: kb$ /Development/Project/branches/<em>name</em></pre></code></div></div></p>

<p>The beauty of syncing is all changes get moved over, overwriting the previous files so you rarely run into any sync errors and if you do it&#8217;s usually user error. <img src='http://somedirection.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>Here are the contents of my sync script (simplified)
<div class='code_parent'><div class='code_child'><code><pre>#!/bin/bash</p>

<p>REPO=""
SRC=""
BRANCH=""
DEV="Development"
HOME="/Users/kb"</p>

<p>case $1 in
    s) 
      rsync --exclude-from=$HOME/.rsync-exclude -e "ssh" -ruv $HOME/$DEV/somedirection/trunk/blog/  serveradmin@mediatemple.com:~/domains/somedirection.com/html/
        exit
        ;;
    *) echo "Unrecognized"
        ;;
esac</p>

<p></pre></code></div></div></p>

<p>Let&#8217;s break it down.
<ol>
<li>&#8211;exclude-from=$HOME is setup to be the same path that relates to ~/. In my user home dir ~/ there&#8217;s a file named .rsync-exclude, this file is a line-break separated list of filenames we want to exclude in our sync. Check out my exclude list &raquo; <a href='http://somedirection.com/wp-content/uploads/2008/01/rsync-exclude.txt' title='rsync exclude'>rsync exclude</a>. The exclude list prevents .svn (subversion dir&#8217;s) from being pushed to the remote server, so you can work on a checked out copy of your web project, but the server only gets what it needs without any unnecessary files.</li>
<li>-e &#8220;ssh&#8221; tells rsync to go over ssh to sync the files, since we already set up ssh to enable auto-login to the remote server we won&#8217;t be prompted to provide a password on every sync (and you will sync alot).</li>
<li>finally we pass the parameters -ruv
 -r, &#8211;recursive             recurse into directories #this way you only have to pass a top level path
 -u, &#8211;update                update only (don&#8217;t overwrite newer files) #it&#8217;s important that your computers internal clock matches the remote servers
 -v, &#8211;verbose               increase verbosity
</li>
<li>The Local Path: $HOME/$DEV/somedirection/trunk/blog/ </li>
<li>The Remote Path: serveradmin@mediatemple.com:~/domains/somedirection.com/html/ => username@remotehost:remotepath</li>
</ul></p>

<p>If the following command is run from from Terminal:
<div class='code_parent'><div class='code_child'><code><pre>macAttack: kb$/usr/bin/sync s</pre></code></div></div>
If all goes well you should get verbose output from your sync!</p>

<p>Rsync is a powerful tool, can work wonders with <a href="http://www.linux.com/feature/117236">backups</a> as well.</p>

<p>Let me know if you found this article helpful and give feedback. Stay tuned for Sync integration with TextMate that will really put your whole dev process in overdrive!</p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2008/01/12/agile-development-workflow-part-2-love-the-sync/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP and Smarty First Impressions</title>
		<link>http://somedirection.com/2007/12/01/php-smarty-first-impressions/</link>
		<comments>http://somedirection.com/2007/12/01/php-smarty-first-impressions/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 15:07:37 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Review]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[php smarty costumzee]]></category>

		<guid isPermaLink="false">http://somedirection.com/2007/12/01/php-smarty-first-impressions/</guid>
		<description><![CDATA[Recently I&#8217;ve begun work on a newer, cooler, better, version of Costumzee.com with the elite hax0rs over at Mech Media. Scott and I decided to utilize a php temple engine called Smarty for better separation of code and presentation. A couple things worth noting before I dig in here: The extent of my PHP knowledge [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://somedirection.com/wp-content/uploads/2007/12/smarty-logo-orange1.gif' alt='Smarty Logo' />
Recently I&#8217;ve begun work on a newer, cooler, better, version of <a href="http://costumzee.com">Costumzee.com</a> with the elite hax0rs over at <a href="http://mechmedia.com">Mech Media</a>. <a href="http://jangro.com">Scott</a> and I decided to utilize a <a href="http://smarty.php.net/">php temple engine</a> called <a href="http://smarty.php.net/">Smarty</a> for better separation of code and presentation.
A couple things worth noting before I dig in here:
<ol>
<li>The extent of my PHP knowledge is minimal &#8211; what I know of PHP is what I&#8217;ve done when tinkering with WordPress</li>
<li>My knowledge of backend web development is also minimal. I&#8217;ve been a frontend guy my whole web career. I pwn xhtml/css/javascript, but server-side dev is completely new to me (I&#8217;m finally nipping that knowledge-gap in the butt).</li>
<li>I <strong>do</strong> have knowledge of template engines. When I worked on <a href="http://quibblo.com">Quibblo.com</a> full time, we used the <a href="http://catalyst.perl.org/">Perl Catalyst Framework</a> and I got savvy with <a href="http://template-toolkit.org/">Template Toolkit</a> which allowed me to dive into Smarty fairly quickly.</li></p>

<p></ol>
But without further ado..
Couple things I <strong>Love</strong> about Smarty
<ul>
<li>The {debug} function. At the drop of a hat I can see everything available to me and integrate it on the front end (.tpl files).</li>
<li>Plugins. I needed a way to paginate, and with minimal knowledge I was able to leverage <a href="http://www.phpinsider.com/php/code/SmartyPaginate/">SmartyPaginate</a> to get the job done.</li>
<li>I was productive day 1. It&#8217;s PHP (which is not a challenging language to begin with) and there&#8217;s a separation of code and presentation. I&#8217;ve dabbled with <abbr title="Ruby On Rails">ROR</abbr>, and the learning curve of doing something <strong>productive</strong>, <strong>interesting</strong>, and <strong>unique</strong> is just so much easier, because you don&#8217;t have to worry &#8220;am I doing this the way they <em>want</em> me to?&#8221;. </li>
<li>Smarty <a href="http://smarty.php.net/manual/en/">documentation</a> is awesome. It&#8217;s brief and concise with really world useful examples. When I do get tripped up with something Smarty related it&#8217;s a matter of referencing the documentation and in a couple minutes I&#8217;m on my way.</li>
</ul></p>

<p>The very few things that I&#8217;ve gotten stuck on have been mostly due to a lack of my PHP knowledge and not so much a result of issues with Smarty so far. And unique to my situation, I had Scott right there to bounce questions off of when I hit a wall which was also great. </p>

<p>All in all it&#8217;s a great to leverage a templating engine like Smarty when you&#8217;re beginning to learn more about backend web development. I&#8217;ve always shied away from it because I was always working with other programmers that were more than capable in that area and my talents were always restricted to the front-side of the glorious interweb. </p>

<p>I was never interested much in PHP. I always felt like the future of the web was with a framework like Ruby On Rails, but I am pleasantly surprised with my Smarty experience so far and it&#8217;s made me excited to develop with PHP more down the road.</p>

<p>Currently, I&#8217;m developing with ROR and Smarty and I hope to compare and contrast the two in the future, stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2007/12/01/php-smarty-first-impressions/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Web Design Survey 2007 Results</title>
		<link>http://somedirection.com/2007/10/18/web-design-survey-2007-results/</link>
		<comments>http://somedirection.com/2007/10/18/web-design-survey-2007-results/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 20:13:56 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://somedirection.com/2007/10/18/web-design-survey-2007-results/</guid>
		<description><![CDATA[Back in April I wrote a post to encouraged visitors to take the Web Design Survey. The results are in! And it&#8217;s looking fairly interesting. For the first time, I feel like I have some perspective.]]></description>
			<content:encoded><![CDATA[<p>Back in April I wrote a post to encouraged visitors to take the <a href="http://alistapart.com">Web Design Survey</a>.</p>

<p><a href="http://alistapart.com/articles/2007surveyresults"><img src="http://alistapart.com/d/2007surveyresults/survey-logo.gif" alt="Web Design Survey" /></a> </p>

<p>The results are in! And it&#8217;s looking fairly interesting. For the first time, I feel like I have some perspective. </p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2007/10/18/web-design-survey-2007-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dress By Design Featured in USA Today</title>
		<link>http://somedirection.com/2007/08/02/dress-by-design-featured-in-usa-today/</link>
		<comments>http://somedirection.com/2007/08/02/dress-by-design-featured-in-usa-today/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 13:47:53 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://somedirection.com/2007/08/02/dress-by-design-featured-in-usa-today/</guid>
		<description><![CDATA[USA Today recently featured Dress By Design in an article about personalization in the apparel marketplace. To be shown on the same level as major retailers like Steve Madden and Lands End is an accomplishment in itself. Great news!]]></description>
			<content:encoded><![CDATA[<div style='margin: 5px 0 0 10px; padding: 5px;'  class='img right'><a href='http://dressbydesign.com' rel='attachment wp-att-43' title='Dress By Design'><img src='http://somedirection.com/wp-content/uploads/2007/05/logo-salmon.gif' alt='Dress By Design' /></a></div>

<p>USA Today recently featured <a href="http://www.dressbydesign.com">Dress By Design</a> in an <a href="http://www.usatoday.com/life/lifestyle/fashion/2007-07-31-online-shopping_N.htm?loc=interstitialskip">article </a> about personalization in the apparel marketplace.</p>

<p>To be shown on the same level as major retailers like Steve Madden and Lands End is an accomplishment in itself. Great news!</p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2007/08/02/dress-by-design-featured-in-usa-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fright Catalog.com, 2007 Edition</title>
		<link>http://somedirection.com/2007/07/19/fright-catalogcom-2007-edition/</link>
		<comments>http://somedirection.com/2007/07/19/fright-catalogcom-2007-edition/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 02:44:21 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://somedirection.com/2007/07/19/fright-catalogcom-2007-edition/</guid>
		<description><![CDATA[At my previous position I worked for Fright Catalog out of Worcester, MA. It was a great position and one I shared with my home grown team of friends and colleagues (Dan, Bill, and Joe). In retrospect, we had the perfect balance of work &#38; fun &#8211; learning &#38; productivity. But like anything in life, [...]]]></description>
			<content:encoded><![CDATA[<p>At my previous position I worked for Fright Catalog out of Worcester, MA. It was a great position and one I shared with my home grown team of friends and colleagues (<a href="http://enlightsolutions.com">Dan</a>, <a href="http://billrowell.com">Bill</a>, and <a href="http://crankhouse.com">Joe</a>). In retrospect, we had the perfect balance of work &amp; fun &#8211; learning &amp; productivity.  But like anything in life, times change. The pinnacle of our achievement, our e-commerce engine codenamed <em>Metroid</em>, is still being improved and growing to this day. After years in development, it&#8217;s a very robust application and one that has been re-factored with ease to power <a href="http://www.yumdrop.com">Yum Drop</a> and forth-coming <a href="http://importcostumes.com">Import Costumes</a> (I&#8217;m sure there will be others soon!).</p>

<p>Although I no longer work there full-time, I am still fairly involved with all developments, and I&#8217;m proud to unveil the 2007 Edition of <a href="http://frightcatalog.com">FrightCatalog.com</a>. Let me know what you think!</p>

<p><a href="http://frightcatalog.com"><img class="pic" src='http://somedirection.com/wp-content/uploads/2007/07/fc_2007.jpg' alt='FC 2007' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://somedirection.com/2007/07/19/fright-catalogcom-2007-edition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
