<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>DevPatch</title>
  <link href="http://www.devpatch.com/atom.xml" rel="self"/>
  <link href="http://www.devpatch.com/"/>
  <updated>2011-08-22T11:25:08-07:00</updated>
  <id>http://www.devpatch.com/</id>
  <author>
    <name>Benjamin Sternthal</name>
    
  </author>

  
  <entry>
    <title>Symptoms That Something Is Seriously Wrong at a Startup</title>
    <link href="http://www.devpatch.com/2011/08/symptoms-that-something-is-seriously-wrong-at-a-startup"/>
    <updated>2011-08-22T09:42:00-07:00</updated>
    <id>http://www.devpatch.com/2011/08/symptoms-that-something-is-seriously-wrong-at-a-startup</id>
    <content type="html">&lt;p&gt;For most of my professional career, from 1999-2007 I worked at large corporations (Conde Nast, John Wiley &amp;amp; Sons) and had
almost no experience with either startups or small companies. There are huge differences in these work environments and
for me, the most troubling was not knowing which problems were normal and which were signs of systemic problems that could
kill the company.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;p&gt;While working at one small startup I reached out to a VC friend with the following question:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;I realize that financial problems go hand in hand with a startup, but what are the symptoms that something is seriously wrong?&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;And his response:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Running low on cash with no prospects of funding is definitely a bad sign.  Also lack of customer traction, no revenues and executive team turnover.  If I had to name the &quot;top three&quot; this would be it.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Having worked at two startups, including one in &lt;a href=&quot;http://en.wikipedia.org/wiki/2008%E2%80%932011_Icelandic_financial_crisis&quot;&gt;Iceland during the financial collapse (kreppa)&lt;/a&gt;
I would agree with his statement. I would add that these are not necessarily fatal but do signal that something is seriously wrong with the business.
If the CEO/founder is aware of these issues and proceeds along the same path, you could be looking at a failed business.&lt;/p&gt;

&lt;p&gt;The above quote also demonstrates the importance of having mentors/advisors outside of your startup bubble. Once you take the leap to
start/work at a  new company you often find yourself both hearing what you want to hear and surrounding yourself with people that tell you what you want to hear.
A healthy dose of skepticism from an outside source (outside of the board of directors) is invaluable.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Octopress . . .Some Thoughts</title>
    <link href="http://www.devpatch.com/2011/08/octopress-thoughts"/>
    <updated>2011-08-15T00:00:00-07:00</updated>
    <id>http://www.devpatch.com/2011/08/octopress-thoughts</id>
    <content type="html">&lt;p&gt;I recently switched my blog from Wordpress to Octopress. Below are some thoughts/points I collected during this process.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;I generally like Octopress, and for me there are big advantages to using a static site generator over Wordpress (better security, no mysql, faster).
However there are some issues (mostly minor) that came about as I began to really use it.&lt;/p&gt;

&lt;h2&gt;The Technology Stack&lt;/h2&gt;

&lt;p&gt;Octopress is a &quot;framework&quot; in the sense that it combines various technologies into a static site generator. On the plus side, you can leverage
lots of interesting tools. On the bad side, if you are not already familiar with these tools you will have a lot to learn.&lt;/p&gt;

&lt;p&gt;You could just use the stock design and feature set, but I think the most common use of this product will to be to customize the
HTML/CSS/JS and stick with the Jekyll page generation framework.&lt;/p&gt;

&lt;p&gt;That being said, to create a custom theme you will need to understand the CSS/JS/HTML (unless you start from scratch) along with the SASS &amp;amp; COMPASS
technologies.&lt;/p&gt;

&lt;p&gt;If you run into any bugs or display issues there are a lot of layers you may need to pull back. The below list is what I consider
the significant technologies in use. If there is a display error (for example an IE8 bug I found) you may need to go through a lot of layers in the
stack before finding the cause.&lt;/p&gt;

&lt;h3&gt;Source Control, Configuration, Preview, Build, and Deploy&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Ruby&lt;/li&gt;
&lt;li&gt;RVM&lt;/li&gt;
&lt;li&gt;Rake&lt;/li&gt;
&lt;li&gt;Jekyll&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;Theming (CSS)&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;SASS&lt;/li&gt;
&lt;li&gt;COMPASS-style&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;Theming (JS)&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Modernizer.js (including plugins like respond.js, yepnope.js)&lt;/li&gt;
&lt;li&gt;ender.js&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;Theming (Templates &amp;amp; Posts/Pages)&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;HTML5&lt;/li&gt;
&lt;li&gt;YAML&lt;/li&gt;
&lt;li&gt;Markdown&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;Keeping Updated&lt;/h2&gt;

&lt;p&gt;Updating Octopress from github is not as smooth as it can/should be. My workflo has been to update into a branch and confirm I have a good read
on everything before doing a merge.&lt;/p&gt;

&lt;p&gt;This should be improved/less risky in future versions and I already see some tweaks being pushed to github. However it pays to be careful.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Octopress is pretty cool and if you have the time to tinker it can be a lot of fun. I would just re-iterate that it's still relatively young and
is a work-in-progress.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Setting up PhpStorm 2 with XDebug and MAMP</title>
    <link href="http://www.devpatch.com/2011/02/setting-up-phpstorm-2-with-xdebug-and-mamp"/>
    <updated>2011-02-23T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2011/02/setting-up-phpstorm-2-with-xdebug-and-mamp</id>
    <content type="html">&lt;p&gt;Getting XDebug setup and working with PhpStorm 2 is relatively painless but I thought I would add some hints I found when setting this up. These instructions assume you are debugging a web based application using MAMP as your server environment.&lt;/p&gt;

&lt;!--more--&gt;




&lt;h2&gt;Turn on Xdebug For MAMP&lt;/h2&gt;


&lt;p&gt;Luckily, the version of MAMP that I have, (and presumably yours too) comes with xdebug so no need to download anything. You can confirm you have everything by making sure you have the xdebug.so file in your php extensions folder (assuming you are using php 5.3).&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;div class='line'&gt;MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;After confirming the above, the next step is to edit the php.ini file and enable this extension. At the bottom of your php.ini file you should already have an item under xdebug with the correct path. Uncomment this line and add an additional option to enable remote debugging. Note, in the below example I removed the full path to the extension, you should have the full path in your ini file.&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;config.ini &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='ini'&gt;&lt;div class='line'&gt;&lt;span class=&quot;k&quot;&gt;[xdebug]&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;zend_extension&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;path/to/xdebug.so&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;xdebug.remote_enable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;true&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;After editing, save the .ini file and restart apache. You can confirm xdebug is enabled by looking at the output of phpinfo and checking that an xdebug line appears in the credits... as seen in this screenshot.
&lt;img class='' src='http://www.devpatch.com/images-posts/2011/02/phpinfo.png' width='619' height='97' alt='' title=''&gt;&lt;/p&gt;

&lt;h2&gt;Add Browser Shortcuts&lt;/h2&gt;


&lt;p&gt;We now need to add some &quot;triggers&quot; for starting and stopping debugging. Jetbrains supplies an easy way to do this via bookmarklets. You can generate these by going to &lt;a href=&quot;http://www.jetbrains.com/phpstorm/marklets/&quot;&gt;http://www.jetbrains.com/phpstorm/marklets/&lt;/a&gt; and click generate under the XDebug column, drag these to your bookmarks bar in your favorite browser.&lt;/p&gt;

&lt;h2&gt;Setup PHPStorm&lt;/h2&gt;


&lt;p&gt;The latest PHPstorm (version 2) makes this so easy! Simply go to your PHP project and click the &quot;Start Listening PHP Debug Connections&quot; button in the toolbar.
&lt;img class='' src='http://www.devpatch.com/images-posts/2011/02/listen-debug.png' width='540' height='49' alt='' title=''&gt;&lt;/p&gt;

&lt;p&gt;For testing, just add a breakpoint on a file that you can invoke with a web-browser. You can set a breakpoint by clicking in the gutter.&lt;/p&gt;

&lt;h2&gt;Trigger the Debugger&lt;/h2&gt;


&lt;p&gt;Go back to your browser and load your app in a manner that will trigger the breakpoint. Click the bookmarklet for xDebug start session and refresh. You should see a response in phpstorm, confirming that it is able to listen to XDebug requests.&lt;/p&gt;

&lt;p&gt;You are all done!&lt;/p&gt;

&lt;h2&gt;Useful Links&lt;/h2&gt;


&lt;p&gt;The post from jetbrains going into more detail on using their debugger:
&lt;a href=&quot;http://blogs.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/&quot;&gt;http://blogs.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An outdated video on remote debugging with PHPStorm, there are some good tid-bits at the end concerning code inspection:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.jetbrains.com/webide/2010/08/remote-debugging-in-phpstorm/&quot;&gt;http://blogs.jetbrains.com/webide/2010/08/remote-debugging-in-phpstorm/&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>A Full Page Width Scroller For jQueryUI - wideScroller</title>
    <link href="http://www.devpatch.com/2010/11/widescroller"/>
    <updated>2010-11-22T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/11/widescroller</id>
    <content type="html">&lt;p&gt;&lt;img class='left ' src='http://www.devpatch.com/images-posts/2010/11/featured-image1.png' width='400' height='247' alt='' title=''&gt;
I needed a full page width image scroller that supported &quot;infinite scrolling&quot; and could handle being positioned, where the 1st image is aligned to something on the page. Poking around I found most jQuery scrollers made use of scrollTo and would not work when the window was the container. So I coded my own as a jQueryUI widget, this widget can be used with any HTML content.&lt;/p&gt;

&lt;!--more--&gt;




&lt;div style=&quot;clear:both&quot;&gt;&lt;/div&gt;




&lt;h2&gt;Requirements&lt;/h2&gt;


&lt;p&gt;To use wideScroller you need the following:&lt;/p&gt;

&lt;ol class=&quot;num&quot;&gt;
    &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/bensternthal/jquery.ui.dpui.wideScroller&quot;&gt;jquery.ui.dpui.wideScroller.js&lt;/a&gt;&lt;/strong&gt; - the wide scroller widget&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://jquery.com/&quot;&gt;jquery-1.5&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://jqueryui.com/&quot;&gt;jquery-ui-1.8.4&lt;/a&gt; - requires widget factory, can include effect if you want fancy easing&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://benalman.com/projects/jquery-throttle-debounce-plugin/&quot;&gt;jquery.ba-throttle-debounce&lt;/a&gt; - used to throttle the window resize event&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;del&gt;You must use jquery-1.4.2 because of &lt;a href=&quot;http://bugs.jquery.com/ticket/7193&quot;&gt;a bug that was introduced in jQuery 1.4.3&lt;/a&gt; and is not currently resolved. This bug will only affect you if the total width of your scrollable elements is greater than 10000px. Once this bug is resolved you should be able to update to the latest jQuery without changing any code.&lt;/del&gt;&lt;/p&gt;

&lt;h2&gt;Download Code&lt;/h2&gt;


&lt;p&gt;&lt;a href=&quot;https://github.com/bensternthal/jquery.ui.dpui.wideScroller&quot;&gt;Grab the source &amp; examples from github.&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;Vew Demo&lt;/h2&gt;


&lt;p&gt;
&lt;a href=&quot;http://demo.devpatch.com/jquery.ui.dpui.wideScroller/examples/basic.html&quot;&gt;This demo shows the basic functionality&lt;/a&gt; - take a look before reading further as it will help explain things. Note how the &quot;active&quot; image is aligned with the &quot;locator&quot; div and how things work correctly if you resize the page.
&lt;/p&gt;




&lt;h2&gt;The HTML Template&lt;/h2&gt;




&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;foo.html &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;span class='line'&gt;19&lt;/span&gt;
&lt;span class='line'&gt;20&lt;/span&gt;
&lt;span class='line'&gt;21&lt;/span&gt;
&lt;span class='line'&gt;22&lt;/span&gt;
&lt;span class='line'&gt;23&lt;/span&gt;
&lt;span class='line'&gt;24&lt;/span&gt;
&lt;span class='line'&gt;25&lt;/span&gt;
&lt;span class='line'&gt;26&lt;/span&gt;
&lt;span class='line'&gt;27&lt;/span&gt;
&lt;span class='line'&gt;28&lt;/span&gt;
&lt;span class='line'&gt;29&lt;/span&gt;
&lt;span class='line'&gt;30&lt;/span&gt;
&lt;span class='line'&gt;31&lt;/span&gt;
&lt;span class='line'&gt;32&lt;/span&gt;
&lt;span class='line'&gt;33&lt;/span&gt;
&lt;span class='line'&gt;34&lt;/span&gt;
&lt;span class='line'&gt;35&lt;/span&gt;
&lt;span class='line'&gt;36&lt;/span&gt;
&lt;span class='line'&gt;37&lt;/span&gt;
&lt;span class='line'&gt;38&lt;/span&gt;
&lt;span class='line'&gt;39&lt;/span&gt;
&lt;span class='line'&gt;40&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;ws-currentItem&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt; of
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;ws-totalItems&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;#&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;prev&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;#&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;next&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt; &amp;gt; &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;scroller&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;scroller-spinner&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;scroller-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;dpui-ws-item dpui-ws-active&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;images/image1.png&amp;quot;&lt;/span&gt;  &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;940&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;dpui-ws-item&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;images/image2.png&amp;quot;&lt;/span&gt;  &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;940&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;dpui-ws-item&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;images/tom.jpg&amp;quot;&lt;/span&gt;  &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;371&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;dpui-ws-item&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;images/image4.png&amp;quot;&lt;/span&gt;  &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;250&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;dpui-ws-item&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;images/image5.png&amp;quot;&lt;/span&gt;  &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;250&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;dpui-ws-item&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;images/image6.png&amp;quot;&lt;/span&gt;  &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;940&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;p&gt;Each scrollable item requires the class &lt;strong&gt;dpui-ws-item&lt;/strong&gt; and the active item requires the class &lt;strong&gt;dpui-ws-active&lt;/strong&gt;. Most of the other classes can be specified in the options (see below). The HTML and CSS from github is thoroughly commented.&lt;/p&gt;




&lt;h2&gt;The CSS&lt;/h2&gt;


&lt;p&gt;The opacity is just for the demo, you can use any styling you like. , For the locator, in this example its a fixed width centered div, this would likely be your top nav or something similar.&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;foo.css &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;span class='line'&gt;19&lt;/span&gt;
&lt;span class='line'&gt;20&lt;/span&gt;
&lt;span class='line'&gt;21&lt;/span&gt;
&lt;span class='line'&gt;22&lt;/span&gt;
&lt;span class='line'&gt;23&lt;/span&gt;
&lt;span class='line'&gt;24&lt;/span&gt;
&lt;span class='line'&gt;25&lt;/span&gt;
&lt;span class='line'&gt;26&lt;/span&gt;
&lt;span class='line'&gt;27&lt;/span&gt;
&lt;span class='line'&gt;28&lt;/span&gt;
&lt;span class='line'&gt;29&lt;/span&gt;
&lt;span class='line'&gt;30&lt;/span&gt;
&lt;span class='line'&gt;31&lt;/span&gt;
&lt;span class='line'&gt;32&lt;/span&gt;
&lt;span class='line'&gt;33&lt;/span&gt;
&lt;span class='line'&gt;34&lt;/span&gt;
&lt;span class='line'&gt;35&lt;/span&gt;
&lt;span class='line'&gt;36&lt;/span&gt;
&lt;span class='line'&gt;37&lt;/span&gt;
&lt;span class='line'&gt;38&lt;/span&gt;
&lt;span class='line'&gt;39&lt;/span&gt;
&lt;span class='line'&gt;40&lt;/span&gt;
&lt;span class='line'&gt;41&lt;/span&gt;
&lt;span class='line'&gt;42&lt;/span&gt;
&lt;span class='line'&gt;43&lt;/span&gt;
&lt;span class='line'&gt;44&lt;/span&gt;
&lt;span class='line'&gt;45&lt;/span&gt;
&lt;span class='line'&gt;46&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='css'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nf&quot;&gt;#scroller&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;525px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nf&quot;&gt;#scroller-container&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;35px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;480px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100000px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nc&quot;&gt;.dpui-ws-item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nc&quot;&gt;.dpui-ws-active&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nf&quot;&gt;#locator&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;980px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nf&quot;&gt;#scroller-spinner&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#f5f5f5&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(images/spinner.gif)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;center&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;center&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;h2&gt;The JavaScript&lt;/h2&gt;




&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;foo.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;#scroller&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;wideScroller&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;h2&gt;Options&lt;/h2&gt;


&lt;p&gt;wideScroller provides the following options:&lt;/p&gt;

&lt;table class=&quot;blog-table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;offsetLocatorID&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: yes&lt;br/&gt;
            default value: #locator&lt;br/&gt;
            &lt;i&gt;identifies the locator, where the content will be aligned&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;containerID&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: yes&lt;br/&gt;
            default value: #scroller-container&lt;br/&gt;
            &lt;i&gt;the container of the scrollable elements, must be different from the element the widget is invoked upon&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;loaderID&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: yes&lt;br/&gt;
            default value: #scroller-spinner&lt;br/&gt;
            &lt;i&gt;hides the scrollable items while we re-shuffle them, see examples&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;nextButtonClass&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: yes&lt;br/&gt;
            default value: .next&lt;br/&gt;
            &lt;i&gt;the class of the next button/link&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;prevButtonClass&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: yes&lt;br/&gt;
            default value: .prev&lt;br/&gt;
            &lt;i&gt;the class of the prev button/link&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;showItemNumbers&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: no&lt;br/&gt;
            default value: true&lt;br/&gt;
            &lt;i&gt;set to true if you want to display 1 of XX&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;currentItemDisplayClass&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: no unless showItemNumbers is true&lt;br/&gt;
            default value: .ws-currentItem&lt;br/&gt;
            &lt;i&gt;if showItemNumbers is true class of current item display&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;totalItemDisplayClass&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: no unless showItemNumbers is true&lt;br/&gt;
            default value: .ws-totalItems&lt;br/&gt;
            &lt;i&gt;if showItemNumbers is true class of total items display&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;goToItem&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: no&lt;br/&gt;
            default value: null&lt;br/&gt;
            &lt;i&gt;used if you want to set an image other than the first as the inital image (see specify-start.html example) &lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;easing&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: yes&lt;br/&gt;
            default value: linear&lt;br/&gt;
            &lt;i&gt;the easing effect for the scroll, can use jqueryUI easing if you are including.&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;speed&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            required: yes&lt;br/&gt;
            default value: 300&lt;br/&gt;
            &lt;i&gt;the speed of the scrolling, because you might be animating a large number of large images, you may need to adjust this to cut down on &quot;tearing&quot;&lt;/i&gt;
        &lt;/td&gt;
    &lt;/tr&gt;                                        
&lt;/table&gt;




&lt;br/&gt;


&lt;h2&gt;Events&lt;/h2&gt;


&lt;p&gt;The following events have callbacks that you can hook into:&lt;/p&gt;

&lt;table class=&quot;blog-table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;startScroll&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            scrolling has started
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;stopScroll&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            scrolling has stopped
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;nextButtonClick&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            next button clicked
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;previousButtonClick&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            previous button clicked
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;strong&gt;resize&lt;/strong&gt;
        &lt;/td&gt;
        &lt;td&gt;
            window resize, (likely to be invoked numerous times)
        &lt;/td&gt;
    &lt;/tr&gt;                
&lt;/table&gt;




&lt;br/&gt;


&lt;p&gt;
    You can hook into a callback when the widget is instantiated or after instantiation using the standard jQuery UI Widget Interface:
&lt;/p&gt;




&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;foo.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;c1&quot;&gt;//During Instantiation&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;#scroller&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;wideScroller&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;startScroll&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.foo&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;hide&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;stopScroll&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.foo&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c1&quot;&gt;//After Instantiation Using Jquery UI Widget&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;#scroller&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;wideScroller&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;option&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;startScroll&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.foo&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;hide&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;h2&gt;Performance&lt;/h2&gt;


&lt;p&gt;
    If you are sliding a large number of images or if the images have very large dimensions you may notice some &quot;tearing&quot; in certain browsers. You can tweak both the easing and speed to find what fits best for your use-case. I have found that a faster speed (smaller in ms) makes the animation look smoother. If you are able to use &gt; jquery.1.4.3 you can also play with &lt;a href=&quot;http://api.jquery.com/jQuery.fx.interval/&quot;&gt;jQuery.fx.interval&lt;/a&gt;. 
&lt;/p&gt;




&lt;h2&gt;How It Works&lt;/h2&gt;


&lt;p&gt;
Some details on how the widget works, not required reading but might be useful if something is not working as expected. Note that in the illustrative images the grey area is the visible browser window.
&lt;/p&gt;




&lt;p&gt;
&lt;strong&gt;Default State Before Widget&lt;/strong&gt;
Before the widget loads, the page looks something like this (depending on browser). The &quot;first&quot; image is flush with the browser window and the rest of the images extend to the right. This initial state is not very important as the widget will move everything around.
&lt;img class='' src='http://www.devpatch.com/images-posts/2010/11/pre-widget.png' width='595' height='400' alt='' title=''&gt;
&lt;/p&gt;




&lt;p&gt;
&lt;strong&gt;Widget Is Loaded&lt;/strong&gt;
When the widget loads, it  aligns the active image to the location of a user defined ID. It then re-orders the images... when it reaches one that is beyond the right edge of the window it appends those images before the active image in reverse order.
&lt;img class='' src='http://www.devpatch.com/images-posts/2010/11/loaded.png' width='595' height='400' alt='' title=''&gt;

&lt;/p&gt;




&lt;p&gt;
&lt;strong&gt;Moving Forward&lt;/strong&gt;
Advancing through the images, all images are scrolled (using animate) the width of the next image... the next image aligns to the same location. Prior to animating we clone the first image image from the left to the right. The image is cloned so the scrolling appears smooth if the image is visible on the left and will be visible on the right during the animation (so image 4 would be visible going off the left edge and appearing to come in from the right edge). The cloned image is kept but the original is removed. Similar steps occur when moving backward.
    &lt;img class='' src='http://www.devpatch.com/images-posts/2010/11/forward-one.png' width='595' height='400' alt='' title=''&gt;

&lt;/p&gt;




&lt;h2&gt;Final Thoughts&lt;/h2&gt;


&lt;p&gt;
    If you have any comments or questions, please feel free to contact me or just use the below comment form.
&lt;/p&gt;



</content>
  </entry>
  
  <entry>
    <title>IDEs For Front End Development & PHP</title>
    <link href="http://www.devpatch.com/2010/10/ides-for-front-end-development-php"/>
    <updated>2010-10-19T00:00:00-07:00</updated>
    <id>http://www.devpatch.com/2010/10/ides-for-front-end-development-php</id>
    <content type="html">&lt;p&gt;&lt;img class='left ' src='http://www.devpatch.com/images-posts/2010/10/4-ide1.png' width='300' height='274' alt='' title=''&gt;
I make my living as a front-end developer and spend the majority of my time in an IDE. So the IDE for me, is an incredibly important piece of software. I've played with and purchased a bunch of em' and what follows are my personal thoughts on each. I hope this might save you some time/money when deciding which IDE to invest in.&lt;/p&gt;

&lt;p&gt;Some of these IDEs I used for years, others for only a short time. All were used on a minimum of one real project from creation to launch. If you are interested in a spreadsheet type feature list, head on over to Wikipedia's &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments&quot;&gt;http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments&lt;/a&gt;. If you don't want to read the pros/cons of each just skip to the conclusion.&lt;/p&gt;

&lt;!--more--&gt;




&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;




&lt;h2&gt;Requirements&lt;/h2&gt;


&lt;p&gt;OS X is my primary OS so all the IDE's are available for that platform. Some are also available on Linux or Windows but not all. My top priorities for IDEs in no particular order are:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
    &lt;li&gt;Support For Various Version Control Systems (GIT and SVN minimum)&lt;/li&gt;
    &lt;li&gt;Syntax coloring/validation/code completion for the following
        &lt;ol class=&quot;num&quot;&gt;
            &lt;li&gt;HTML&lt;/li&gt;
            &lt;li&gt;CSS&lt;/li&gt;
            &lt;li&gt;Javascript&lt;/li&gt;
            &lt;li&gt;PHP&lt;/li&gt;
        &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li&gt;Support code completion for JS and PHP frameworks (jQuery/YUI and Zend Framework on the PHP side)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;Contenders&lt;/h2&gt;


&lt;p&gt;The IDE's I Evaluated:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
    &lt;li&gt;Coda &lt;/li&gt;
    &lt;li&gt;TextMate&lt;/li&gt;
    &lt;li&gt;Aptana 2&lt;/li&gt;
    &lt;li&gt;PhpStorm &lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;Coda&lt;/h2&gt;


&lt;p&gt;&lt;strong&gt;URL:&lt;/strong&gt; &lt;a href=&quot;http://www.panic.com/coda/&quot;&gt;http://www.panic.com/coda/&lt;/a&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; $99
&lt;strong&gt;Pros:&lt;/strong&gt;
I used this editor for many years, writing everything from basic HTML/CSS to full apps using Drupal and Zend Framework. Overall the interface is great and very intuitive.  The file browser is wonderful, better than all the other IDE's tested, you can easily duplicate and otherwise mess around with your file structure without leaving the IDE (I use duplicate file a lot). For some reason a lot of IDE's have a crappy file interface.&lt;/p&gt;

&lt;p&gt;SVN integration is implemented fairly well but Coda does not come with a file compare tool, so to use that you need the OSX developer tools, once installed works great.&lt;/p&gt;

&lt;p&gt;The editor for HTMl/CSS/JavaScript is basic and works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;
Coda is a basic editor and lacks a lot of the features you need on a more complex project. Code completion works for standard HTML/CSS but is way too basic for Javascript. I could not get code completion to work with any external libraries, either jQuery or Zend Framework. This might be possible through hacks etc but it was not supported natively.&lt;/p&gt;

&lt;p&gt;Coda (as of writing) only supports SVN, so GIT is not an option (at least not natively).&lt;/p&gt;

&lt;p&gt;There are other features that Coda has that I never used, like sharing and the code hints. The code navigator (structure) is also too basic to be useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommendation:&lt;/strong&gt;
I used Coda for many years as my primary IDE, however as the projects I worked on became more complex I felt Coda was actually holding back my development. It was Coda's lack of GIT integration and &quot;real&quot; PHP code completion that prompted me to start looking at other IDE's.&lt;/p&gt;

&lt;p&gt;Overall Coda is great for basic HTML/CSS and I still use it for this purpose. However on a project with non-trivial Javascript or any PHP I would look elsewhere.&lt;/p&gt;

&lt;h2&gt;Textmate&lt;/h2&gt;


&lt;p&gt;&lt;strong&gt;URL:&lt;/strong&gt; &lt;a href=&quot;http://macromates.com/&quot;&gt;http://macromates.com/&lt;/a&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; $56
&lt;strong&gt;Pros:&lt;/strong&gt;
Textmate is incredibly customizable, and if you like color themes, there are a ton out there. Textmate relies heavily on bundles to add functionality. So if you need any additional version control systems and/or language support that is not native, you grab a bundle and off you go. Basic code completion worked relatively well however you mile may vary depending on what frameworks/external libraries you use. jQuery was a bit funky, that might have been due to the bundle I used and I never got Zend Framework code completion to work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;
As I mentioned before I never got the Textmate code completion really working with jQuery or Zend Framework, this might have been my failing but honestly this stuff should be easy.&lt;/p&gt;

&lt;p&gt;GIT integration worked via a bundle (not sure which one I used) but the interface was klunky, I still had to use the terminal.&lt;/p&gt;

&lt;p&gt;Customization and key commands are great but not intuitive and there is a steep learning curve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommendation:&lt;/strong&gt;
Whenever I go to a Javascript meetup or watch a front-end presentation online, tons of people use Textmate and that's why I first tried it. However in my experience it was not a very good IDE. Textmate explicitly states that it is not an IDE &lt;em&gt;&quot;TextMate is not an IDE but by using its powerful snippets, macros, and unique scoping system, it can often provide features that even a language specific IDE lacks.&quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That being said, I got frustrated trying to get everything working.. things I expected to run out of the box like GIT, did not.. and when they were installed things did not feel integrated. If you have the time, textmate can be a pretty powerful tool but for me, it was too klunky and too much of a pain to get setup the way I wanted it.&lt;/p&gt;

&lt;h2&gt;Aptana 2&lt;/h2&gt;


&lt;p&gt;URL: &lt;a href=&quot;http://www.aptana.com/&quot;&gt;http://www.aptana.com/&lt;/a&gt;
Cost: Free&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;
It's Eclipse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;
It's Eclipse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommendation:&lt;/strong&gt;
I really tried to love Aptana. Aptana was the first IDE that I got Zend Framework code completion working. Then I upgraded to a new version, everything went to pot, and  I abandoned Aptana after that.&lt;/p&gt;

&lt;p&gt;Aptana at it's core is Eclipse with a bunch of Aptana developed tools added on. These add support for HTML/CSS/JS code assist, JS debugging, FTP/SFTP deploying etc. All these things work, but they do not feel integrated... Aptana always feels like a java ide with some front end stuff added on ... because that's exactly what it is.&lt;/p&gt;

&lt;p&gt;A good example are the options that eclipse has (colors, editor settings etc) there are about a million of these.. and as a front end developer you only need some of them. Lot's of Eclipse baggage.&lt;/p&gt;

&lt;p&gt;PHP support is provided by PDT, Aptana used to bundle their own PHP plugin but this was removed in Aptana 2 and might be added back in Aptana 3. In either case the PHP code support was OK but it's buggy.&lt;/p&gt;

&lt;p&gt;To me Aptana is way too much and way too much that has nothing to do with front end web development. Things might change in Aptana 3 but for now this is not an IDE I would recommend.&lt;/p&gt;

&lt;h2&gt;PhpStorm&lt;/h2&gt;


&lt;p&gt;URL: &lt;a href=&quot;http://www.jetbrains.com/phpstorm/&quot;&gt;http://www.jetbrains.com/phpstorm/&lt;/a&gt;
Cost: $99 or $49 if promo is running
&lt;strong&gt;Pros:&lt;/strong&gt;
Great support for code completion, things tend to work out of the box. If you have jQuery or Zend in your project or path, PHP storm just finds it.. and indexes it. Code completion even works with file paths and with image sizes. So after inserting an image you can use code completion to fill out the width and height. Whoah an IDE that actually makes web development easier, very nice!!&lt;/p&gt;

&lt;p&gt;PHP support in my experience was flawless (used on both a Wordpress project and a Zend Framework project).&lt;/p&gt;

&lt;p&gt;Version control is tightly integrated, GIT integration is well done. Never had to use the console.&lt;/p&gt;

&lt;p&gt;Lots of &quot;helpers&quot; specifically for front end devs, great CSS editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;
PHPstorm is a java app so it will run in windows/linux/osx. On OS X it runs fine except it's memory usage tends to increase hour by hour, eventually I restart it... especially if I have photoshop or another memory heavy app open.&lt;/p&gt;

&lt;p&gt;The file manager is less than ideal, I often use &quot;reveal in finder&quot; and do copying and other file operations outside of the IDE.&lt;/p&gt;

&lt;p&gt;The project creation process has a small learning curve, not very intuitive but also not a deal breaker. One thing I do not like, there is no master list of projects you have created, there is a list of recent projects... but I am not sure if this lists everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommendation:&lt;/strong&gt;
Best front-end IDE out there and probably the best PHP IDE.  Actually feels like they used Front End Web Development use cases when adding features.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;


&lt;p&gt;Both Phpstorm and Coda feel like they were created specifically to make the lives of front end developers easier, and it shows. PhpStorm is the stronger IDE of the two, and I highly recommend it. It has a lot of features that make your life easier, everything feels integrated and nothing is overwhelming. So for HTML/CSS/Javascript/PHP I would (and do) use PhpStorm.&lt;/p&gt;

&lt;p&gt;Please do share your opinions in the comments and if you have any other IDE suggestions please let me know.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Should You Extend or Wrap jQuery UI 1.8 Widgets</title>
    <link href="http://www.devpatch.com/2010/05/should-you-extend-or-wrap-jquery-ui-1-8-widgets"/>
    <updated>2010-05-21T00:00:00-07:00</updated>
    <id>http://www.devpatch.com/2010/05/should-you-extend-or-wrap-jquery-ui-1-8-widgets</id>
    <content type="html">&lt;p&gt;As part of a recent project I was tasked with creating a set of custom jQuery UI widgets. When specing my  widgets I discovered almost all would use some existing widget features, like sortable.&lt;strong&gt; I found myself trying to decide if I should extend existing widgets or somehow wrap the existing widgets with my custom code?&lt;/strong&gt; I think this is a common question.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://jqueryui.com/docs/Developer_Guide&quot;&gt;jQuery UI widget factory&lt;/a&gt; provides a method to inherit one and only one widget. For example If you look at some of the jquery ui widget source code (draggable, droppable, sortable) you will notice that most inherit &lt;strong&gt;mouse&lt;/strong&gt;. However when writing my own widgets I found that I never needed to do any of the things inheritance was intended for, such as overriding methods.&lt;/p&gt;

&lt;p&gt;For me, I just needed some of the default widget behaviors (like sortable) applied to my own custom code.&lt;strong&gt; I decided to wrap the existing widget behavior rather than extend.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So how does this work? Let's take the example of a page selector.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;My hypothetical page selector widget needs to do the following:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
    &lt;li&gt;User can click to select a page&lt;/li&gt;
        &lt;li&gt;User can reorder pages&lt;/li&gt;
        &lt;li&gt;Selecting or Reordering triggers an ajax save&lt;/li&gt;
        &lt;li&gt;I want to append the draggabe handle in the JS&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;As you can see there is a mix of behavior, the reordering is boiler plate sortable, but appending the draggable handle and other features are all custom.&lt;/p&gt;

&lt;p&gt;A quick visual:&lt;/p&gt;

&lt;p&gt;&lt;img class='' src='http://www.devpatch.com/images-posts/2010/05/page-selector.png' width='455' height='95' alt='' title=''&gt;&lt;/p&gt;

&lt;p&gt;So for this widget I want to use sortable to handle the sorting, but everything else will be custom code.&lt;/p&gt;

&lt;p&gt;Here is the base/empty code for our widget:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;base.js&lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ui.pageSelector&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;_create&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;       &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;_destroy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;       &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;     &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;h2&gt;Options&lt;/h2&gt;


&lt;p&gt;Our first challenge are the options. We have two sets of options, the options for sortable and the options for pageSelector (our custom widget). You can handle options as either one object or two.&lt;/p&gt;

&lt;h3&gt;One Object&lt;/h3&gt;




&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;jquery.ui.pageSelector.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ui.pageSelector&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;customName&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;customValue&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;.sort-item&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;handle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.sort-handle&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;containment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;.page-slider-container&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;placeholder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sort-item-placeholder ui-state-highlight&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;forcePlaceholderSize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;0.6&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;revert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;100&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;100&amp;#39;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;In the above example options for the wrapped widget and the custom widget are all together (&lt;strong&gt;customName&lt;/strong&gt; is for the pageSelector widget). I think there are significant problems with this approach, for example when we instantiate sortable we pass it options it does not need, and I can imagine name conflicts (if you are not careful).&lt;/p&gt;

&lt;h3&gt;Two Objects&lt;/h3&gt;




&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;jquery.ui.pageSelector.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ui.pageSelector&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;customName&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;customValue&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;sortableOptions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;.sort-item&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;handle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.sort-handle&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;containment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;.page-slider-container&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;placeholder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sort-item-placeholder ui-state-highlight&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;forcePlaceholderSize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;0.6&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;revert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;100&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;100&amp;#39;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;I like the second approach better as we can handle the sortable options separately. Later when we invoke sortable we can pass just the options it needs.&lt;/p&gt;

&lt;h2&gt;Instantiating The Wrapped Widget&lt;/h2&gt;


&lt;p&gt;In the &lt;strong&gt;_create&lt;/strong&gt; method we can now instantiate the sortable, passing in the sortableOptions object:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;jquery.ui.pageSelector.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;_create&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sortable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sortableOptions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;h2&gt;Hooking Into The Wrapped Widget&lt;/h2&gt;


&lt;p&gt;Now that our widget is instantiated we can start adding the widget specific behavior. In this example we want to trigger a save on the wrapped sortable's event &lt;strong&gt;sortupdate&lt;/strong&gt;. To do this we can bind that event in our &lt;strong&gt;_create&lt;/strong&gt; method:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;jquery.ui.pageSelector.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;_create&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sortable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sortableOptions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;sortupdate&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ui&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_saveSortOrder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;You can also invoke methods on your sortable using this syntax:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;foo.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sortable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;serialize&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;The above approach has worked really well for me and I was able to create custom widgets that encapsulated the behavior I needed.&lt;/p&gt;

&lt;h2&gt;Option Based Function Callbacks&lt;/h2&gt;


&lt;p&gt;Semi-related: I discovered that some &quot;widgets&quot; that you might want to wrap (say non jQuery UI like tinyMCE) allow callback functions to be defined as an option. This can cause problems if you want to invoke a function from within your widget.&lt;/p&gt;

&lt;p&gt;For example&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;jquery.ui.pageSelector.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ui.pageSelector&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;customName&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;customValue&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;someFooOptions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;save_callback&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;             &lt;span class=&quot;c1&quot;&gt;//I want to do something here!&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;In the above example I want the save behavior to be handled by my custom widget, but the code I am wrapping only provides a callback method. You can't invoke widget methods from the options since there is no scope.&lt;/p&gt;

&lt;p&gt;My solution was to use a trigger bound to this widgets instance:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;jquery.ui.pageSelector.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ui.pageSelector&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;customName&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;customValue&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;someFooOptions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;save_callback&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                &lt;span class=&quot;c1&quot;&gt;// Trigger Custom Event&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;trigger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;my:customSaveEvent&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nx&quot;&gt;_create&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;my:customSaveEvent&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;           &lt;span class=&quot;c1&quot;&gt;//do stuff&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;}),&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;In this example I trigger the &quot;my:customSaveEvent&quot; in the callback. This event is bound to behavior in my widget. For this to work you just need to somehow get the id of the widget passed in (or some other identifier). You want to be careful not to trigger the event on the entire document as you may have multiple widgets instantiated.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Communication Between jQuery UI Widgets</title>
    <link href="http://www.devpatch.com/2010/03/communication-between-jquery-ui-widgets"/>
    <updated>2010-03-22T00:00:00-07:00</updated>
    <id>http://www.devpatch.com/2010/03/communication-between-jquery-ui-widgets</id>
    <content type="html">&lt;p&gt;When writing user interfaces using jQuery I often need widgets to interact with each other. For example, an ajax status widget that displays a spinner when an ajax call starts, and displays a status message when the ajax call completes. This widget should be accessible by whatever other widgets are on the page.&lt;/p&gt;

&lt;p&gt;In the past I directly called methods from each widget, but this creates a lot of &quot;glue code&quot; and dependencies.  I had recently watched this &lt;a href=&quot;http://developer.yahoo.com/yui/theater/video.php?v=zakas-architecture&quot;&gt;YUI Theatre video on Scalable Javascript Application Architecture&lt;/a&gt; and wanted to apply the following to my jQuery UI Widgets:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
&lt;li&gt;Widgets should be able to live on their own&lt;/li&gt;
&lt;li&gt;Keep everything loosely coupled&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;Approach&lt;/h2&gt;


&lt;p&gt;Given the above I decided to use jQuery's custom events to enable publish/speak and subscribe/listen into my widgets. Each widget would publish certain events and subscribe to others. This approach effectively decouples the widgets and allows them to function independently.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;The two key jQuery methods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://api.jquery.com/bind/&quot;&gt;bind&lt;/a&gt;&lt;/strong&gt; - Bind will perform the &quot;listen&quot; or &quot;subscribe&quot;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://api.jquery.com/trigger/&quot;&gt;trigger&lt;/a&gt;&lt;/strong&gt; - Trigger will perform the &quot;speak&quot; or &quot;publish&quot;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;Example Code Subscribe/Listen&lt;/h2&gt;


&lt;p&gt;Note I am using &lt;strong&gt;jQuery 1.4.2&lt;/strong&gt; &amp;amp; &lt;strong&gt;jQuery UI 1.8rc3&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The following is a bare bones widget and has most of the code removed so it can serve as an example. This widget has two bound custom events &lt;strong&gt;dpui:ajaxStart&lt;/strong&gt; &amp;amp; &lt;strong&gt;dpui:ajaxEnd&lt;/strong&gt; (DPUI is just my namespace for events &quot;DevPatch UI&quot;). Whenever the custom events are triggered the widget will output text to a firebug console.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATED March 22, 2010&lt;/strong&gt;
I updated my custom event format to &lt;em&gt;namespace:eventName&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATED July 20, 2011&lt;/strong&gt;
Removed unnecessary jquery.&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;jquery.ui.ajazStatus.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;span class='line'&gt;19&lt;/span&gt;
&lt;span class='line'&gt;20&lt;/span&gt;
&lt;span class='line'&gt;21&lt;/span&gt;
&lt;span class='line'&gt;22&lt;/span&gt;
&lt;span class='line'&gt;23&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ui.ajaxStatus&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;_create&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;dpui-widget&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;dpui:ajaxStart&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ajax start&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;dpui:ajaxEnd&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;ajax end&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;destroy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Widget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;destroy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;apply&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;arguments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;h2&gt;Example Code Speak/Publish&lt;/h2&gt;


&lt;p&gt;Below is the code that would be in another widget.&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;foo.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.dpui-widget&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;trigger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;dpui:ajaxStart&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;The class .dpui-widget is my namespace class that is applied to every UI widget with speak/listen. If you wanted to do this globally you could use:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;foo.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;trigger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;dpui:ajaxStart&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;Important to note here that I am not calling &lt;strong&gt;dpui:ajaxStart&lt;/strong&gt; on the ajax widget, instead I am triggering this event on a sub-set of document objects. Any document objects that are subscribed to this custom event will have their action triggered.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;


&lt;p&gt;I think the above approach solves many of my problems, but I can imagine some issues, especially on larger projects.&lt;/p&gt;

&lt;p&gt;If you have additional thoughts or suggestions for a different approach please leave a comment.&lt;/p&gt;

&lt;p&gt;The following two blog posts were very helpful and are a good intro to jQuery widgets and event pooling.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/&quot;&gt;http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.michaelhamrah.com/blog/2009/12/organizing-javascript-for-event-pooling-with-jquery/&quot;&gt;http://www.michaelhamrah.com/blog/2009/12/organizing-javascript-for-event-pooling-with-jquery/&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Deploying Zend Framework With Apache ANT</title>
    <link href="http://www.devpatch.com/2010/03/deploying-zend-framework-with-apache-ant"/>
    <updated>2010-03-03T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/03/deploying-zend-framework-with-apache-ant</id>
    <content type="html">&lt;p&gt;I recently wrote a quick ANT script to deploy a personal Zend Framework project and thought I would share the code. If you are just getting started with Agile development, ANT builds/deployments are a great first step with immediate benefits. The following example is bare-bones, it does not run tests or do anything complicated but it should give you something that works and can be built upon.&lt;/p&gt;

&lt;p&gt;For more ANT goodness check out my other posts: &lt;a href=&quot;http://blog.sternthal.org/2008/12/19/using-ant-to-deploy-drupal/&quot;&gt;Deploying Drupal with ANT&lt;/a&gt;, &lt;a href=&quot;http://blog.sternthal.org/2008/12/23/css-cache-busting-and-drupal/&quot;&gt;CSS Cache Busting &amp;amp; Drupal&lt;/a&gt;, &lt;a href=&quot;http://blog.sternthal.org/2009/05/18/integrating-yuicompressor-into-ant-builds/&quot;&gt; Using YUI Compressor with ANT&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Methodology&lt;/h2&gt;


&lt;p&gt;For my project I need ANT to do the following:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
   &lt;li&gt;Checkout From Subversion HEAD Or A Specific Revision Of The Project&lt;/li&gt;
   &lt;li&gt;Remove Files That Should Not Go To Production (Documentation)&lt;/li&gt;
   &lt;li&gt;Configure Zend For The Correct Environment&lt;/li&gt;
   &lt;li&gt;Securely Transfer Code To Production Server&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I think this is a very common use-case so... onto the code!&lt;/p&gt;

&lt;!--more--&gt;




&lt;h2&gt;Pre-Reqs&lt;/h2&gt;


&lt;ul class=&quot;disc&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://ant.apache.org/&quot;&gt;Apache ANT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://subclipse.tigris.org/svnant.html&quot;&gt;SnvAnt&lt;/a&gt; - Provides Subversion Interface To ANT&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://ant.apache.org/&quot;&gt;JSCH Jars&lt;/a&gt; - Provides SCP To ANT&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I am using Zend 1.10. In this example the only Zend dependency is using Zend_Application with production/development sections in your application.ini file.&lt;/p&gt;

&lt;h2&gt;Setup Zend&lt;/h2&gt;


&lt;p&gt;Setting up Zend is the easy part. We need a folder within our project to hold two files:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
   &lt;li&gt;build.xml - the file that contains all the ant tasks&lt;/li&gt;
   &lt;li&gt;build.properties.prod - the file that contains the properities required by build.xml&lt;/li&gt;   
&lt;/ul&gt;


&lt;p&gt;We also need a .htaccess file that will be used in production.  The important part of this file is APPLICATION_ENV, this value is used by Zend to determine what environment it is in and what settings to use from your application.ini file.&lt;/p&gt;

&lt;p&gt;Simply copy the .htaccess file that is already there, and rename to htaccess.prod. Edit the file and change
&lt;b&gt;SetEnv APPLICATION_ENV development&lt;/b&gt; to &lt;b&gt;SetEnv APPLICATION_ENV production&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;The below screenshot shows how I have set things up. Orange arrows are the important parts.&lt;/p&gt;

&lt;p&gt;&lt;img class='' src='http://www.devpatch.com/images-posts/2010/03/zend-ant.gif' width='275' height='300' alt='' title=''&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;build.properties.prod&lt;/h2&gt;


&lt;p&gt;Below is my example properties file. Included are settings for:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
&lt;li&gt;Locations of Subversion Jar Files&lt;/li&gt;
&lt;li&gt;Subversion Login Information&lt;/li&gt;
&lt;li&gt;Temp File Locations&lt;/li&gt;
&lt;li&gt;Path To Comment File&lt;/li&gt;
&lt;li&gt;Production Server Information (user/pwd are entered a runtime)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The path to the comment file is where we will instruct ANT to insert the version information and timestamp. This allows us to &quot;view source&quot; on the production site and see the revision information and date/time of last build.&lt;/p&gt;

&lt;p&gt;You need to customize all values for your own environment, the comments within the file should help explain what you need to do.&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;build.properties &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;span class='line'&gt;19&lt;/span&gt;
&lt;span class='line'&gt;20&lt;/span&gt;
&lt;span class='line'&gt;21&lt;/span&gt;
&lt;span class='line'&gt;22&lt;/span&gt;
&lt;span class='line'&gt;23&lt;/span&gt;
&lt;span class='line'&gt;24&lt;/span&gt;
&lt;span class='line'&gt;25&lt;/span&gt;
&lt;span class='line'&gt;26&lt;/span&gt;
&lt;span class='line'&gt;27&lt;/span&gt;
&lt;span class='line'&gt;28&lt;/span&gt;
&lt;span class='line'&gt;29&lt;/span&gt;
&lt;span class='line'&gt;30&lt;/span&gt;
&lt;span class='line'&gt;31&lt;/span&gt;
&lt;span class='line'&gt;32&lt;/span&gt;
&lt;span class='line'&gt;33&lt;/span&gt;
&lt;span class='line'&gt;34&lt;/span&gt;
&lt;span class='line'&gt;35&lt;/span&gt;
&lt;span class='line'&gt;36&lt;/span&gt;
&lt;span class='line'&gt;37&lt;/span&gt;
&lt;span class='line'&gt;38&lt;/span&gt;
&lt;span class='line'&gt;39&lt;/span&gt;
&lt;span class='line'&gt;40&lt;/span&gt;
&lt;span class='line'&gt;41&lt;/span&gt;
&lt;span class='line'&gt;42&lt;/span&gt;
&lt;span class='line'&gt;43&lt;/span&gt;
&lt;span class='line'&gt;44&lt;/span&gt;
&lt;span class='line'&gt;45&lt;/span&gt;
&lt;span class='line'&gt;46&lt;/span&gt;
&lt;span class='line'&gt;47&lt;/span&gt;
&lt;span class='line'&gt;48&lt;/span&gt;
&lt;span class='line'&gt;49&lt;/span&gt;
&lt;span class='line'&gt;50&lt;/span&gt;
&lt;span class='line'&gt;51&lt;/span&gt;
&lt;span class='line'&gt;52&lt;/span&gt;
&lt;span class='line'&gt;53&lt;/span&gt;
&lt;span class='line'&gt;54&lt;/span&gt;
&lt;span class='line'&gt;55&lt;/span&gt;
&lt;span class='line'&gt;56&lt;/span&gt;
&lt;span class='line'&gt;57&lt;/span&gt;
&lt;span class='line'&gt;58&lt;/span&gt;
&lt;span class='line'&gt;59&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='properties'&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# build.properties&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# This file is referenced by the  build.xml file.&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# External jars needed for Subversion&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Example:&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# lib.dir=/usr/local/ant/lib&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# svnant.jar=${lib.dir}/svnant.jar&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# svnClientAdapter.jar=${lib.dir}/svnClientAdapter.jar&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# svnjavahl.jar=${lib.dir}/svnjavahl.jar&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;lib.dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/share/ant/lib&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;svnant.jar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;${lib.dir}/svnant.jar&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;svnClientAdapter.jar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;${lib.dir}/svnClientAdapter.jar&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;svnjavahl.jar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;${lib.dir}/svnjavahl.jar&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Subversion Login and URL&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Example:&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# svnant.repository.user=username&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# svnant.repository.passwd=password&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# svnant.project.url=svn://XXX.XXX.XX.XX/path/to/project&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;svnant.repository.user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;username&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;svnant.repository.passwd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;password&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;svnant.project.url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;svn://path.to.your.repo.project/trunk&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Build Folder Locations&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Example:&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# temp.dir=temp&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# build.dir=release&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;temp.dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/temp/scratch&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;build.dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/temp/release&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Comment File Location, Where we output revision information requires tokens&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# in file: @build-revision@&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;comment.file.path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/your-app/views/scripts/common/footer.phtml&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Deploy Location and Login&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# Example:&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# deploy.server=sugababes.com&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# deploy.path=/path/to/directory&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;# -----------------------------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;deploy.server&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;productionserver.com&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;deploy.path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/full/path&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;err&quot;&gt;&amp;lt;&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;




&lt;h2&gt;build.xml&lt;/h2&gt;


&lt;p&gt; Contained within the build XML file are all the tasks used by ANT. First the tasks we will actually run:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
    &lt;li&gt;build-release : checksout and builds release (good for testing without sending to production)&lt;/li&gt;
    &lt;li&gt;deploy-release : deploys release and expands on target server&lt;/li&gt;
    &lt;li&gt;build-deploy : a short cut that builds and releases to production in one step (most commonly used)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The above relies on the following ANT tasks to do the actual work:&lt;/p&gt;

&lt;ul class=&quot;disc&quot;&gt;
   &lt;li&gt;clean : clean up from any previous builds&lt;/li&gt;
   &lt;li&gt;checkout : checkout project from subversion&lt;/li&gt;
   &lt;li&gt;cleanRelease : removes folders that should not be deployed (documentation, the build folder)&lt;/li&gt;
   &lt;li&gt;populate : copy and rename the correct htaccess file, remove old one&lt;/li&gt;
   &lt;li&gt;revision : find token in file, replace with revision number and date/time stamp&lt;/li&gt;
   &lt;li&gt;zip release : compress file &lt;/li&gt;
   &lt;li&gt;deploy : use scp to transfer zip file&lt;/li&gt;
   &lt;li&gt;extractConfigure : delete existing files on target server, extract zip file on target server.&lt;/li&gt;
&lt;/ul&gt;




&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;build.xml &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;span class='line'&gt;19&lt;/span&gt;
&lt;span class='line'&gt;20&lt;/span&gt;
&lt;span class='line'&gt;21&lt;/span&gt;
&lt;span class='line'&gt;22&lt;/span&gt;
&lt;span class='line'&gt;23&lt;/span&gt;
&lt;span class='line'&gt;24&lt;/span&gt;
&lt;span class='line'&gt;25&lt;/span&gt;
&lt;span class='line'&gt;26&lt;/span&gt;
&lt;span class='line'&gt;27&lt;/span&gt;
&lt;span class='line'&gt;28&lt;/span&gt;
&lt;span class='line'&gt;29&lt;/span&gt;
&lt;span class='line'&gt;30&lt;/span&gt;
&lt;span class='line'&gt;31&lt;/span&gt;
&lt;span class='line'&gt;32&lt;/span&gt;
&lt;span class='line'&gt;33&lt;/span&gt;
&lt;span class='line'&gt;34&lt;/span&gt;
&lt;span class='line'&gt;35&lt;/span&gt;
&lt;span class='line'&gt;36&lt;/span&gt;
&lt;span class='line'&gt;37&lt;/span&gt;
&lt;span class='line'&gt;38&lt;/span&gt;
&lt;span class='line'&gt;39&lt;/span&gt;
&lt;span class='line'&gt;40&lt;/span&gt;
&lt;span class='line'&gt;41&lt;/span&gt;
&lt;span class='line'&gt;42&lt;/span&gt;
&lt;span class='line'&gt;43&lt;/span&gt;
&lt;span class='line'&gt;44&lt;/span&gt;
&lt;span class='line'&gt;45&lt;/span&gt;
&lt;span class='line'&gt;46&lt;/span&gt;
&lt;span class='line'&gt;47&lt;/span&gt;
&lt;span class='line'&gt;48&lt;/span&gt;
&lt;span class='line'&gt;49&lt;/span&gt;
&lt;span class='line'&gt;50&lt;/span&gt;
&lt;span class='line'&gt;51&lt;/span&gt;
&lt;span class='line'&gt;52&lt;/span&gt;
&lt;span class='line'&gt;53&lt;/span&gt;
&lt;span class='line'&gt;54&lt;/span&gt;
&lt;span class='line'&gt;55&lt;/span&gt;
&lt;span class='line'&gt;56&lt;/span&gt;
&lt;span class='line'&gt;57&lt;/span&gt;
&lt;span class='line'&gt;58&lt;/span&gt;
&lt;span class='line'&gt;59&lt;/span&gt;
&lt;span class='line'&gt;60&lt;/span&gt;
&lt;span class='line'&gt;61&lt;/span&gt;
&lt;span class='line'&gt;62&lt;/span&gt;
&lt;span class='line'&gt;63&lt;/span&gt;
&lt;span class='line'&gt;64&lt;/span&gt;
&lt;span class='line'&gt;65&lt;/span&gt;
&lt;span class='line'&gt;66&lt;/span&gt;
&lt;span class='line'&gt;67&lt;/span&gt;
&lt;span class='line'&gt;68&lt;/span&gt;
&lt;span class='line'&gt;69&lt;/span&gt;
&lt;span class='line'&gt;70&lt;/span&gt;
&lt;span class='line'&gt;71&lt;/span&gt;
&lt;span class='line'&gt;72&lt;/span&gt;
&lt;span class='line'&gt;73&lt;/span&gt;
&lt;span class='line'&gt;74&lt;/span&gt;
&lt;span class='line'&gt;75&lt;/span&gt;
&lt;span class='line'&gt;76&lt;/span&gt;
&lt;span class='line'&gt;77&lt;/span&gt;
&lt;span class='line'&gt;78&lt;/span&gt;
&lt;span class='line'&gt;79&lt;/span&gt;
&lt;span class='line'&gt;80&lt;/span&gt;
&lt;span class='line'&gt;81&lt;/span&gt;
&lt;span class='line'&gt;82&lt;/span&gt;
&lt;span class='line'&gt;83&lt;/span&gt;
&lt;span class='line'&gt;84&lt;/span&gt;
&lt;span class='line'&gt;85&lt;/span&gt;
&lt;span class='line'&gt;86&lt;/span&gt;
&lt;span class='line'&gt;87&lt;/span&gt;
&lt;span class='line'&gt;88&lt;/span&gt;
&lt;span class='line'&gt;89&lt;/span&gt;
&lt;span class='line'&gt;90&lt;/span&gt;
&lt;span class='line'&gt;91&lt;/span&gt;
&lt;span class='line'&gt;92&lt;/span&gt;
&lt;span class='line'&gt;93&lt;/span&gt;
&lt;span class='line'&gt;94&lt;/span&gt;
&lt;span class='line'&gt;95&lt;/span&gt;
&lt;span class='line'&gt;96&lt;/span&gt;
&lt;span class='line'&gt;97&lt;/span&gt;
&lt;span class='line'&gt;98&lt;/span&gt;
&lt;span class='line'&gt;99&lt;/span&gt;
&lt;span class='line'&gt;100&lt;/span&gt;
&lt;span class='line'&gt;101&lt;/span&gt;
&lt;span class='line'&gt;102&lt;/span&gt;
&lt;span class='line'&gt;103&lt;/span&gt;
&lt;span class='line'&gt;104&lt;/span&gt;
&lt;span class='line'&gt;105&lt;/span&gt;
&lt;span class='line'&gt;106&lt;/span&gt;
&lt;span class='line'&gt;107&lt;/span&gt;
&lt;span class='line'&gt;108&lt;/span&gt;
&lt;span class='line'&gt;109&lt;/span&gt;
&lt;span class='line'&gt;110&lt;/span&gt;
&lt;span class='line'&gt;111&lt;/span&gt;
&lt;span class='line'&gt;112&lt;/span&gt;
&lt;span class='line'&gt;113&lt;/span&gt;
&lt;span class='line'&gt;114&lt;/span&gt;
&lt;span class='line'&gt;115&lt;/span&gt;
&lt;span class='line'&gt;116&lt;/span&gt;
&lt;span class='line'&gt;117&lt;/span&gt;
&lt;span class='line'&gt;118&lt;/span&gt;
&lt;span class='line'&gt;119&lt;/span&gt;
&lt;span class='line'&gt;120&lt;/span&gt;
&lt;span class='line'&gt;121&lt;/span&gt;
&lt;span class='line'&gt;122&lt;/span&gt;
&lt;span class='line'&gt;123&lt;/span&gt;
&lt;span class='line'&gt;124&lt;/span&gt;
&lt;span class='line'&gt;125&lt;/span&gt;
&lt;span class='line'&gt;126&lt;/span&gt;
&lt;span class='line'&gt;127&lt;/span&gt;
&lt;span class='line'&gt;128&lt;/span&gt;
&lt;span class='line'&gt;129&lt;/span&gt;
&lt;span class='line'&gt;130&lt;/span&gt;
&lt;span class='line'&gt;131&lt;/span&gt;
&lt;span class='line'&gt;132&lt;/span&gt;
&lt;span class='line'&gt;133&lt;/span&gt;
&lt;span class='line'&gt;134&lt;/span&gt;
&lt;span class='line'&gt;135&lt;/span&gt;
&lt;span class='line'&gt;136&lt;/span&gt;
&lt;span class='line'&gt;137&lt;/span&gt;
&lt;span class='line'&gt;138&lt;/span&gt;
&lt;span class='line'&gt;139&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='xml'&gt;&lt;div class='line'&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;DevPatch Client App&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;basedir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;.&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;default=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;usage&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;description&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    Build File For DevPatch Client Zend Deployment - checkout from subversion,
&lt;/div&gt;&lt;div class='line'&gt;    cleans release, creates zip file and scp file to the correct environment.
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/description&amp;gt;&lt;/span&gt;    
&lt;/div&gt;&lt;div class='line'&gt;    
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;file=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;build.properties.${env}&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Subversion                                            --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;     
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;project.classpath&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;pathelement&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;location=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${svnjavahl.jar}&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;pathelement&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;location=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${svnant.jar}&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;pathelement&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;location=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${svnClientAdapter.jar}&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/path&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;typedef&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;resource=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;org/tigris/subversion/svnant/svnantlib.xml&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;na&quot;&gt;classpathref=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;project.classpath&amp;quot;&lt;/span&gt;  &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;checkout&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;svn&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;username=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${svnant.repository.user}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;             &lt;span class=&quot;na&quot;&gt;password=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${svnant.repository.passwd}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nt&quot;&gt;&amp;lt;checkout&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;url=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${svnant.project.url}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;             &lt;span class=&quot;na&quot;&gt;revision=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${revision}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;             &lt;span class=&quot;na&quot;&gt;destPath=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/svn&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Utility &amp;amp; Clean Up                                    --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;         
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clean&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;dir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;  
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;cleanRelease&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;dir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}/build&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;dir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}/db&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;    
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;dir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}/docs&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;      
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Replace Token In Footer With Revision Number          --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;     
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;revision&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;svn&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;         &lt;span class=&quot;nt&quot;&gt;&amp;lt;status&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;revisionProperty=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Revision&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/svn&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;tstamp/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;      &lt;span class=&quot;nt&quot;&gt;&amp;lt;replace&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;file=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}${comment.file.path}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;               &lt;span class=&quot;na&quot;&gt;token=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;@build-revision@&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;               &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Revision: ${Revision}, Built On: ${DSTAMP} : ${TSTAMP}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Copy/rename correct htaccess file. Remove existing    --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- file                                                  --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;     
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;populate&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;file=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}/public/clients-admin/.htaccess&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;copy&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;file=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}/public/clients-admin/htaccess.${env}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;tofile=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}/public/clients-admin/.htaccess&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;   
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;file=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}/public/clients-admin/htaccess.${env}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;   &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- zip release                                           --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;         
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;zipRelease&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;mkdir&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;dir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${build.dir}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;zip&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;destfile=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${build.dir}/YOUR-FILE-NAME_${revision}.zip&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;             &lt;span class=&quot;na&quot;&gt;basedir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${temp.dir}&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;antcall&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clean&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- deploy to target server                                  --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;     
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;deploy&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;scp&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;file=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${build.dir}/YOUR-FILE-NAME_${revision}.zip&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;todir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${user}@${deploy.server}:${deploy.path}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;password=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${pass}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;trust=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Extract and configure on target server, delete        --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- manually everything, create data folder        --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- set correct dir permissions                           --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;     
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;extractConfigure&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;sshexec&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;host=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${deploy.server}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                      &lt;span class=&quot;na&quot;&gt;username=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${user}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                  &lt;span class=&quot;na&quot;&gt;password=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${pass}&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                  &lt;span class=&quot;na&quot;&gt;trust=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;yes&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;                  &lt;span class=&quot;na&quot;&gt;command=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;cd ${deploy.path}; &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          rm -R app-clients-admin;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          rm -R library;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          rm -R public; &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          rm -R data;      &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          mkdir data;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          mkdir data/cache;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          mkdir data/session;                                              &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          chmod 775 data/cache;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          chmod 775 data/session;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          unzip -o YOUR-FILE-NAME_${revision}.zip;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                          rm YOUR-FILE-NAME_${revision}.zip;   &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                         &amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt; 
&lt;/div&gt;&lt;div class='line'&gt;        
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Targets                             --&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ===================================================== --&amp;gt;&lt;/span&gt;             
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;build-release&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;description=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Checksout and Build Release, Specify revision and environment (prod) &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                         Example: ant build-release -Drevision=HEAD -Denv=prod&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;depends=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clean,checkout,cleanRelease,populate,revision,zipRelease&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;deploy-release&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;description=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Deploys Release and Expands on Target Server &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                         Example: ant deploy-release -Drevision=value -Denv=prod -Duser=value -Dpass=value&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;depends=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;deploy,extractConfigure&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;build-deploy&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;          &lt;span class=&quot;na&quot;&gt;description=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Checksout,Build, Deploys in One Step&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;s&quot;&gt;                       Example: ant build-deploy -Drevision=value -Denv=prod -Duser=value -Dpass=value&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;na&quot;&gt;depends=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clean,checkout,cleanRelease,populate,revision,zipRelease,deploy,extractConfigure&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;           
&lt;/div&gt;&lt;div class='line'&gt;    
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;usage&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;message=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;  Execute &amp;#39;ant -projecthelp&amp;#39; for build file help.&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nt&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;message=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;  Execute &amp;#39;ant -help&amp;#39; for Ant help.&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;     
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;cleanRelease and extractConfigure is where you will likely need to do the most customizing. For example during extractConfigure I remove my data directory where I store cache/session data then re-create. This is something specific to my application.&lt;/p&gt;

&lt;p&gt;When running the ANT targets you supply the revision (or HEAD) the target environment (just prod in the example), and the username/password for your production environment:&lt;/p&gt;

&lt;p&gt;Example: ant build-deploy -Drevision=HEAD -Denv=prod -Duser=foo -Dpass=foobar&lt;/p&gt;

&lt;p&gt;The env variable is used to specify which properties file to use and which htaccess file to copy. If you supplied &lt;strong&gt;qa,&lt;/strong&gt; ANT would look for &lt;strong&gt;build.properties.qa&lt;/strong&gt; and &lt;strong&gt;htaccess.qa&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Running &lt;strong&gt;ant -projecthelp&lt;/strong&gt; will show you the 3 main targets and examples of their usage.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Debugging Front End Code, New Tools</title>
    <link href="http://www.devpatch.com/2010/03/debugging-front-end-code-new-tools"/>
    <updated>2010-03-01T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/03/debugging-front-end-code-new-tools</id>
    <content type="html">&lt;p&gt;Front End debugging tools have come a long way. Below are some of the tools I am using on a daily basis to debug and fine-tune my front end code.&lt;/p&gt;

&lt;h2&gt;Firebug - Firefox Plugin&lt;/h2&gt;


&lt;p&gt;&lt;a class=&quot;lb&quot; href=&quot;http://www.devpatch.com/images-posts/2010/03/firebug.png&quot;&gt;&lt;img src=&quot;http://www.devpatch.com/images-posts/2010/03/firebug-300x96.png&quot; alt=&quot;&quot; title=&quot;firebug&quot; width=&quot;300&quot; height=&quot;96&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://getfirebug.com/&quot;&gt;Firebug&lt;/a&gt; is my workhorse for general debugging. It has the standard set of CSS inspectors and a robust net monitor. The net monitor is essential for debugging XHR requests. I could not develop Ajax applications without it.&lt;/p&gt;

&lt;!--more--&gt;




&lt;h2&gt;Chrome - Developer Tools&lt;/h2&gt;


&lt;p&gt;&lt;a class=&quot;lb&quot; href=&quot;http://www.devpatch.com/images-posts/2010/03/chrome.png&quot;&gt;&lt;img src=&quot;http://www.devpatch.com/images-posts/2010/03/chrome-300x138.png&quot; alt=&quot;&quot; title=&quot;chrome&quot; width=&quot;300&quot; height=&quot;138&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google's chrome browser comes with an amazing set of developer tools and is quickly replacing firebug in my toolkit. It has all the standard CSS inspectors and JS debuggers but goes a bit further than firebug. I was blown away when I discovered CPU profiling. This is a great way to sniff out memory leaks, really important if you are adding/removing DOM elements like a madman.&lt;/p&gt;

&lt;p&gt;Also important to point out are the JS timeline tools, showing you a breakdown of loading, scripting, rendering while you are interacting with the web page. Another great tool for optimizing speed.&lt;/p&gt;

&lt;p&gt;&lt;a class=&quot;lb&quot; href=&quot;http://www.devpatch.com/images-posts/2010/03/timeline.png&quot;&gt;&lt;img src=&quot;http://www.devpatch.com/images-posts/2010/03/timeline-300x146.png&quot; alt=&quot;&quot; title=&quot;timeline&quot; width=&quot;300&quot; height=&quot;146&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Pixel Perfect - Firefox Plugin&lt;/h2&gt;


&lt;p&gt;&lt;a class=&quot;lb&quot; href=&quot;http://www.devpatch.com/images-posts/2010/03/pixelperfect.png&quot;&gt;&lt;img src=&quot;http://www.devpatch.com/images-posts/2010/03/pixelperfect-300x111.png&quot; alt=&quot;&quot; title=&quot;pixelperfect&quot; width=&quot;300&quot; height=&quot;111&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ultimate tool for making sure you have translated a design to HTML with pixel perfect accuracy. &lt;a href=&quot;http://www.pixelperfectplugin.com/&quot;&gt;Pixel Perfect&lt;/a&gt; allows you to overlay an image onto a web page and manipulate it's opacity. This makes it incredibly simple to compare a design mockup and your HTML.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Lectures on JavaScript History & Future</title>
    <link href="http://www.devpatch.com/2010/02/lectures-on-javascript-history-future"/>
    <updated>2010-02-15T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/02/lectures-on-javascript-history-future</id>
    <content type="html">&lt;p&gt;Douglas Crockford is currently giving a series of lectures on JavaScript. So far there are 2 and they are fascinating:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://developer.yahoo.com/yui/theater/&quot;&gt;http://developer.yahoo.com/yui/theater/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img class='' src='http://www.devpatch.com/images-posts/2010/02/crockonjs-300x168.png' width='300' height='168' alt='' title=''&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Load Routes From Routes.ini Config File In Zend Application Bootstrap</title>
    <link href="http://www.devpatch.com/2010/02/load-routes-from-routes-ini-config-file-in-zend-application-bootstrap"/>
    <updated>2010-02-10T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/02/load-routes-from-routes-ini-config-file-in-zend-application-bootstrap</id>
    <content type="html">&lt;p&gt;I spent waaaay to many hours trying to load routes via a config file in Zend Framework 1.10 and I think this might be a problem with the documentation I was following on the Zend Framework site. More on that later, let's get to my solution first.&lt;/p&gt;

&lt;p&gt;Here is the use case I am addressing: &lt;strong&gt;&lt;em&gt;I want to store routes in a .ini file and have this file loaded via the Application Bootstrap. Zend Application allows me to store these in the application.ini file but I have a large number and want to store them separately.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;First create your routes.ini file:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;config.ini &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='ini'&gt;&lt;div class='line'&gt;&lt;span class=&quot;k&quot;&gt;[production]&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;routes.linkA.route&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;linkA&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;routes.linkA.defaults.controller&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;linkB&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;na&quot;&gt;routes.linkA.defaults.action&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;linkBAction&amp;quot;&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;Where &lt;strong&gt;linkA&lt;/strong&gt; is the incoming route and &lt;strong&gt;linkB&lt;/strong&gt; is the outgoing route&lt;/p&gt;

&lt;p&gt;New let's add the function to load this file in the Bootstrap. Add the following to your boostrap.php:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;bootstrap.php &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='php'&gt;&lt;div class='line'&gt;&lt;span class=&quot;x&quot;&gt;protected function _initRewrite() {&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;x&quot;&gt;    $front = Zend_Controller_Front::getInstance();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;x&quot;&gt;    $router = $front-&amp;gt;getRouter();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;x&quot;&gt;   &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;x&quot;&gt;    $config = new Zend_Config_Ini(APPLICATION_PATH . &amp;#39;/configs/routes.ini&amp;#39;, &amp;#39;production&amp;#39;);      &lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;x&quot;&gt;    $router-&amp;gt;addConfig($config,&amp;#39;routes&amp;#39;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;x&quot;&gt;} &lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;That's it, everything should be working :-)&lt;/p&gt;

&lt;p&gt;The above use case is addressed in the Zend Framework Documentation but I could not get their example to work:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://framework.zend.com/manual/en/zend.controller.router.html&quot;&gt;http://framework.zend.com/manual/en/zend.controller.router.html&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Using Zend_Config with the RewriteRouter&lt;br/&gt;Sometimes it is more convenient to update a configuration file with&lt;br/&gt;new routes than to change the code. This is possible via&lt;br/&gt;the addConfig() method.&lt;br/&gt;&amp;nbsp;&lt;br/&gt; . . .&lt;br/&gt;&amp;nbsp;&lt;br/&gt;$config = new Zend_Config_Ini('/path/to/config.ini', 'production');&lt;br/&gt;$router = new Zend_Controller_Router_Rewrite();&lt;br/&gt;$router-&amp;gt;addConfig($config, 'routes');&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;No matter how hard I tried I could not get the above to work. It is very simple code but there are no instructions on where this can/should be run. Maybe this can't be run from the bootstrap? I even wrote a plugin and but no matter what I tried I could not get this to work using &lt;strong&gt; Zend_Controller_Router_Rewrite()&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It is also possible that I completely mis-understood the documentation and got all mixed up, I struggle with Zend Documentation sometimes.&lt;/p&gt;

&lt;p&gt;If you figure out how to do this using &lt;strong&gt; Zend_Controller_Router_Rewrite()&lt;/strong&gt; please leave a comment it was driving me nuts!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Installing Node.Js On OS X 10.6</title>
    <link href="http://www.devpatch.com/2010/02/installing-node-js-on-os-x-10-6"/>
    <updated>2010-02-08T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/02/installing-node-js-on-os-x-10-6</id>
    <content type="html">&lt;p&gt;&lt;strong&gt;Updated May 7 2010, With Version 0.1.94 From GitHub&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Node.js is evented i/o for &lt;a href=&quot;http://code.google.com/p/v8/&quot;&gt;Google's V8 Server Side JavaScript engine&lt;/a&gt;. For me . . . node.js means I can write apps that can handle tons of requests without having to learn/think about threads &amp;amp; locks (all I know about threads is that they are scary and involve big books from O'reilly).&lt;/p&gt;

&lt;p&gt;As a front-end developer the node.js approach is fantastic because I already think in terms of events and I love writing code in JavaScript.&lt;/p&gt;

&lt;p&gt;Installing node.js on OS X is super-easy and the documentation on the &lt;a href=&quot;http://nodejs.org/&quot;&gt;node.js&lt;/a&gt; site is great, but I figured I would write a step-by-step for OS X since I had just installed it for the first time. The node.js install includes Google's V8 JS engine so no need to worry about installing that.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Download and Install Node.JS&lt;/h2&gt;


&lt;p&gt;Get node.js from either github or download from the node.js site. If you need GIT for OS X you can grab the code from google &lt;a href=&quot;http://code.google.com/p/git-osx-installer/&quot;&gt;http://code.google.com/p/git-osx-installer/&lt;/a&gt; and follow &lt;a href=&quot;http://help.github.com/mac-git-installation/&quot;&gt;GitHub's install instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/ry/node&quot;&gt;http://github.com/ry/node&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://nodejs.org/#download&quot;&gt;http://nodejs.org/#download&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Build &amp; Install&lt;/h2&gt;


&lt;p&gt;Build node.js by following the instructions in the readme or just run:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;div class='line'&gt;./configure
&lt;/div&gt;&lt;div class='line'&gt; make 
&lt;/div&gt;&lt;div class='line'&gt; make install&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;At this stage you may get an error about a missing compiler (I did). This can be caused by outdated developer tools or completely missing developer tools. In my case I did not run the Xcode install from my Snow Leopard Disc when I upgraded. So if you get this error grab your Snow Leopard DVD, put the kettle on, and run the Xcode installer.&lt;/p&gt;

&lt;p&gt;You may also get a permissions error running make install, in this case just &lt;strong&gt;sudo make install&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;Test Server With Hello World&lt;/h2&gt;


&lt;p&gt;Copy the test server code from below (taken directly from&lt;a href=&quot; http://nodejs.org&quot;&gt; http://nodejs.org&lt;/a&gt;):&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;server.js &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='js'&gt;&lt;div class='line'&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sys&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;sys&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;text/plain&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;            &lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Hello World\n&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;nx&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;puts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Server running at http://127.0.0.1:8000/&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;Run it with:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;div class='line'&gt;node example.js&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;And go the the following url in a browser:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;div class='line'&gt;http://127.0.0.1:8000/&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;You should see the text &quot;hello world&quot;. If you do congrats, node.js is installed!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.devpatch.com/images-posts/2010/02/Screen-shot-2010-02-07-at-11.41.06-AM.png&quot; alt=&quot;&quot; title=&quot;Screen shot 2010-02-07 at 11.41.06 AM&quot; width=&quot;449&quot; height=&quot;129&quot; class=&quot;alignnone size-full wp-image-562&quot; /&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Managing CSS and JavaScript files within a Zend Framework App - A Different Approach: View Plugin</title>
    <link href="http://www.devpatch.com/2010/02/view-plugin"/>
    <updated>2010-02-05T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/02/view-plugin</id>
    <content type="html">&lt;p&gt;Reading this article on the Zend Framework Blog &lt;a href=&quot;http://devzone.zend.com/article/11760-Managing-CSS-and-JavaScript-files-within-a-Zend-Framework-App&quot;&gt;Managing CSS and JavaScript files within a Zend Framework App&lt;/a&gt;, speaking personally as a front-end developer I would use a different system.&lt;/p&gt;

&lt;p&gt;In my approach loading up different CSS/JS files per controller is the exception not the rule. We load additional CSS/JS when we need to do something very special, for example a page with a flash file uploader.&lt;/p&gt;

&lt;p&gt;I also think loading dependent files outside of the controller  can make it difficult for other developers to work on your code.  You can't just look at the controller to see what other CSS/JS dependencies are being used, you need to check the file system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My approach is a View Plugin that manages a standard set of CSS/JS for every layout. Additional CSS/JS if needed are added in the controllers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Onto the code!&lt;/p&gt;

&lt;!--more--&gt;


&lt;h2&gt;View Plugin Example&lt;/h2&gt;


&lt;p&gt;Here is my example view plugin from a recent project:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;View.php &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;span class='line'&gt;16&lt;/span&gt;
&lt;span class='line'&gt;17&lt;/span&gt;
&lt;span class='line'&gt;18&lt;/span&gt;
&lt;span class='line'&gt;19&lt;/span&gt;
&lt;span class='line'&gt;20&lt;/span&gt;
&lt;span class='line'&gt;21&lt;/span&gt;
&lt;span class='line'&gt;22&lt;/span&gt;
&lt;span class='line'&gt;23&lt;/span&gt;
&lt;span class='line'&gt;24&lt;/span&gt;
&lt;span class='line'&gt;25&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='php'&gt;&lt;div class='line'&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Plugin_View&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Zend_Controller_Plugin_Abstract&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;routeStartup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Zend_View&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;doctype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;XHTML1_STRICT&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;headTitle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setSeparator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39; - &amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;FooBar.com&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;headMeta&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;appendHttpEquiv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;text/html; charset=utf-8&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;headLink&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;appendStylesheet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/css/style.css&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addHelperPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;ZendX/JQuery/View/Helper/&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ZendX_JQuery_View_Helper&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;enable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;uiEnable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setLocalPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/js/jquery/jquery-1.3.2.min.js&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setUiLocalPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/js/jquery/jquery-ui-1.7.2.custom.min.js&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addStylesheet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/css/smoothness/jquery-ui-1.7.2.custom.css&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addJavascriptFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/js/interface-utils.js&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$viewRenderer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Zend_Controller_Action_Helper_ViewRenderer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$viewRenderer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$view&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nx&quot;&gt;Zend_Controller_Action_HelperBroker&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addHelper&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$viewRenderer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;The code in an example layout file:&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;div class='line'&gt;&amp;lt;?= $this-&gt;doctype() ?&gt;
&lt;/div&gt;&lt;div class='line'&gt;&amp;lt;html lang=&quot;en&quot; xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;/div&gt;&lt;div class='line'&gt;&amp;lt;head&gt;  
&lt;/div&gt;&lt;div class='line'&gt;  &amp;lt;?= $this-&gt;headMeta() ?&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &amp;lt;?= $this-&gt;headLink() ?&gt;
&lt;/div&gt;&lt;div class='line'&gt;  &amp;lt;?= $this-&gt;jQuery() ?&gt;        
&lt;/div&gt;&lt;div class='line'&gt;  &amp;lt;?= $this-&gt;headScript() ?&gt; 
&lt;/div&gt;&lt;div class='line'&gt;  &amp;lt;?= $this-&gt;headTitle()?&gt; 
&lt;/div&gt;&lt;div class='line'&gt;&amp;lt;/head&gt; 
&lt;/div&gt;&lt;div class='line'&gt;&amp;lt;body&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;As you can see from the above code, the Plugin handles everything needed for the HEAD area of the page, and it is all in one place.&lt;/p&gt;

&lt;h2&gt;Adding Additional CSS/JS From A Controller&lt;/h2&gt;


&lt;p&gt;If you need to add additional CSS/JS files, you can now do this in the controller - when needed. In the following example I need to add the dependencies for &quot;Uploadify&quot; a flash based multifile uploader.&lt;/p&gt;

&lt;div&gt;&lt;figure role=code&gt;&lt;figcaption&gt;&lt;span&gt;UploadController.php &lt;/span&gt;&lt;/figcaption&gt;
 &lt;div class=&quot;highlight&quot;&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class='line'&gt;1&lt;/span&gt;
&lt;span class='line'&gt;2&lt;/span&gt;
&lt;span class='line'&gt;3&lt;/span&gt;
&lt;span class='line'&gt;4&lt;/span&gt;
&lt;span class='line'&gt;5&lt;/span&gt;
&lt;span class='line'&gt;6&lt;/span&gt;
&lt;span class='line'&gt;7&lt;/span&gt;
&lt;span class='line'&gt;8&lt;/span&gt;
&lt;span class='line'&gt;9&lt;/span&gt;
&lt;span class='line'&gt;10&lt;/span&gt;
&lt;span class='line'&gt;11&lt;/span&gt;
&lt;span class='line'&gt;12&lt;/span&gt;
&lt;span class='line'&gt;13&lt;/span&gt;
&lt;span class='line'&gt;14&lt;/span&gt;
&lt;span class='line'&gt;15&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code' width='100%'&gt;&lt;pre&gt;&lt;code class='php'&gt;&lt;div class='line'&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UploadController&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Zend_Controller_Action&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;init&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;indexAction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;headLink&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;appendStylesheet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/uploadify/uploadify.css&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;headScript&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;appendFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/uploadify/swfobject.js&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;headScript&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;appendFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/uploadify/jquery.uploadify.v2.1.0.min.js&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/div&gt;&lt;div class='line'&gt;
&lt;/div&gt;&lt;div class='line'&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pre&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;


&lt;p&gt;The above inserts the dependencies into the layout for this controller action only. Sweet!!&lt;/p&gt;

&lt;p&gt;From my perspective this approach works better and I think from a code organization structure it is cleaner. Any special CSS/JS can be added on a per-controller or  per-controller-action basis and it will be very clear to other developers what is being loaded and where.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Painless EOT Font Generation With FontSquirrel</title>
    <link href="http://www.devpatch.com/2010/02/painless-eot-font-generation-with-fontsquirrel"/>
    <updated>2010-02-03T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/02/painless-eot-font-generation-with-fontsquirrel</id>
    <content type="html">&lt;p&gt;So you want to use @font-face to add some fancy fonts to your site. Well there is that pesky problem of IE needing a specific font type. Until recently you had to use Microsoft's WEFT tool to generate the right files. Personally I'd rather stick needles into my eyeballs than use this awful program, luckily some online tools have sprung up to ease the pain.&lt;/p&gt;

&lt;!--more--&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fontsquirrel.com&quot;&gt;Font Squirrel&lt;/a&gt; has a great online conversion tool that handles generating the fonts/CSS and everything for you. All you need is the TrueType or OpenType version of the font.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.fontsquirrel.com/fontface/generator&quot;&gt;http://www.fontsquirrel.com/fontface/generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will even base64 encode the font, allowing you embed the entire font into your CSS (rather than having a file) to avoid the &quot;text flashing/switching&quot; that can occur.&lt;/p&gt;

&lt;p&gt;Be aware that you will need to encode all variants of the font you want to use, including bold/italic so keep an eye on your file size.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>DevPatch.com Launched</title>
    <link href="http://www.devpatch.com/2010/02/devpatch-launch"/>
    <updated>2010-02-01T00:00:00-08:00</updated>
    <id>http://www.devpatch.com/2010/02/devpatch-launch</id>
    <content type="html">&lt;p&gt;Announcing the launch of DevPatch.com!&lt;/p&gt;

&lt;p&gt;I will be using the blog section to share technical tips &amp;amp; tricks focusing on:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;XHTML &amp; HTML 5&lt;/li&gt;
    &lt;li&gt;jQuery&lt;/li&gt;
    &lt;li&gt;Server Side JavaScript&lt;/li&gt;
    &lt;li&gt;Zend Framework&lt;/li&gt;
    &lt;li&gt;Technical Project Management&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Special thanks to Lesley Marker @ &lt;a href=&quot;http://www.markerdesign.com&quot;&gt;Marker Design&lt;/a&gt; for developing the DevPatch logo/branding.&lt;/p&gt;
</content>
  </entry>
  
</feed>

