<?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>Monkey&#039;s thumb</title>
	<atom:link href="http://blog.monkeysthumb.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.monkeysthumb.org</link>
	<description></description>
	<lastBuildDate>Mon, 21 Dec 2009 19:17:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Delete/put links break your Rails app</title>
		<link>http://blog.monkeysthumb.org/2009/12/12/deleteput-links-break-your-rails-app/</link>
		<comments>http://blog.monkeysthumb.org/2009/12/12/deleteput-links-break-your-rails-app/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 07:06:21 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2009/12/12/deleteput-links-break-your-rails-app/</guid>
		<description><![CDATA[In Rails you can easily use the link&#95;to helper in your templates to create links to update or destroy actions (using the ), but this ease of use hides a very real problem.



The problem

These links only work for users with javascript enabled.

Visitors without javascript enabled the links will actually take them to the show action [...]]]></description>
			<content:encoded><![CDATA[<p>In Rails you can easily use the link&#95;to helper in your templates to create links to update or destroy actions (using the ), but this ease of use hides a very real problem.</p>

<p><span id="more-132"></span></p>

<h2>The problem</h2>

<p>These links only work for users with javascript enabled.</p>

<p>Visitors without javascript enabled the links will actually take them to the show action of your controller (or a 404 if you con&#8217;t have a show action), which won&#8217;t be what you or they expect.</p>

<p>It&#8217;s easy not to notice this behaviour since mostly you test your app with javascript enabled.</p>

<p>For example:</p>

<pre><code class="ruby">link_to "Delete Image", @image, :method => :delete</code></pre>

<p>Generates</p>

<pre><code class="html">&lt;a href="/images/9" onclick="var f = document.createElement('form');
  f.style.display = 'none';
  this.parentNode.appendChild(f);
  f.method = 'POST';
  f.action = this.href;
  var m = document.createElement('input');
  m.setAttribute('type', 'hidden');
  m.setAttribute('name', '_method');
  m.setAttribute('value', 'delete');
  f.appendChild(m);f.submit();return false;">Delete Image&lt;/a></code></pre>

<p>Take note of all the javascript gymnastics to make this work.</p>

<h2>The solution</h2>

<p>The easy fix is to use the button&#95;to helper instead.</p>

<p>For example:</p>

<pre><code class="ruby">button_to "Delete Image", @image, :method => :delete</code></pre>

<p>Generates</p>

<pre><code class="html">&lt;form method="post" action="/images/9" class="button-to">
  &lt;input name="_method" type="hidden" value="put" />
  &lt;input type="submit" value="Delete Image" />
&lt;/form></code></pre>

<p>A nice little submit button with no javascript and no pain.</p>

<p>This may even be a better user experience for all your users (with or without javascript) because the button will indicate to them that they are making a change (either updating or deleting something) rather than just visiting a link.</p>

<h2>The solution (part II)</h2>

<p>Of course perhaps you used the link_to helper because you wanted it to look like a standard link on the page (rather than a submit button).</p>

<p>One possible solution would be to use CSS but it&#8217;s actually very difficult to use CSS to make a submit button look exactly like (rather than just similar to) your other links across a range of browsers.</p>

<p>Another is to use javascript to replace the form generated by the button&#95;to helper with a link. Then javascript enabled visitors will see a link just like if you had used the link&#95;to helper, and visitors without javascript enabled will see a button.</p>

<p>If you are using jQuery then this can be achieved by adding the following javascript to your site.</p>

<pre><code class="javascript">jQuery.fn.convert_submit_button_to_link = function () {
  this.each( function () {
    var button = jQuery(this);
    button.
      hide().
      after(jQuery('<a href="#">' + button.attr('value') + '</a>').attr('class', button.attr('class')).click(button.attr('onclick')));
  });
  return this;
};

$(document).ready(function () {
  // Convert any input with the class 'submit-link' to a link
  $('input.submit-link').convert_submit_button_to_link();
};</code></pre>

<p>And then any submit button with the class &#8217;submit-link&#8217; will be replaced by a link that will submit the form.</p>

<p>For example the submit button generated by the following would be converted to a link</p>

<pre><code class="ruby">button_to "Delete Image", @image, :method => :delete, :class => 'submit-link'</code></pre>

<p>So there are no excuses for using link&#95;to for destroy/update actions.</p>

<p>I will leave it as an exercise for the reader to convert this jQuery specific javascript to your favourite javascript library.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2009/12/12/deleteput-links-break-your-rails-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Trigger Integrity builds with a cron job</title>
		<link>http://blog.monkeysthumb.org/2009/11/27/trigger-integrity-builds-of-your-projects-with-cron/</link>
		<comments>http://blog.monkeysthumb.org/2009/11/27/trigger-integrity-builds-of-your-projects-with-cron/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 13:31:42 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2009/11/27/trigger-integrity-builds-of-your-projects-with-cron/</guid>
		<description><![CDATA[Updated 21 Dec 2009: modified code to work with integrity v. 0.2.9

Integrity is a great little continuous integration server, even if it is a little rough around the edges.

Out of the box Integrity expects that you will trigger all your builds using github&#8217;s post receive hooks &#8211; although you need to be aware of this [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Updated 21 Dec 2009:</strong> modified code to work with integrity v. 0.2.9</em></p>

<p><a href="http://integrityapp.com/">Integrity</a> is a great little continuous integration server, even if it is a little rough around the edges.</p>

<p>Out of the box Integrity expects that you will trigger all your builds using <a href="http://help.github.com/post-receive-hooks/">github&#8217;s post receive hooks</a> &#8211; although you need to be aware of <a href="http://github.com/integrity/integrity/issues#issue/14">this bug</a> which means you have to miss the .git of the end of the project&#8217;s git repository URI when setting this up.</p>

<p>I however prefer to poll my project&#8217;s repositories for changes so that they do not need to be aware of my Integrity server.</p>

<p><span id="more-129"></span>
If you are using Integrity v0.2.9 or greater then this can be achieved by adding the following rake task to the Rakefile in your Integrity installation.</p>

<pre><code class="ruby">desc "Will build the latest commit for any project that has already been built and the latest commit has not already been built"
task :build_new_commits do
  require "init"
  Integrity.log("Checking for new commits at #{Time.now}")
  Integrity::Project.all.each do |project|
    # Don't build if project is just being set up, or a build of 'HEAD' is already outstanding or the latest commit has already
    # been built.
    unless project.blank? ||
        project.last_build.commit.identifier == 'HEAD' ||
        (head = Integrity::Repository.new(project.uri, project.branch, 'HEAD').head) == project.last_build.commit.identifier
      project.build(head)
    end
  end
end</code></pre>

<p>Then set up a cron job by adding the something like the following entry to your crontab. This will to automatically check every 2 minutes to see if there are any outstanding commits of your project to build. You will need to replace the /path/to/ section in each of the paths with appropriate values for your system.</p>

<pre><code class="bash">*/2 * * * * cd /path/to/integrity &#038;&#038; /path/to/ruby ./bin/rake build_new_commits >> /path/to/cron.log 2>$</code></pre>

<p>Alternatively, if you are using for earlier versions of integrity</p>

<ul>
<li>0.2.0 or greater: use this <a href="http://gist.github.com/261005">rake task</a></li>
<li>0.1.1 or greater: use <a href="http://github.com/bkoski/integrity-watcher">bkoski&#8217;s integrity-watcher</a></li>
</ul>

<p>Or, if you want to add build triggers to git repositories not on github then take a look at <a href="http://morethanseven.net/2008/12/28/local-continuous-integration-integrity/">morethanseven&#8217;s post commit hook</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2009/11/27/trigger-integrity-builds-of-your-projects-with-cron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cucumber screenshot gem</title>
		<link>http://blog.monkeysthumb.org/2009/11/04/cucumber-screenshot-gem/</link>
		<comments>http://blog.monkeysthumb.org/2009/11/04/cucumber-screenshot-gem/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 06:52:25 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2009/11/04/cucumber-screenshot-gem/</guid>
		<description><![CDATA[Cucumber is great for integration testing but when a feature fails for a web application you just get the content of the page spewed out onto the console.

If only you could see a screenshot of the whole web page that produced the failure.


The good news for those of you on OS X is that you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cukes.info/">Cucumber</a> is great for integration testing but when a feature fails for a web application you just get the content of the page spewed out onto the console.</p>

<p>If only you could see a screenshot of the whole web page that produced the failure.</p>

<p><span id="more-124"></span>
The good news for those of you on OS X is that you can.</p>

<p>Just install my cucumber-screenshot gem.</p>

<pre><code class="bash">gem install cucumber-screenshot</code></pre>

<p>And follow the <a href="http://github.com/mocoso/cucumber-screenshot">set up instructions</a> to start snapping.</p>

<p>Enjoy.</p>

<p>If you are on another platform and want this functionality then feel free to change <a href="http://github.com/mocoso/cucumber-screenshot">the code</a>.</p>

<p>Thanks go to <a href="http://jurisgalang.com/">Juris Galang</a> for writing the <a href="http://github.com/jurisgalang/snapurl">snapurl gem</a> (which actually handles making the screenshots) and to <a href="http://aslakhellesoy.com/">Aslak Hellesoy</a> and <a href="http://blog.mattwynne.net/">Matt Wynne</a> for their help and advice integrating this with Cucumber.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2009/11/04/cucumber-screenshot-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuning Mail.app / Gmail IMAP integration</title>
		<link>http://blog.monkeysthumb.org/2009/09/04/tuning-mail-app-gmail-imap-integration/</link>
		<comments>http://blog.monkeysthumb.org/2009/09/04/tuning-mail-app-gmail-imap-integration/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 05:12:29 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2009/09/04/tuning-mail-app-gmail-imap-integration/</guid>
		<description><![CDATA[When setting up Mail.app on OS X to access your mail in your Gmail (or Google Apps) account via IMAP it is worth tweaking your &#8216;Mailbox behaviours&#8217; and mailbox mappings  to make them work together more smoothly.

However there is conflicting advice on this (from Gmail and Mac OSX Hints for example), so here&#8217;s my [...]]]></description>
			<content:encoded><![CDATA[<p>When setting up Mail.app on OS X to access your mail in your Gmail (or Google Apps) account via IMAP it is worth tweaking your &#8216;Mailbox behaviours&#8217; and mailbox mappings  to make them work together more smoothly.</p>

<p>However there is conflicting advice on this (from <a href="http://mail.google.com/support/bin/answer.py?answer=78892" title="Recommended IMAP client settings">Gmail</a> and <a href="http://www.macosxhints.com/article.php?story=2008041016554622" title="A better Gmail IMAP to Mail.app sync">Mac OSX Hints</a> for example), so here&#8217;s my definitive guide.</p>

<p><span id="more-107"></span></p>

<p>In this guide I assume you have already set up your Gmail account access via IMAP in Apple Mail following these clear instructions for <a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;answer=77663" title="Set up Gmail IMAP access on Mail 2.0">Mail 2.0</a> or <a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;answer=81379" title="Set up Gmail IMAP access on Mail 3.0">Mail 3.0</a>.</p>

<p>In the guide below I will refer to changing your &#8216;Mailbox behaviours&#8217; settings, you can find these by</p>

<ol>
<li>Open Preferences in Mail</li>
<li>Select the &#8216;Accounts&#8217; section</li>
<li>Select your Gmail account</li>
<li>Select &#8216;Mailbox behaviours&#8217;</li>
</ol>

<p>I will also refer to configuring Mail to treat some of your IMAP mailboxes as &#8217;special&#8217;. You can do this by</p>

<ol>
<li>Select the mailbox in your IMAP account you want to make &#8217;special&#8217;.</li>
<li>Select the &#8216;Mailbox&#8217; menu</li>
<li>Move the mouse over the &#8216;Use This Mailbox For&#8217;</li>
<li>Select what you want to use the mailbox for, i.e. &#8216;Drafts&#8217;, &#8216;Sent&#8217;, &#8216;Trash&#8217;, &#8216;Junk&#8217;</li>
</ol>

<h2>Drafts</h2>

<ul>
<li>In &#8216;Mailbox behaviours&#8217; tick &#8216;Store draft messages on the server&#8217;</li>
<li>Select the drafts mailbox in your IMAP account (probably [Googlemail]/Drafts) and set to be used as &#8216;Drafts&#8217;.</li>
</ul>

<p>These settings ensure that drafts will be stored in your IMAP account and will appear in the standard &#8216;Drafts&#8217; mailbox in Mail.</p>

<h2>Sent Mail</h2>

<ul>
<li>In &#8216;Mailbox behaviours&#8217; tick &#8216;Store sent message on the server&#8217;</li>
<li>Select the drafts mailbox in your IMAP account (probably [Googlemail]/Sent Mail) and set to be used as &#8216;Sent&#8217;.</li>
</ul>

<p>These settings ensure that sent mail will be stored in your IMAP account and will appear in the standard &#8216;Sent&#8217; mailbox in Mail.</p>

<h2>Junk</h2>

<ul>
<li>In &#8216;Mailbox behaviours&#8217;

<ul>
<li>Tick &#8216;Store junk messages on the server&#8217;</li>
<li>For &#8216;Delete junk mail when&#8217; select &#8216;Never&#8217;</li>
</ul></li>
<li>Select the junk mailbox in your IMAP account (probably [Googlemail]/Spam) and set to be used as &#8216;Junk&#8217;.</li>
<li>In Mail Preferences > Junk Mail

<ul>
<li>Tick &#8216;Enable junk mail filtering&#8217;</li>
<li>For &#8216;When junk mail arrives&#8217;, select move it to the Junk mailbox</li>
</ul></li>
</ul>

<p>These settings mean that you are using both Mail and Gmail&#8217;s spam filters and that you will train them in parallel, i.e. when you mark mail as Junk / Not Junk the information will be passed back to Gmail and will improve their spam filtering too.</p>

<p>I set the Junk mail to never be deleted because Gmail already does this after 30 days and set junk mail to be moved straight to the Junk mailbox so that it doesn&#8217;t clutter my inbox (this matches the behaviour on Gmail too).</p>

<p>Note: if you &#8216;Erase Junk Mail&#8217; in Mail.app it will remove the mails currently in your junk mailbox from Mail&#8217;s view of your junk mail box but not actually delete them on the server.</p>

<h2>Trash</h2>

<ul>
<li>In &#8216;Mailbox behaviours&#8217;

<ul>
<li>Tick &#8216;Move deleted messages to the Trash mailbox&#8217;</li>
<li>Tick &#8216;Store deleted messages on the server&#8217;</li>
<li>For &#8216;Delete trash when&#8217; select &#8216;Never&#8217;</li>
</ul></li>
<li>Select the trash mailbox in your IMAP account (probably [Googlemail]/Bin) and set to be used as &#8216;Trash&#8217;.</li>
</ul>

<p>These settings will ensure that mail you delete locally is marked as deleted in the IMAP server, and will leave the actual removal of deleted messages from your IMAP account up to GMail (30 days)</p>

<h2>Notes</h2>

<p>I don&#8217;t use notes so I leave &#8216;Store notes in Inbox&#8217; unticked in &#8216;Mailbox behaviours&#8217;</p>

<h2>Updated &#8211; 28 Sep 2009</h2>

<p>I double checked storing sent mail on the server at Shad&#8217;s suggestion (see comments below), and I have found that it no longer results in multiple copies of sent mail. I am not sure when this was fixed but I have updated the recommendations to suggest you store sent mail on the server as a result.</p>

<p>I&#8217;ve also corrected the label on the Notes checkbox to &#8216;Store notes in Inbox&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2009/09/04/tuning-mail-app-gmail-imap-integration/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ruby docs on OS X with Fluid</title>
		<link>http://blog.monkeysthumb.org/2009/06/22/ruby-docs-on-os-x-with-fluid/</link>
		<comments>http://blog.monkeysthumb.org/2009/06/22/ruby-docs-on-os-x-with-fluid/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 12:56:33 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2009/06/22/ruby-docs-on-os-x-with-fluid/</guid>
		<description><![CDATA[Wouldn&#8217;t it be nice to have a neat little an application on your desktop which allows you to search and view ruby docs.

Well it&#8217;s just 4 easy steps away.



Step 1: Install Fluid

Download and install Fluid a site specific browser for OS X, that enables you to turn a website into an application.

Step 2: Download the [...]]]></description>
			<content:encoded><![CDATA[<p>Wouldn&#8217;t it be nice to have a neat little an application on your desktop which allows you to search and view ruby docs.</p>

<p>Well it&#8217;s just 4 easy steps away.</p>

<p><span id="more-70"></span></p>

<h2>Step 1: Install Fluid</h2>

<p>Download and install <a href="http://fluidapp.com/">Fluid</a> a site specific browser for OS X, that enables you to turn a website into an application.</p>

<h2>Step 2: Download the Rails Searchable API Doc</h2>

<ul>
<li>Visit <a href="http://railsapi.com/">Rails Searchable API Doc</a></li>
<li>Press &#8217;select gems&#8217; and decide which versions of Ruby, Rails and other common gems you want to include in your ruby docs application</li>
<li>Click download</li>
<li>Unpack the zip file you download and save it to &#8216;/Users/you/Library/Application Support/RubyDocs&#8217; say.</li>
</ul>

<p>I chose the &#8216;Rails Searchable API Doc&#8217; because it includes a number of other ruby gems, has a good search function and supports keyboard shortcuts.</p>

<p>Of course if you prefer a different rendering of the docs, e.g. <a href="http://noobkit.com/">Noobkit</a> and <a href="http://www.railsbrain.com/">RailsBrain</a> then you could download one of those instead.</p>

<h2>Step 3: Download a nice icon</h2>

<p>Download <a href="http://www.flickr.com/photos/conekt/">conekt&#8217;s</a> excellent <a href="http://farm4.static.flickr.com/3392/3315357128_af7c165408_o_d.png">RubyDoc icon</a>.</p>

<h2>Step 4: Make your application</h2>

<p>Open Fluid</p>

<ul>
<li>Put the local URL of your docs, &#8216;file:///Users/you/Library/Application%20Support/RubyDocs/index.html&#8217;, say, in the URL field</li>
<li>Put &#8216;RubyDocs&#8217; in the name field</li>
<li>Select &#8216;Other&#8217; in the icon field and find your spiffy icon (downloaded in step 3)</li>
<li>Press the create button.</li>
</ul>

<p>You&#8217;re done. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2009/06/22/ruby-docs-on-os-x-with-fluid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install old version of screen using Mac Ports</title>
		<link>http://blog.monkeysthumb.org/2009/06/11/install-old-version-of-screen-using-mac-ports/</link>
		<comments>http://blog.monkeysthumb.org/2009/06/11/install-old-version-of-screen-using-mac-ports/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 05:14:43 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2009/06/11/install-old-version-of-screen-using-mac-ports/</guid>
		<description><![CDATA[The latest version of Screen (version 4.0.3 port revision 3) that comes with MacPorts has a number of issues.

Most annoying for me were that &#8216;mate&#8217; and &#8216;gitx&#8217; stopped working from the command line (with the errors &#8216;mate: failed to establish connection with TextMate&#8217; and &#8216;gitx: failed to establish connection with GitX&#8217; respectively).

The screen port @4.0.3&#95;1 [...]]]></description>
			<content:encoded><![CDATA[<p>The latest version of <a href="http://en.wikipedia.org/wiki/GNU_Screen">Screen</a> (version 4.0.3 port revision 3) that comes with MacPorts has a <a href="https://trac.macports.org/ticket/18235">number of issues</a>.</p>

<p>Most annoying for me were that &#8216;mate&#8217; and &#8216;gitx&#8217; stopped working from the command line (with the errors &#8216;mate: failed to establish connection with TextMate&#8217; and &#8216;gitx: failed to establish connection with GitX&#8217; respectively).</p>

<p>The screen port @4.0.3&#95;1 (version 4.0.3 revision 1) is free of these problems and, with a little bit of work, you can install this version via MacPorts. The instructions below are based on Joe Horns&#8217; post, <a href="http://journal.bitshaker.com/articles/2007/10/20/install-old-versions-of-ports-using-macports/">install old versions of ports using MacPorts</a>.</p>

<p><span id="more-58"></span></p>

<h2>Instructions</h2>

<ol>
<li><p>Set up a local port repository. In the file /opt/local/etc/macports/sources.conf, add this line before the rsync line:</p>

<pre><code class="bash">file:///Users/Shared/dports</code></pre>

<p>and create that directory.</p></li>
<li><p>Install the old revision of the port into your local repository, <a href="http://trac.macports.org/browser/trunk/dports/sysutils/screen/Portfile?rev=45522">revision 45522</a> specifies screen port @4.0.3_1.</p>

 <pre><code class="bash">cd /Users/Shared/dports &#038;&#038; svn co --revision 45522 \
http://svn.macports.org/repository/macports/trunk/dports/sysutils/screen/ \ sysutils/screen/</code></pre></li>
<li><p>Run portindex so that ports now finds your new (old) version of Screen.</p>

<pre><code class="bash">portindex /Users/Shared/dports</code></pre></li>
<li><p>Now you should be able to see two versions of the screen port by running</p>

<pre><code class="bash">port list screen</code></pre>

<p>However, rather unhelpfully, they will both be listed as version @4.0.3.</p></li>
<li><p>Install Screen</p>

<pre><code class="bash">sudo port install screen @4.0.3_1</code></pre>

<p>and you should be up and running.</p></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2009/06/11/install-old-version-of-screen-using-mac-ports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Refresh data from production</title>
		<link>http://blog.monkeysthumb.org/2008/11/30/refresh-data-from-production/</link>
		<comments>http://blog.monkeysthumb.org/2008/11/30/refresh-data-from-production/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 08:15:36 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2008/11/30/refresh-data-from-production/</guid>
		<description><![CDATA[When working on web apps, it can really useful to be able to load production data into your development environment.

I am a sucker for anything that reduces typing so I put together a mysql&#95;tasks rails plugin for my MySQL backed applications which makes it as easy as

rake mysql:refresh_from_production

Which makes a tar gzipped snapshot of the [...]]]></description>
			<content:encoded><![CDATA[<p>When working on web apps, it can really useful to be able to load production data into your development environment.</p>

<p>I am a sucker for anything that reduces typing so I put together a <a href="http://github.com/mocoso/mysql_tasks/tree/master">mysql&#95;tasks</a> rails plugin for my MySQL backed applications which makes it as easy as</p>

<pre><code class="bash">rake mysql:refresh_from_production</code></pre>

<p>Which makes a tar gzipped snapshot of the production database, downloads it into my development box and loads it into my development environment.</p>

<p>If you want to give it a go yourself then read these <a href="http://github.com/mocoso/mysql_tasks/tree/master/README.markdown">installation instructions for the mysql&#95;tasks plugin</a>.</p>

<p>This was inspired by <a href="http://www.nateclark.com/articles/2007/02/23/rails-rake-tasks-to-sync-your-remote-database-to-your-local-development-environment">the real Nate Clark</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2008/11/30/refresh-data-from-production/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Code Beautifier Textmate Bundle</title>
		<link>http://blog.monkeysthumb.org/2008/09/25/code-beautifier-textmate-bundle/</link>
		<comments>http://blog.monkeysthumb.org/2008/09/25/code-beautifier-textmate-bundle/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 12:33:14 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2008/09/25/code-beautifier-textmate-bundle/</guid>
		<description><![CDATA[Textmate&#8217;s indent functionality does a passable job of formatting your code BUT there is a great deal of room for improvement.

Inspired by the Paul Lutus&#8217;s ruby beautifier script and Tim Burks&#8217;s post on making it into a Textmate bundle I&#8217;ve put together a Code Beautifier Textmate bundle

It only supports Ruby at present but does improve [...]]]></description>
			<content:encoded><![CDATA[<p>Textmate&#8217;s indent functionality does a passable job of formatting your code BUT there is a great deal of room for improvement.</p>

<p>Inspired by the Paul Lutus&#8217;s <a href="http://www.arachnoid.com/ruby/rubyBeautifier.html">ruby beautifier script</a> and Tim Burks&#8217;s <a href="http://blog.neontology.com/posts/2006/05/10/beautiful-ruby-in-textmate">post on making it into a Textmate bundle</a> I&#8217;ve put together a <a href="http://github.com/mocoso/code-beautifier.tmbundle/tree/master">Code Beautifier Textmate bundle</a></p>

<p>It only supports Ruby at present but does improve upon Textmate&#8217;s indent functionality, in particular it is better at indenting multiline statements and cleans up white space.</p>

<p>It&#8217;s all hosted on <a href="http://github.com/">Github</a> so if you want to make improvements then please fork away.</p>

<p><span id="more-47"></span></p>

<h2>Installation</h2>

<p>Run this:</p>

<pre><code class="bash">cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/mocoso/code-beautifier.tmbundle.git Code\ Beautifier.tmbundle</code></pre>

<p>Then select &#8216;Bundles > Bundle Editor > Reload Bundles&#8217; from Textmate&#8217;s menus</p>

<h2>Updated on 21 May 2009</h2>

<p>Changed the URL of the repository on GitHub to http://github.com/mocoso/code-beautifier.tmbundle/tree/master to fix a typo in the name (oops).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2008/09/25/code-beautifier-textmate-bundle/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Screen Textmate Bundle</title>
		<link>http://blog.monkeysthumb.org/2008/09/09/screen-textmate-bundle/</link>
		<comments>http://blog.monkeysthumb.org/2008/09/09/screen-textmate-bundle/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 05:52:19 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.org/2008/09/09/screen-textmate-bundle/</guid>
		<description><![CDATA[When working on a rails project I usually have script/server, script/console and autotest all running in GNU Screen. Jamie Flournoy has already described why using GNU screen is better than plain old Terminal Tabs.

I&#8217;ve put together a Screen Textmate Bundle to make it easy to configure and open per project screen sessions.



Installation

Run this:

cd ~/Library/Application\ Support/TextMate/Bundles
git [...]]]></description>
			<content:encoded><![CDATA[<p>When working on a rails project I usually have script/server, script/console and autotest all running in <a href="http://en.wikipedia.org/wiki/GNU_Screen">GNU Screen</a>. Jamie Flournoy has already described why using <a href="http://www.pervasivecode.com/blog/2007/06/12/gnu-screen-and-my-screenrc/">GNU screen is better than plain old Terminal Tabs</a>.</p>

<p>I&#8217;ve put together a <a href="http://github.com/mocoso/screen.tmbundle/tree/master">Screen Textmate Bundle</a> to make it easy to configure and open per project screen sessions.</p>

<p><span id="more-44"></span></p>

<h2>Installation</h2>

<p>Run this:</p>

<pre><code class="bash">cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/mocoso/screen.tmbundle.git Screen.tmbundle</code></pre>

<h2>Set up your screen configuration for a project</h2>

<p>Create a .screenrc file <em>in your project directory</em> if you want to specify a particular configuration for your project.</p>

<p>For example for a Ruby on Rails project you might create a .screenrc file in your project directory like this</p>

<pre><code class="bash"># Have the server running in screen 1
#
# Stuff is used so that when you exit the stuff-ed program, you drop back
# to the bash shell for that screen instead of immediately exiting that
# screen. This is useful for "^c, up-arrow, enter" restarting of programs.
screen -t server 1
stuff "script/server\012"

# Have autotest running in screen 2
screen -t autotest 2
stuff "autotest\012"

# Have the console running in screen 3 
screen -t console 3
stuff "script/console\012"

# Finally have a command line prompt at the project root in screen 4
screen -t project_root 4</code></pre>

<h2>Usage</h2>

<p>Use this bundle&#8217;s &#8216;Start Session&#8217; command (ctrl-shift-s) to start (or reconnect to) your project&#8217;s screen session.</p>

<p>If you have created a .screenrc file in your project directory then this will be used to initialize the new session.</p>

<h2>Update (14th Sep 2008)</h2>

<p>On <a href="http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/" title="Like Slime, For Vim">Jonathon Palardy&#8217;s suggestion</a> I&#8217;ve added a &#8216;Send to Screen&#8217; command (ctrl-alt-c) that copies selected text (or current line if no selection made) to your project&#8217;s screen session. If you have multiple windows open in the session then it will paste to the currently selected window.</p>

<h2>Update (22nd Jan 2009)</h2>

<p>If you want similar functionality without learning screen then check out Nick Rutherford&#8217;s <a href="http://blog.ardes.com/2009/1/22/rails-multi-terminal-launcher">Rails Workbench</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2008/09/09/screen-textmate-bundle/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSV templating made easy in Rails</title>
		<link>http://blog.monkeysthumb.org/2008/06/27/csv-templating-made-easy-in-rails/</link>
		<comments>http://blog.monkeysthumb.org/2008/06/27/csv-templating-made-easy-in-rails/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 04:40:39 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://blog.monkeysthumb.dev/?p=29</guid>
		<description><![CDATA[CSV Builder is a simple little Rails (v2.1) plugin that makes it easy to write templates to generate CSV formatted output from your Rails application.

It does this by providing a little bit of plumbing gubbins to make a custom template handler from the FasterCSV gem.

So if you want to export data in CSV format from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/econsultancy/csv_builder/tree/master">CSV Builder</a> is a simple little Rails (v2.1) plugin that makes it easy to write templates to generate CSV formatted output from your Rails application.</p>

<p>It does this by providing a little bit of plumbing gubbins to make a custom template handler from the <a href="http://fastercsv.rubyforge.org">FasterCSV gem</a>.</p>

<p>So if you want to export data in CSV format from your rails app then install it like this</p>

<pre><code class="bash">sudo gem install fastercsv
./script/plugin install git://github.com/econsultancy/csv_builder.git</code></pre>

<p>This plugin was developed as part of project that I have been working on with <a href="http://www.e-consultancy.com">Econsultancy.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.monkeysthumb.org/2008/06/27/csv-templating-made-easy-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
