<?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>Redmonster &#187; JavaScript</title>
	<atom:link href="http://www.goredmonster.com/topics/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.goredmonster.com</link>
	<description>Agile Web Development</description>
	<lastBuildDate>Thu, 09 Jun 2011 21:09:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Creating JavaScript Functions Faster in TextMate</title>
		<link>http://www.goredmonster.com/javascript/creating-javascript-functions-faster-in-textmate/</link>
		<comments>http://www.goredmonster.com/javascript/creating-javascript-functions-faster-in-textmate/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 21:21:37 +0000</pubDate>
		<dc:creator>Paul Redmond</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.goredmonster.com/?p=448</guid>
		<description><![CDATA[TextMate&#8217;s JavaScript bundle has been getting some love from me this week. I am not presenting anything new here, but I often find gems hidden within the Bundles in TextMate that speed up my development. f + tab This creates an anonymous function, which is great when using jQuery or many other JS libraries out [...]]]></description>
			<content:encoded><![CDATA[<p>TextMate&#8217;s JavaScript bundle has been getting some love from me this week. I am not presenting anything new here, but I often find gems hidden within the Bundles in TextMate that speed up my development.</p>
<h3>f + tab</h3>
<p>This creates an anonymous function, which is great when using jQuery or many other JS libraries out there. I tweaked mine to remove the semi-colon at the end.</p>
<h3>functionname+shift+return</h3>
<p>If you type out the name of your function, then immediately hit Shift + Return, TextMate will convert it into a function.</p>
<h3>fun+tab</h3>
<p>Construct a function with tab stops.</p>

<!-- Start TwitterButton -->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><div class="twitter-button"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.goredmonster.com/javascript/creating-javascript-functions-faster-in-textmate/" data-via="goredmonster" data-text="Creating JavaScript Functions Faster in TextMate">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.goredmonster.com/javascript/creating-javascript-functions-faster-in-textmate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shrink your JavaScript/CSS in WordPress with PHP</title>
		<link>http://www.goredmonster.com/php/shrink-your-javascriptcss-in-wordpress-with-php/</link>
		<comments>http://www.goredmonster.com/php/shrink-your-javascriptcss-in-wordpress-with-php/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 08:33:53 +0000</pubDate>
		<dc:creator>Paul Redmond</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.goredmonster.com/wp/?p=30</guid>
		<description><![CDATA[I came across a very simple, yet elegant solution for shrinking JavaScript and CSS files with PHP. When large JavaScript frameworks are the order of the day, why not optimize? In this post I'll show you how to easily apply this script to your Wordpress theme; shrinking your CSS/JavaScript assets by around 300%! ]]></description>
			<content:encoded><![CDATA[<p>I came across a <a href="http://rakaz.nl/2006/12/make-your-pages-load-faster-by-combining-and-compressing-javascript-and-css-files.html">very simple, yet elegant solution</a> for shrinking JavaScript and CSS files with PHP. When large JavaScript frameworks are the order of the day, why not optimize? In this post I&#8217;ll show you how to easily apply this script to your <a href="http://wordpress.org">WordPress</a> theme; shrinking your CSS/JavaScript assets by around 300%! I intend on making a WordPress plugin that automates this process, but for now, this post will show you how to configure your own theme.</p>
<p>This site compresses MooTools to about 20kb (the original file with YUI Compression weighing in at 65kb). Check it out!</p>
<p><img class="alignnone size-full wp-image-71" title="JS File Compressed" src="http://www.goredmonster.com/wp/wp-content/uploads/2009/10/Picture-1.png" alt="JS File Compressed" width="552" height="135" /></p>
<h2>The Setup</h2>
<p>This will literally take minutes to integrate.</p>
<ol>
<li>Download the <a href="http://rakaz.nl/2006/12/make-your-pages-load-faster-by-combining-and-compressing-javascript-and-css-files.html">PHP script</a>.</li>
<li>Upload the file to your active WordPress Theme folder.</li>
<li>Create a folder called &#8220;cache&#8221; &#8211; <strong>Make sure this folder has proper permissions</strong></li>
<li>Create an .htaccess file in your theme folder.</li>
<li>Create a folder called &#8220;css&#8221;</li>
<li>Create a folder called &#8220;javascript&#8221;</li>
</ol>
<h2>Making it Work</h2>
<p>Insert the following code into your .htaccess file in your active theme. Make sure to replace RewriteBase with the absolute path to your theme folder where your combine.php script resides. Note that I made RewriteRule to be a relative path to combine.php:</p>
<pre>RewriteEngine On
RewriteBase /wp/wp-content/themes/yourtheme/
RewriteRule ^css/(.*\.css) combine.php?type=css&amp;files=$1
RewriteRule ^javascript/(.*\.js) combine.php?type=javascript&amp;files=$1</pre>
<p>You&#8217;re ready to link your Javascript and CSS files. As described on the authors site, you link your stylesheets and scripts by chaining with commas. Here is how it will look in your WordPress theme file:</p>
<pre>&lt;link rel="stylesheet" href="&lt;?php bloginfo('template_url'); ?&gt;/css/styles.css,
another.css,athird.css" type="text/css" media="screen" /&gt;

&lt;script src="&lt;?php bloginfo('template_url'); ?&gt;/javascript/jquery.js,
another.js,etc.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
<h2>Notes</h2>
<p>You need to consider script dependencies, and chain your scripts accordingly. Also, make sure your stylesheets are added in the correct order or you may notice some rules being overridden. Depending on your server configuration you might have to chmod your cache folder to 777. Confirm that your cache folder contains your cached files with a &#8216;.gzip&#8217; extension.</p>
<p>All CSS files are moved to the CSS folder in the theme. This goes against the WordPress convention of style.css in the theme&#8217;s main folder. I still have theme comment data for WordPress in my original <a href="http://www.goredmonster.com/wp/wp-content/themes/redmonster/style.css">style.css</a> file, but I don&#8217;t use it on my site.</p>
<p>Major hat-tip to <a href="http://rakaz.nl/">Niels Leenheer</a> for creating such a great script and simple solution.</p>

<!-- Start TwitterButton -->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><div class="twitter-button"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.goredmonster.com/php/shrink-your-javascriptcss-in-wordpress-with-php/" data-via="goredmonster" data-text="Shrink your JavaScript/CSS in WordPress with PHP">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.goredmonster.com/php/shrink-your-javascriptcss-in-wordpress-with-php/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

