<?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>Ed Spencer &#187; bundle</title>
	<atom:link href="http://edspencer.net/tag/bundle/feed" rel="self" type="application/rss+xml" />
	<link>http://edspencer.net</link>
	<description>A Sencha Architect</description>
	<lastBuildDate>Sat, 11 Feb 2012 09:20:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ExtJS Textmate bundle</title>
		<link>http://edspencer.net/2009/01/extjs-textmate-bundle.html</link>
		<comments>http://edspencer.net/2009/01/extjs-textmate-bundle.html#comments</comments>
		<pubDate>Sat, 10 Jan 2009 14:58:00 +0000</pubDate>
		<dc:creator>Ed Spencer</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[e]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://192.168.2.15/Projects/wordpress/?p=20</guid>
		<description><![CDATA[<p><b>** Update 2:</b> I&#8217;ve recently cleaned up the bundle, removing stale snippets. It&#8217;s now located at https://github.com/edspencer/Sencha.tmbundle</p>
<p><b>** Update:</b> Added extra instructions when downloading the bundle instead of git cloning it.  Thanks to <a href="http://www.linkedin.com/in/topkatz">TopKatz</a> for his help<b>**</b></p>
<p>I develop on both OSX and Windows machines, and my editors of choice are <a href="http://macromates.com/">Textmate</a> and the excellent Windows clone <a href="http://e-texteditor.com">E</a>.  One of the great things about Textmate is its bundle support, which allows you to create reusable code snippets (among other things).</p>
<p>I&#8217;ve got a good collection of these built up so thought I&#8217;d make them available on <a href="http://github.com/edspencer/Sencha.tmbundle/tree/master">Github</a>.  You can install it like this:</p>
<pre class="brush: plain;">
Mac OSX:

cd ~/Library/Application Support/TextMate/Bundles
git clone git://github.com/edspencer/Sencha.tmbundle.git

Windows:

cd C:\Documents and Settings\{YOUR USERNAME}\Application Data\e\Bundles
git clone git://github.com/edspencer/Sencha.tmbundle.git
</pre>
<p>If you don&#8217;t have git installed you can simply <a href="http://github.com/edspencer/Sencha.tmbundle/zipball/master">download the bundle as a zip file</a>, and extract it into the directory as above.  You need to rename the extracted directory to something like extjs.tmbundle or it won&#8217;t show up.  If you do go the git route you can of course cd into that git directory at any point and use git pull to update to the latest bundle version.</p>
<p>I&#8217;ll give one example of the usefulness of snippets like these; here&#8217;s the Ext.extend snippet from the bundle:</p>
<pre class="brush: jscript;">
/**
 * @class ${1:ClassName}
 * @extends ${2:extendsClass}
 * ${5:Description}
 */
${1:ClassName} = function(config) {
  var config = config || {};

  Ext.applyIf(config, {
    $0
  });

  ${1:ClassName}.superclass.constructor.call(this, config);
};
Ext.extend(${1:ClassName}, ${2:extendsClass});

${3:Ext.reg('${4:xtype}', ${1:ClassName});}
</pre>
<p>To use this you can just type &#8216;extend&#8217; into a JS file in TextMate/E and press tab.  The snippet takes you through a few editable areas such as the name of your new class, the name of the class you&#8217;re extending, xtype definition and description, then dumps the cursor inside the Ext.applyIf block.  The actual characters typed are these:</p>
<pre class="brush: plain;">extend [tab] MyWindow [tab] Ext.Window [tab] [tab] mywindow [tab] Special window class [tab]</pre>
<p>Which produces this:</p>
<pre class="brush: jscript;">
/**
 * @class MyWindow
 * @extends Ext.Window
 * Special window class
 */
MyWindow = function(config) {
  var config = config || {};

  Ext.applyIf(config, {

  });

  MyWindow.superclass.constructor.call(this, config);
};
Ext.extend(MyWindow, Ext.Window);

Ext.reg('mywindow', MyWindow);
</pre>
<p>Hopefully it&#8217;s obvious how much time things like this can save when generating repetitive, boilerplate code.  The extend snippet is one of the larger ones but even the small ones are very useful (pressing c then tab is much nicer than typing console.log(&#8221;); each time).</p>
<p>Any suggestions/contributions are welcome.  Thanks go to <a href="http://github.com/rdougan">rdougan</a> for his contributions and organisation also.</p>
<p>There is also another ExtJS textmate bundle available at <a href="http://hakore.com/extjs.tmbundle/">http://hakore.com/extjs.tmbundle/</a>, written by <a href="http://extjs.com/forum/member.php?u=36775">krzak</a> from the Ext forums.</p>
]]></description>
			<content:encoded><![CDATA[<p><b>** Update 2:</b> I&#8217;ve recently cleaned up the bundle, removing stale snippets. It&#8217;s now located at https://github.com/edspencer/Sencha.tmbundle</p>
<p><b>** Update:</b> Added extra instructions when downloading the bundle instead of git cloning it.  Thanks to <a href="http://www.linkedin.com/in/topkatz">TopKatz</a> for his help<b>**</b></p>
<p>I develop on both OSX and Windows machines, and my editors of choice are <a href="http://macromates.com/">Textmate</a> and the excellent Windows clone <a href="http://e-texteditor.com">E</a>.  One of the great things about Textmate is its bundle support, which allows you to create reusable code snippets (among other things).</p>
<p>I&#8217;ve got a good collection of these built up so thought I&#8217;d make them available on <a href="http://github.com/edspencer/Sencha.tmbundle/tree/master">Github</a>.  You can install it like this:</p>
<pre class="brush: plain;">
Mac OSX:

cd ~/Library/Application Support/TextMate/Bundles
git clone git://github.com/edspencer/Sencha.tmbundle.git

Windows:

cd C:\Documents and Settings\{YOUR USERNAME}\Application Data\e\Bundles
git clone git://github.com/edspencer/Sencha.tmbundle.git
</pre>
<p>If you don&#8217;t have git installed you can simply <a href="http://github.com/edspencer/Sencha.tmbundle/zipball/master">download the bundle as a zip file</a>, and extract it into the directory as above.  You need to rename the extracted directory to something like extjs.tmbundle or it won&#8217;t show up.  If you do go the git route you can of course cd into that git directory at any point and use git pull to update to the latest bundle version.</p>
<p>I&#8217;ll give one example of the usefulness of snippets like these; here&#8217;s the Ext.extend snippet from the bundle:</p>
<pre class="brush: jscript;">
/**
 * @class ${1:ClassName}
 * @extends ${2:extendsClass}
 * ${5:Description}
 */
${1:ClassName} = function(config) {
  var config = config || {};

  Ext.applyIf(config, {
    $0
  });

  ${1:ClassName}.superclass.constructor.call(this, config);
};
Ext.extend(${1:ClassName}, ${2:extendsClass});

${3:Ext.reg('${4:xtype}', ${1:ClassName});}
</pre>
<p>To use this you can just type &#8216;extend&#8217; into a JS file in TextMate/E and press tab.  The snippet takes you through a few editable areas such as the name of your new class, the name of the class you&#8217;re extending, xtype definition and description, then dumps the cursor inside the Ext.applyIf block.  The actual characters typed are these:</p>
<pre class="brush: plain;">extend [tab] MyWindow [tab] Ext.Window [tab] [tab] mywindow [tab] Special window class [tab]</pre>
<p>Which produces this:</p>
<pre class="brush: jscript;">
/**
 * @class MyWindow
 * @extends Ext.Window
 * Special window class
 */
MyWindow = function(config) {
  var config = config || {};

  Ext.applyIf(config, {

  });

  MyWindow.superclass.constructor.call(this, config);
};
Ext.extend(MyWindow, Ext.Window);

Ext.reg('mywindow', MyWindow);
</pre>
<p>Hopefully it&#8217;s obvious how much time things like this can save when generating repetitive, boilerplate code.  The extend snippet is one of the larger ones but even the small ones are very useful (pressing c then tab is much nicer than typing console.log(&#8221;); each time).</p>
<p>Any suggestions/contributions are welcome.  Thanks go to <a href="http://github.com/rdougan">rdougan</a> for his contributions and organisation also.</p>
<p>There is also another ExtJS textmate bundle available at <a href="http://hakore.com/extjs.tmbundle/">http://hakore.com/extjs.tmbundle/</a>, written by <a href="http://extjs.com/forum/member.php?u=36775">krzak</a> from the Ext forums.</p>
]]></content:encoded>
			<wfw:commentRss>http://edspencer.net/2009/01/extjs-textmate-bundle.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

