<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>American Butifarra &#187; Web Developement</title> <atom:link href="http://claude.betancourt.us/tag/web-developement/feed/" rel="self" type="application/rss+xml" /><link>http://claude.betancourt.us</link> <description>Claude Betancourt&#039;s Personal Blog</description> <lastBuildDate>Fri, 16 Dec 2011 02:43:25 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Compress JavaScript and CSS as Part of your Build Process</title><link>http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/</link> <comments>http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/#comments</comments> <pubDate>Mon, 05 Jul 2010 04:56:20 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[How-To]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Compression]]></category> <category><![CDATA[Concatenation]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Performance]]></category> <category><![CDATA[Web Developement]]></category><guid isPermaLink="false">http://claude.betancourt.us/?p=736</guid> <description><![CDATA[Web page performance is critical to keeping customers and visitors moving along on your site. Slow responses typically result in frustrated users, unhappy customers and worse, abandoned orders. It is important to reduce the number of requests generated by a web page in order to increase its actual and perceived performance. <a href="http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Web page performance is critical to keeping customers and visitors moving along on your site. Slow responses typically result in frustrated users, unhappy customers and worse, abandoned orders. It is important to reduce the number of requests generated by a web page in order to increase its actual and perceived performance.</p><p>One critical way is to reduce the number of external files loaded by a page. Another one is to reduce their size through compression. This post aims to take this concept a step further by automating this tedious process using open-source libraries.</p><p><span id="more-736"></span></p><h3>Example</h3><p>This example will accomplish the task by executing the following steps:</p><ol><li>Create a temporary directory, <code>/build</code></li><li>Compress each JS file into <code>{original}-min.js</code> files</li><li>Compress each CSS file into <code>{original}-min.css</code> files</li><li>Concatenate all compressed JS files into <code>/js/complete.js</code></li><li>Concatenate all compressed CSS files into <code>/css/complete.css</code></li></ol><h3>Requirements</h3><ul><li>Make sure <a href="http://ant.apache.org/" alt="Apache Ant" title="Apache Ant">Apache Ant</a> has been installed on your system.</li><li>Check out a copy of the <a href="http://svn.betancourt.us/public/yui-compression-sample/">sample project</a> from my public SVN repository. This project already contains the open-source libraries necessary, <a href="http://yhoo.it/3FXTgK">YUI compressor</a> and <a href="http://bit.ly/avcPrG">YUI compressor Ant task</a>.</li><li>Setup a system variable, <code>COMPRESSOR_HOME</code> that points to the location of the sample project&#8217;s <code>/lib</code> directory.<ul><li>On Windows, right click My Computer and select properties. Then click the &#8220;Environment Variables&#8221; button under the advanced tab. Add a new system variable, <code>COMPRESSOR_HOME</code>, and set its value to your local path, for example: <code>C:\Documents and Settings\username\Desktop\yui-compression-sample\lib</code></li><li>On Mac OSX and Linux, update <code>~/.profile</code> or similar file and add <code>export COMPRESSOR_HOME=~/YourProjectDir/yui-compression-sample/lib</code></li></ul></li></ul><h3>Examine the configuration</h3><p>Take a look at the contents of <code>build.xml</code>. The first portion defines variables and locations of the libraries.</p><pre class="brush: xml; title: ; notranslate">
&lt;!-- tells Ant to refer to your environment vars --&gt;
&lt;property environment=&quot;env&quot; /&gt;

&lt;!-- defines location of libraries --&gt;
&lt;property name=&quot;lib.dir&quot; value=&quot;${env.COMPRESSOR_HOME}&quot; /&gt;

&lt;!-- defines output directory --&gt;
&lt;property name=&quot;build.dir&quot; value=&quot;build&quot; /&gt;

&lt;!-- output files, one for JS one for CSS --&gt;
&lt;property name=&quot;final_js&quot; value=&quot;${basedir}/js/complete.js&quot; /&gt;
&lt;property name=&quot;final_css&quot; value=&quot;${basedir}/css/complete.css&quot; /&gt;

&lt;!-- define nicknames for libraries --&gt;
&lt;property name=&quot;yui-compressor&quot; location=&quot;${lib.dir}/yuicompressor-2.4.2.jar&quot; /&gt;
&lt;property name=&quot;yui-compressor-ant-task&quot; location=&quot;${lib.dir}/yui-compressor-ant-task-0.5.jar&quot; /&gt;

&lt;!-- adds libraries to the classpath --&gt;
&lt;path id=&quot;yui.classpath&quot;&gt;
	&lt;pathelement location=&quot;${yui-compressor}&quot; /&gt;
	&lt;pathelement location=&quot;${yui-compressor-ant-task}&quot; /&gt;
&lt;/path&gt;

&lt;!-- define tasks --&gt;
&lt;taskdef name=&quot;yui-compressor&quot; classname=&quot;net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask&quot;&gt;
	&lt;classpath refid=&quot;yui.classpath&quot; /&gt;
&lt;/taskdef&gt;
</pre><p>The second portion of <code>build.xml</code> defines the Ant targets to be executed. These tell YUI compressor how the source files are to be processed.</p><pre class="brush: xml; title: ; notranslate">
&lt;!-- targets --&gt;
&lt;target name=&quot;concat&quot;&gt;

	&lt;!-- concatenates all compressed JS files into one --&gt;
	&lt;concat destfile=&quot;${final_js}&quot; force=&quot;true&quot; fixlastline=&quot;true&quot;&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/*.js&quot; /&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/widgets/*.js&quot; /&gt;
	&lt;/concat&gt;

	&lt;!-- concatenates all compressed CSS files into one --&gt;
	&lt;concat destfile=&quot;${final_css}&quot; force=&quot;true&quot; fixlastline=&quot;true&quot;&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/*.css&quot; /&gt;
		&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;**/flexgrid/*.css&quot; /&gt;
	&lt;/concat&gt;

&lt;/target&gt;

&lt;target name=&quot;compress&quot;&gt;

	&lt;!-- compresses each JavaScript and CSS file --&gt;
	&lt;!-- and saved as {original_name}-min.{extension} --&gt;
	&lt;yui-compressor
		warn=&quot;false&quot;
		munge=&quot;true&quot;
		preserveallsemicolons=&quot;false&quot;
		fromdir=&quot;${basedir}&quot;
		todir=&quot;${build.dir}&quot;
	/&gt;

&lt;/target&gt;

&lt;!-- deletes the temporary directory and all its contents --&gt;
&lt;target name=&quot;clean&quot;&gt;
	&lt;delete dir=&quot;${build.dir}&quot;/&gt;
&lt;/target&gt;

&lt;!-- creates the temporary directory --&gt;
&lt;target name=&quot;start&quot;&gt;
	&lt;mkdir dir=&quot;${build.dir}&quot; /&gt;
&lt;/target&gt;

&lt;target name=&quot;main&quot; depends=&quot;start,compress,concat,clean&quot; /&gt;
</pre><h3>What does this do?</h3><p>If you are new to Ant you are probably wondering why the tasks are defined in reverse order of execution. This is just a personal preference and it does not affect execution.</p><p>The order of execution is controlled by the <code>main</code> task. This is the task Ant runs when a target is not passed to it. The attribute <code>depends</code> tells Ant the order in which the tasks must be executed.</p><h3>Give it a try</h3><p>All you have to do to execute the entire operation is open a command prompt (or a terminal window on OS X), change into the project directory where <code>build.xml</code> lives and type <code>ant</code> and hit <code>Enter</code>. You should see some output that looks like this:</p><pre class="brush: plain; highlight: [19,20,32]; light: true; title: ; notranslate">
claude$ ant
Buildfile: build.xml

start:
     [echo] Building JS-CSS-Compression-and-Concat-Sample with Apache Ant version 1.7.1 compiled on April 8 2010 - System Java 1.6
    [mkdir] Created dir: /Users/claude/Documents/www/yui-compression-sample/build

compress:
[yui-compressor] [53%] global-print.css [920] ---&gt; global-print-min.css [488]
[yui-compressor] [80%] global.css [11895] ---&gt; global-min.css [9564]
[yui-compressor] [79%] style.css [1148] ---&gt; style-min.css [910]
[yui-compressor] [64%] googlemaps-yelp-ext.js [6604] ---&gt; googlemaps-yelp-ext-min.js [4270]
[yui-compressor] [70%] split-filepath.js [814] ---&gt; split-filepath-min.js [576]
[yui-compressor] [73%] ContactForm.js [4711] ---&gt; ContactForm-min.js [3461]
[yui-compressor] [57%] InfoTabs.js [1160] ---&gt; InfoTabs-min.js [669]
[yui-compressor] [55%] InfoWindow.js [1228] ---&gt; InfoWindow-min.js [686]
[yui-compressor] [68%] Intraday.js [9559] ---&gt; Intraday-min.js [6536]
[yui-compressor] [68%] MediaCenter.js [5728] ---&gt; MediaCenter-min.js [3906]
[yui-compressor] [JavaScript] Compressed 7 files to 67% (29KB to 19KB, saving 10KB)
[yui-compressor] [CSS] Compressed 3 files to 78% (13KB to 10KB, saving 3KB)
[yui-compressor] Compressed 10 files to 70% (42KB to 30KB, saving 12KB)

concat:
     [echo] Building /Users/claude/Documents/www/yui-compression-sample/js/complete.js
     [echo] Building /Users/claude/Documents/www/yui-compression-sample/css/complete.css

clean:
   [delete] Deleting directory /Users/claude/Documents/www/yui-compression-sample/build

main:

BUILD SUCCESSFUL
Total time: 1 second
</pre><h3>What Now?</h3><p>Change your HTML code to point to the newly created <code>complete.js</code> and <code>complete.css</code> instead of the individual files. Your page will load and render faster.</p><p>Squeeze even more performance out of your site by implementing other best practices. Get a copy of <a href="http://amzn.to/cueRAt">High Performance Web Sites</a> by Steve Souders and read <a href="http://yhoo.it/bjbsh4">Yahoo&#8217;s rules for exceptional performance</a>.</p><p class="note">Watch <a href="http://www.youtube.com/watch?v=BTHvs3V8DBA#t=90s">Steve Souders&#8217; presentation at Google Tech Talks</a>. Audio problems are fixed 5 minutes in. Skip the first 90 seconds to listen to Steve.</p> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/compress-javascript-and-css-as-part-of-your-build-process/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>New Book: Learning Ext-JS</title><link>http://claude.betancourt.us/new-book-learning-ext-js/</link> <comments>http://claude.betancourt.us/new-book-learning-ext-js/#comments</comments> <pubDate>Tue, 09 Dec 2008 22:29:19 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[Book]]></category> <category><![CDATA[Ext JS]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Amazon]]></category> <category><![CDATA[Web Developement]]></category><guid isPermaLink="false">http://claude.betancourt.us/?p=284</guid> <description><![CDATA[Steve “Cutters” Blades’ book on Ext-JS is out. By using a series of straightforward examples backed by screenshots, Learning Ext JS will help you create web applications that look good and perform beyond the expectations of your users. <a href="http://claude.betancourt.us/new-book-learning-ext-js/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><span class="drop_cap">S</span>teve &#8220;Cutters&#8221; Blades&#8217; book on <a href="http://www.amazon.com/gp/product/1847195148?ie=UTF8&#038;tag=codesnippets-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1847195148" title="Learning Ext-JS">Ext-JS is out</a>.<a href="http://www.amazon.com/gp/product/1847195148?ie=UTF8&#038;tag=codesnippets-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1847195148" title="Learning Ext-JS"><img class="alignright frame" border="0" src="/images/blog/assets/book-learning-extjs.jpg?2ce803"/></a><img src="http://www.assoc-amazon.com/e/ir?t=codesnippets-20&#038;l=as2&#038;o=1&#038;a=1847195148" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br /><blockquote>By using a series of straightforward examples backed by screenshots, Learning Ext JS will help you create web applications that look good and perform beyond the expectations of your users. This book is written for Web Application Developers who are familiar with HTML but may have little to no experience with JavaScript application development. If you are starting to build a new web application, or are re-vamping an existing web application, then this book is for you.</p></blockquote><p><a href="http://www.amazon.com/gp/product/1847195148?ie=UTF8&#038;tag=codesnippets-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1847195148" title="Learning Ext-JS"><strong>Get your copy today.</strong></a></p> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/new-book-learning-ext-js/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>What Kind of Web Developer Are You?</title><link>http://claude.betancourt.us/what-kind-of-web-developer-are-you/</link> <comments>http://claude.betancourt.us/what-kind-of-web-developer-are-you/#comments</comments> <pubDate>Mon, 11 Aug 2008 15:46:40 +0000</pubDate> <dc:creator>Claude</dc:creator> <category><![CDATA[Articles]]></category> <category><![CDATA[Client Programming]]></category> <category><![CDATA[Information Architecture]]></category> <category><![CDATA[Scripting]]></category> <category><![CDATA[Server Programming]]></category> <category><![CDATA[Web Design]]></category> <category><![CDATA[Web Developement]]></category><guid isPermaLink="false">http://claude.betancourt.us/blog/?p=147</guid> <description><![CDATA[In this insightful post, Brian Reindel discusses the different disciplines typically associated with "web development." <a href="http://claude.betancourt.us/what-kind-of-web-developer-are-you/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><span class="drop_cap">I</span>n this <a href="http://blog.reindel.com/2008/08/10/what-you-need-to-know-if-you-want-a-job-in-web-development/">insightful post</a>, Brian Reindel discusses the different disciplines typically associated with &#8220;web development.&#8221;</p><blockquote><p>The true nature of Web development is a complicated metric to gauge without being in the field for many years, and without reading about and listening to thousands who are in the field with you. It can be a frustrating experience for any one person graduating college and starting their career, or wanting to transition into a separate discipline. I decided to try and change that with some personal reflection.</p><p><b>Information Architecture</b></p><p>Information architects had previously performed the role of business analyst or programmer, but the field has centered fundamentally now around library and information sciences practices. Several veterans began their career focusing on an entirely separate discipline, but graduates entering the field will usually have a strong focus on behavioural sciences like psychology, sociology, or a degree in human-computer interaction. The role is often given to those demonstrating a high capacity for organizing information in a fashion that benefits profiled groups of users.</p><p><b>Web Design</b></p><p>There is a misnomer in the field that Web designers must be practitioners of client-side programming, standards and accessibility. However, this continues to be the result of an outspoken minority who claim to speak for a vast majority. The reality is that many very successful Web designers understand the medium and the constraints without ever touching code. It is simply that more individuals have chosen to branch out, and there is no indication of competence as a Web designer with respect to client-side development skills.</p><p><b>Client-side Programming</b></p><p>Client-side programming (or scripting) has become a mixed-bag of sorts, and can be masked behind several titles like Front-end Developer, Web Developer and even Web Designer. In the early days of the profession, a basic knowledge of HTML could land you a well-paid position. This is no longer the case, and the best client-side programmers are experts with XHTML, CSS, JavaScript, ActionScript, XML, standards, accessibility, have a very firm grasp of design theory, and often have some basic experience with a server-side language like PHP, Ruby, Java, or C#.</p><p><b>Server-side Programming</b></p><p>There are several titles for this discipline, which include Programmer, Software Engineer and Web Developer to name a few. The field has seen numerous changes over the last five years, and it covers a broad spectrum of languages, platforms, technologies and frameworks. More than any other discipline, this one has the greatest number of passionate voices, who often grasp onto a concept and never seem to let go. It is highly competitive, stressful, and regularly requires “work” outside of work.</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://claude.betancourt.us/what-kind-of-web-developer-are-you/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: claude.betancourt.us @ 2012-02-07 15:26:54 by W3 Total Cache -->
