<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:posterous="http://posterous.com/help/rss/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>a timocracy of one</title>
    <link>http://posterous.timocracy.com</link>
    <description>Tim Connor's blog</description>
    <generator>posterous.com</generator>
    <link xmlns="http://www.w3.org/2005/Atom" type="application/json" rel="http://api.friendfeed.com/2008/03#sup" href="http://posterous.com/api/sup_update#323b83214" />
    
    
    <feedburner:info uri="timocracy" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://posterous.superfeedr.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://www.timocracy.com/xml/atom10/feed.xml" /><feedburner:emailServiceId>timocracy</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://www.timocracy.com/xml/atom10/feed.xml" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><item>
      <pubDate>Sat, 04 Sep 2010 14:33:21 -0700</pubDate>
      <title>A list of some sites I follow to keep up in my field (ruby and web development)</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/mRUPhoJiWQA/a-list-of-some-sites-i-follow-to-keep-up-in-m</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/a-list-of-some-sites-i-follow-to-keep-up-in-m</guid>
      <description>&lt;p&gt;
	&lt;a href="http://www.google.com/reader/bundle/user%2F12740622692005399469%2Fbundle%2FRuby%20JS%20and%20other%20dev"&gt;http://www.google.com/reader/bundle/user%2F12740622692005399469%2Fbundle%2FRuby%20JS%20and%20other%20dev&lt;/a&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/a-list-of-some-sites-i-follow-to-keep-up-in-m"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/a-list-of-some-sites-i-follow-to-keep-up-in-m#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/mRUPhoJiWQA" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/a-list-of-some-sites-i-follow-to-keep-up-in-m</feedburner:origLink></item>
    <item>
      <pubDate>Mon, 21 Jun 2010 17:35:00 -0700</pubDate>
      <title>Git sub-tree merging back to the subtree for pushing to an upstream</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/KWEyn7wBmO4/git-sub-tree-merging-back-to-the-subtree-for</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/git-sub-tree-merging-back-to-the-subtree-for</guid>
      <description>&lt;p&gt;
	&lt;p&gt;While &lt;a href="http://progit.org/book/ch6-7.html"&gt;git sub-tree merge strategy&lt;/a&gt; works great for merging a library into vendor (when you want to pull HEAD on that library instead of waiting for releases), I had trouble finding documentation on pushing back to upstream.  This is annoying because one of the most obvious times you may want to use subtree is when you manage the library yourself, so can just pull straight from the repo, and want to push your maintenance changes back.&lt;/p&gt;
&lt;p&gt;Surprisingly, and not what I have come to expect from git, it just works.  From the example in the docs I linked, when you are checked out on master&lt;/p&gt;
&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;git merge --squash -s subtree --no-commit rack_branch&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;will merge the rack_branch into where you have specified.  But it just works the other way to.  If checked out on rack_branch&lt;/p&gt;
&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;git merge --squash -s subtree --no-commit master&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;will do what you expect, so you can now just push your library branch back to it's upstream.&lt;/p&gt;
&lt;p&gt;Awesome!&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/git-sub-tree-merging-back-to-the-subtree-for"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/git-sub-tree-merging-back-to-the-subtree-for#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/KWEyn7wBmO4" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/git-sub-tree-merging-back-to-the-subtree-for</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 19 May 2010 23:32:00 -0700</pubDate>
      <title>Our vows and pre-vow speeches</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/z50yJETCMB8/our-vows-and-pre-vow-speeches</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/our-vows-and-pre-vow-speeches</guid>
      <description>&lt;p&gt;
	&lt;h2&gt;Roula&lt;/h2&gt;
&lt;p&gt;I am honored that you have chosen me to be your wife.  You: the best person I know, my dearest friend, the highlight of my day.  &lt;/p&gt;
&lt;p&gt;I may have doubts and questions about life, but of you and this marriage I have none - it is the most fulfilling work of my life.&lt;/p&gt;
&lt;p&gt;The sounds of your voice and the touch of your hand assures me that I am, at last, home, and I cannot wait to spend the rest of my life with you.&lt;/p&gt;
&lt;p&gt;I love you now and always.&lt;/p&gt;
&lt;h2&gt;Tim&lt;/h2&gt;
&lt;p&gt;Some of you know that we aren't very traditional and aren't sold on the cultural expectations of marriage. We decided we'd try and have a kid before we decided to get married and we live as if we are married: we live together, share our expenses, daily life, hopes, dreams, and plans. Yet, I very much wanted to have a wedding and get married.&lt;/p&gt;
&lt;p&gt;I want to commit so absolutely that Roula can feel it incarnated on her finger.  I want her to have a constant reminder that I am here for her, at all times, and I want the same for me.  I want to gather our loved ones and have them share a moment where we formalize our commitment. I want to crystalize and distill this moment down for all eternity, for us to share and remember when we are 102 and and hobbling down to the park for a Sunday picnic. I want to make the implicit, explicit, and for us to say out loud, in front of witnesses, the things we already both know and feel.&lt;/p&gt;
&lt;h2&gt;Vows&lt;/h2&gt;
&lt;p&gt;I promise to love and treasure you always, in sickness and in health, in poverty and in wealth;&lt;br /&gt;to be considerate of your feelings, kind in all things, and ask forgiveness when I fail at that;&lt;br /&gt;to talk through the tough times and always remember to the good ones;&lt;br /&gt;to hold you above all others in my heart.&lt;/p&gt;
&lt;p&gt;This I vow: to commit to this marriage with all my being and no reservations.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/our-vows-and-pre-vow-speeches"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/our-vows-and-pre-vow-speeches#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/z50yJETCMB8" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/our-vows-and-pre-vow-speeches</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 27 Apr 2010 18:09:45 -0700</pubDate>
      <title>The Tea Party is Racist</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/CXt9D12Xo9w/the-tea-party-is-racist</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/the-tea-party-is-racist</guid>
      <description>&lt;p&gt;
	&lt;a href="http://politicalirony.com/2010/04/27/the-tea-party-is-racist/"&gt;http://politicalirony.com/2010/04/27/the-tea-party-is-racist/&lt;/a&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/the-tea-party-is-racist"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/the-tea-party-is-racist#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/CXt9D12Xo9w" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/the-tea-party-is-racist</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 27 Apr 2010 18:06:44 -0700</pubDate>
      <title>Unobtrusive JavaScript vs. Kool-Aid</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/judPAabF7e0/unobtrusive-javascript-vs-kool-aid</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/unobtrusive-javascript-vs-kool-aid</guid>
      <description>&lt;p&gt;
	Great response to @jamis' UJS == Kool-aid posts. Welcome to the post-2005 era of web dev. ;)&lt;p /&gt;  &lt;p /&gt; &lt;p /&gt; &lt;div style="font-family: sans-serif; overflow: auto; margin: 0px 10px;"&gt;&lt;h2 style="margin: 0.25em 0 0 0;" /&gt;&lt;div class=""&gt;&lt;a href="http://feedproxy.google.com/~r/dailyjs/~3/BcWRmWlkHRQ/unobtrusive-js"&gt;Unobtrusive JavaScript vs. Kool-Aid&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt; &lt;div style="margin-bottom: 0.5em;"&gt;via &lt;a href="http://dailyjs.com" class="f"&gt;DailyJS&lt;/a&gt; on 4/26/10&lt;/div&gt;&lt;br style="display: none;" /&gt; &lt;p&gt;This article is a guide to writing &lt;em&gt;unobtrusive JavaScript&lt;/em&gt;. It’s not always easy for people to transition to writing JavaScript this way, so I’ve tried to address common concerns.&lt;/p&gt; &lt;p&gt;The techniques presented here should enable you to think differently about client-side code and work more productively.&lt;/p&gt; &lt;h3&gt;Background&lt;/h3&gt; &lt;p&gt;It’s important to realise that unobtrusive JavaScript is an evolving concept, perhaps even a movement. The broad goal is to separate JavaScript into a &lt;em&gt;behaviour&lt;/em&gt; layer, but related goals include: enhancing browser behaviour, capability detection, and transparently supporting modern platforms like touchscreen phones.&lt;/p&gt; &lt;p&gt;This article was inspired by my surprise at the following tweets:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;almost two months later, I’m still have trouble swallowing the &lt;span&gt;UJS&lt;/span&gt; kool-aid. &lt;a href="http://twitter.com/jamis/status/12901143048"&gt;@jamis&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;Funny how the JS people get all shocked and dismayed when jamis complains about &lt;span&gt;UJS&lt;/span&gt;. Evidence of kool-aid. &lt;a href="http://twitter.com/rjs/status/12903026393"&gt;@rjs&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;Unobtrusive JavaScript isn’t a fad, it’s how you should write JavaScript&lt;/strong&gt;. If you read this blog, you’re probably doing it already. If you have server-side developer friends who don’t write much client-side code, please send them this article!&lt;/p&gt; &lt;p&gt;I don’t advocate blindly applying the techniques championed by the proponents of unobtrusive JavaScript. However, I have learned lessons from several hard-won battles which have enabled me to write JavaScript more productively — my own practices have evolved &lt;em&gt;towards&lt;/em&gt; unobtrusive JavaScript over the last 4-5 years.&lt;/p&gt; &lt;h3&gt;Inline JavaScript&lt;/h3&gt; &lt;p&gt;Where does inline JavaScript come from? One common place is server-side frameworks. It’s easier for frameworks to inject JavaScript through helpers — popular frameworks like &lt;a href="http://rubyonrails.org/"&gt;Rails&lt;/a&gt; do this. This is because the &lt;span&gt;HTML&lt;/span&gt; and JavaScript these frameworks generate is naturally tightly coupled. It’s also because the framework builders often try to appeal to the host language rather than seasoned JavaScript developers.&lt;/p&gt; &lt;p&gt;Inline JavaScript crops up in several places:&lt;/p&gt; &lt;ul&gt; 	&lt;li&gt;Events like &lt;code&gt;onclick&lt;/code&gt; are added to page elements through attributes&lt;/li&gt; 	&lt;li&gt;Inline &lt;code&gt;script&lt;/code&gt; tags&lt;/li&gt; 	&lt;li&gt;Conditionally generated combinations of the above&lt;/li&gt; 	&lt;li&gt;Custom solutions like Rails’ &lt;span&gt;RJS&lt;/span&gt; templates (often used to communicate between the server and client)&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;These techniques work well for frameworks and make life easy for the host language developer. In fact, Rails is one of the projects that helped JavaScript frameworks bring Ajax to the world, and also the now ubiquitous use of visual effects through projects like &lt;a href="http://script.aculo.us/"&gt;Scriptaculous&lt;/a&gt;.&lt;/p&gt; &lt;h3&gt;The Alternative&lt;/h3&gt; &lt;p&gt;The alternative isn’t just about moving your JavaScript into its own files. It’s to change the way you think about JavaScript, the &lt;span&gt;DOM&lt;/span&gt;, and &lt;span&gt;HTML&lt;/span&gt; templates.&lt;/p&gt; &lt;p&gt;If you’ve worked with &lt;span&gt;CSS&lt;/span&gt;, you’ll be familiar with the separation of style from structure through the use of stylesheets. The popular argument for writing unobtrusive JavaScript is that scripts define a &lt;em&gt;behaviour&lt;/em&gt; layer, and therefore should be separated, just like stylesheets.&lt;/p&gt; &lt;p&gt;This is true up to a point, but it takes a leap of faith to get there. The key is to stop thinking about templates like static blocks of &lt;span&gt;HTML&lt;/span&gt;, and see documents for what they are: living, breathing tree structures of &lt;span&gt;DOM&lt;/span&gt; objects, events, and styles.&lt;/p&gt; &lt;h3&gt;Concerns&lt;/h3&gt; &lt;p&gt;The main concern of those who are uncomfortable with writing unobtrusive JavaScript is maintainability. This is deeper than just finding code, or the link between a template and a script — it also affects project management.&lt;/p&gt; &lt;p&gt;When planning new features, it can be difficult to determine what page elements will be affected by a change if all of the JavaScript is outside the templates.&lt;/p&gt; &lt;p&gt;Or is it?&lt;/p&gt; &lt;h3&gt;Mental Models&lt;/h3&gt; &lt;p&gt;People resist writing JavaScript this way is because their mental model of a &lt;span&gt;HTML&lt;/span&gt; document is based on &lt;span&gt;HTML&lt;/span&gt; templates. A more useful mental model is one which encapsulates the true nature of the &lt;span&gt;DOM&lt;/span&gt; — a document is a collection of interrelated objects, affected by scripts, stylesheets and their very structure.&lt;/p&gt; &lt;p&gt;When I start work on a new project or feature, I think in terms of these objects and how they’re related. I try to group like items and behaviours — just as styles can be efficiently shared, &lt;em&gt;events&lt;/em&gt; can also.&lt;/p&gt; &lt;h3&gt;Strategies and Patterns&lt;/h3&gt; &lt;h4&gt;&lt;span&gt;DOM&lt;/span&gt; Ready&lt;/h4&gt; &lt;p&gt;This is what makes healthy client-side code possible. &lt;span&gt;DOM&lt;/span&gt; ready lets you run a function when the document is in a usable state. This allows you to safely bind event handlers. In jQuery it looks like this:&lt;/p&gt; &lt;div&gt;&lt;pre&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;document&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;ready&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;function&lt;/span&gt;&lt;span&gt;()&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;// Your code here&lt;/span&gt; &lt;span&gt;});&lt;/span&gt; &lt;/pre&gt; &lt;/div&gt;&lt;p&gt;Prototype:&lt;/p&gt; &lt;div&gt;&lt;pre&gt;&lt;span&gt;document&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;observe&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;dom:loaded&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;function&lt;/span&gt;&lt;span&gt;()&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;// Your code here&lt;/span&gt; &lt;span&gt;});&lt;/span&gt; &lt;/pre&gt; &lt;/div&gt;&lt;p&gt;This isn’t actually an easy thing to write from scratch — let the framework do the work. I’ve written my own &lt;span&gt;DOM&lt;/span&gt; ready handler before and it wasn’t much fun (mainly due to IE).&lt;/p&gt; &lt;h4&gt;Event Delegation: &lt;span&gt;DRY&lt;/span&gt;&lt;/h4&gt; &lt;p&gt;If you’ve come to JavaScript through jQuery, you might be wondering what I’ve been talking about. People raised on jQuery think in terms of event delegation, and this is one of the key strategies to writing unobtrusive JavaScript.&lt;/p&gt; &lt;p&gt;Event delegation is where an event is bound to a containing element, then conditionally executed based on the event’s element.&lt;/p&gt; &lt;p&gt;Imagine if you wanted to open popup windows when the user clicks a link. You could attach an &lt;code&gt;onclick&lt;/code&gt; attribute and set up a window. Every link would then have to repeat this code.&lt;/p&gt; &lt;p&gt;An alternative approach is to use event delegation to bind an event to a high level element, the use a class to trigger a special popup event handler:&lt;/p&gt; &lt;div&gt;&lt;pre&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;document&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;click&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;function&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;event&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;event&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;target&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;is&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;#39;.popup&amp;#39;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;// Open a new window with specified parameters&lt;/span&gt; &lt;span&gt;}&lt;/span&gt; &lt;span&gt;event&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;preventDefault&lt;/span&gt;&lt;span&gt;();&lt;/span&gt; &lt;span&gt;});&lt;/span&gt; &lt;/pre&gt; &lt;/div&gt;&lt;p&gt;The benefit is similar to the benefits brought in by stylesheets — you can now change the behaviour of all popup windows across your entire project. You could even have multiple class names for different window properties — sizes, toolbar hiding, whatever! It also makes the page size smaller, all for the price of one event handler with an &lt;code&gt;if&lt;/code&gt; statement.&lt;/p&gt; &lt;h4&gt;Internal Relationships&lt;/h4&gt; &lt;p&gt;On larger projects I use a technique that maps &lt;em&gt;controllers&lt;/em&gt; to JavaScript objects. I do this by using &lt;code&gt;body&lt;/code&gt; ID tags and classes. A function runs when the &lt;span&gt;DOM&lt;/span&gt; is ready and calls the appropriate object.&lt;/p&gt; &lt;p&gt;For example, let’s say you’re making a blog application in Rails (or similar) and you have an &lt;code&gt;ArticlesController&lt;/code&gt;. I’d use a helper in my Rails layout to create an appropriate body tag:&lt;/p&gt; &lt;div&gt;&lt;pre&gt;&lt;span&gt;&amp;lt;%=&lt;/span&gt; &lt;span&gt;body&lt;/span&gt; &lt;span&gt;:id&lt;/span&gt; &lt;span&gt;=&amp;gt;&lt;/span&gt; &lt;span&gt;controller&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;name&lt;/span&gt; &lt;span&gt;%&amp;gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt; &lt;/pre&gt; &lt;/div&gt;&lt;p&gt;Which is defined like this:&lt;/p&gt; &lt;div&gt;&lt;pre&gt;&lt;span&gt;def&lt;/span&gt; &lt;span&gt;body&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;options&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;{})&lt;/span&gt; &lt;span&gt;tag&lt;/span&gt; &lt;span&gt;&amp;#39;body&amp;#39;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;options&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; &lt;span&gt;true&lt;/span&gt; &lt;span&gt;end&lt;/span&gt; &lt;/pre&gt; &lt;/div&gt;&lt;p&gt;Then my JavaScript delegation function would look at the body tag and call a method on an associated object:&lt;/p&gt; &lt;div&gt;&lt;pre&gt;&lt;span&gt;ArticlesController&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;run&lt;/span&gt;&lt;span&gt;:&lt;/span&gt; &lt;span&gt;function&lt;/span&gt;&lt;span&gt;()&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;// Do stuff that the articles templates need&lt;/span&gt; &lt;span&gt;}&lt;/span&gt; &lt;span&gt;};&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;document&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;ready&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;function&lt;/span&gt;&lt;span&gt;()&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;var&lt;/span&gt; &lt;span&gt;controllerName&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;#39;body&amp;#39;&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;id&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;controllerName&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;$&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;#39;body&amp;#39;&lt;/span&gt;&lt;span&gt;).&lt;/span&gt;&lt;span&gt;id&lt;/span&gt; &lt;span&gt;+&lt;/span&gt; &lt;span&gt;&amp;#39;Controller&amp;#39;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; &lt;span&gt;if&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;typeof&lt;/span&gt; &lt;span&gt;controllerName&lt;/span&gt; &lt;span&gt;!==&lt;/span&gt; &lt;span&gt;&amp;#39;undefined&amp;#39;&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;{&lt;/span&gt; &lt;span&gt;controllerName&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;&amp;#39;run&amp;#39;&lt;/span&gt;&lt;span&gt;]();&lt;/span&gt; &lt;span&gt;}&lt;/span&gt; &lt;span&gt;}&lt;/span&gt; &lt;span&gt;});&lt;/span&gt; &lt;/pre&gt; &lt;/div&gt;&lt;p&gt;This body ID delegation pattern has allowed me to build very large Rails projects without feeling lost when moving between JavaScript and Rails templates. I also use body class names for shared functionality. The JavaScript “controllers” are generally stubs that invoke other objects.&lt;/p&gt; &lt;p&gt;Any framework could use this technique — it’s really just an agreement between your server-side code and JavaScript.&lt;/p&gt; &lt;h3&gt;Test First&lt;/h3&gt; &lt;p&gt;When I start writing JavaScript for a project, I try to think in terms of the core functionality, independent of the browser. I’ll write console-based code and run unit tests in the console. Once I’m happy with my “models” I’ll start to hook up event handlers.&lt;/p&gt; &lt;p&gt;Get used to thinking about events through &lt;span&gt;CSS&lt;/span&gt; classes — try to group like events and rely on high-level delegated event handlers. Not only does this result in fast UI code, it also makes testing easier.&lt;/p&gt; &lt;h3&gt;Light Event Handlers&lt;/h3&gt; &lt;p&gt;Good code us usually easy to test. I’ve found that writing light event handlers then calling higher-level objects helps keep testing simple and increases reusability.&lt;/p&gt; &lt;h3&gt;Basics&lt;/h3&gt; &lt;p&gt;It’s useful to be fully-versed in JavaScript’s object model and prototypal inheritance. Even though you can use certain libraries to ape classical OO, good code comes from a deep understanding of the tools at hand.&lt;/p&gt; &lt;p&gt;Maintainable and clear code comes from knowing when to exploit JavaScript’s flexible object system, rather than trying to write in a style that doesn’t suit it.&lt;/p&gt; &lt;h3&gt;Byte-sized Takeaway&lt;/h3&gt; &lt;p&gt;Keeping JavaScript out of templates can help:&lt;/p&gt; &lt;ul&gt; 	&lt;li&gt;Reduce page size&lt;/li&gt; 	&lt;li&gt;Improve performance&lt;/li&gt; 	&lt;li&gt;Allow broad brush-stroke changes across a site&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;To ensure projects are maintainable:&lt;/p&gt; &lt;ul&gt; 	&lt;li&gt;Create a clear link between templates and the location of associated scripts&lt;/li&gt; 	&lt;li&gt;Use the body ID/class technique&lt;/li&gt; 	&lt;li&gt;Think in terms of &lt;span&gt;DOM&lt;/span&gt; objects — the &lt;span&gt;DOM&lt;/span&gt; is a living, breathing system, not just a static page&lt;/li&gt; 	&lt;li&gt;Exploit JavaScript’s inherent advantages rather than trying to force it to be something it isn’t&lt;/li&gt; &lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/dailyjs/~4/BcWRmWlkHRQ" height="1" width="1" /&gt;&lt;/div&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/unobtrusive-javascript-vs-kool-aid"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/unobtrusive-javascript-vs-kool-aid#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/judPAabF7e0" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/unobtrusive-javascript-vs-kool-aid</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 22 Apr 2010 00:37:19 -0700</pubDate>
      <title>Following up on how to test a config.ru, an actual patch </title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/wajfWHqGLHg/following-up-on-how-to-test-a-configru-an-act</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/following-up-on-how-to-test-a-configru-an-act</guid>
      <description>&lt;p&gt;
	&lt;a href="http://github.com/timocratic/rack-test/commit/dd5324627890b4632c07deed1fc252827cab7c51"&gt;http://github.com/timocratic/rack-test/commit/dd5324627890b4632c07deed1fc2528...&lt;/a&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/following-up-on-how-to-test-a-configru-an-act"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/following-up-on-how-to-test-a-configru-an-act#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/wajfWHqGLHg" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/following-up-on-how-to-test-a-configru-an-act</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 21 Apr 2010 10:20:00 -0700</pubDate>
      <title>Testing a rackup (config.ru) file with Rack::Test</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/cWnnRUpTwaE/testing-a-rackup-configru-file-with-racktest</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/testing-a-rackup-configru-file-with-racktest</guid>
      <description>&lt;p&gt;
	&lt;p&gt;The ever useful &lt;a href="http://github.com/brynary/rack-test"&gt;rack-test gem let's you easily integration test any rack project&lt;/a&gt;.  All you have to do is include the Rack::Test::Methods and define an app method that returns your rack app.  So people usually have a config.ru that just references their my_application.rb that they reference in their config.ru and then in their test file they can also reference that app and return it.  Something to to this effect:&lt;/p&gt;
&lt;p&gt;&lt;div class="data syntax type-ruby"&gt;
    
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            
            &lt;pre class="line_numbers"&gt;
&lt;span rel="#L1" id="LID1"&gt;1&lt;/span&gt;
&lt;span rel="#L2" id="LID2"&gt;2&lt;/span&gt;
&lt;span rel="#L3" id="LID3"&gt;3&lt;/span&gt;
&lt;span rel="#L4" id="LID4"&gt;4&lt;/span&gt;
&lt;span rel="#L5" id="LID5"&gt;5&lt;/span&gt;
&lt;/pre&gt;
          &lt;/td&gt;
          &lt;td width="100%"&gt;
            
              &lt;div class="highlight"&gt;&lt;pre /&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MySweetRackApp&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="no"&gt;Proc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;text/html&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;success&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC4"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
            
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    
  &lt;/div&gt;&lt;/p&gt;
&lt;p&gt;I had a project where I was actually trying to better breakdown a more complex app, and I wanted to just be able to use Rack's built-in map method at the top level of my config.ru to route to different apps.  And in at least some of the cases I wanted to be able to test the whole thing.  Also, I figured sometimes it's useful to actually be able to test your rackup file itself, all routing/mapping included.  So I dug around in the rack code and found how the rackup command handles the .ru file, and came up with this:&lt;/p&gt;
&lt;p&gt;&lt;div class="data syntax type-ruby"&gt;
    
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            
            &lt;pre class="line_numbers"&gt;
&lt;span rel="#L1" id="LID1"&gt;1&lt;/span&gt;
&lt;span rel="#L2" id="LID2"&gt;2&lt;/span&gt;
&lt;span rel="#L3" id="LID3"&gt;3&lt;/span&gt;
&lt;span rel="#L4" id="LID4"&gt;4&lt;/span&gt;
&lt;span rel="#L5" id="LID5"&gt;5&lt;/span&gt;
&lt;span rel="#L6" id="LID6"&gt;6&lt;/span&gt;
&lt;span rel="#L7" id="LID7"&gt;7&lt;/span&gt;
&lt;/pre&gt;
          &lt;/td&gt;
          &lt;td width="100%"&gt;
            
              &lt;div class="highlight"&gt;&lt;pre /&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="no"&gt;Rack&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Bug&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/my_sweet_rack_app&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC3"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="no"&gt;MySweetRackApp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC4"&gt;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;&lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC6"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="no"&gt;DenyAccessAndRecordRetinaApp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC7"&gt;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
            
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    
  &lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you are running off of a new enough version of rack, you could also just use Rack::Builder.parse_file&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/testing-a-rackup-configru-file-with-racktest"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/testing-a-rackup-configru-file-with-racktest#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/cWnnRUpTwaE" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/testing-a-rackup-configru-file-with-racktest</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 15 Apr 2010 12:13:49 -0700</pubDate>
      <title>Just making sure it fits before...</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/pmbW-s2HZqI/just-making-sure-it-fits-before</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/just-making-sure-it-fits-before</guid>
      <description>&lt;p&gt;
	&lt;a href='http://posterous.com/getfile/files.posterous.com/timocratic/lCv2qthH4Jg2VGmKLt58iNEN7LUxdXDTkAW5bwhCTVfRUoqsz0aQBYCyhozt/photo.jpg'&gt;&lt;img src="http://posterous.com/getfile/files.posterous.com/timocratic/i56MgY1rG6L1iklTXTqRH9D7ITCPx5wCxGBr4YWmIascqE9lUbmidnKridnj/photo.jpg.scaled.500.jpg" width="500" height="668"/&gt;&lt;/a&gt;

	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/just-making-sure-it-fits-before"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/just-making-sure-it-fits-before#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/pmbW-s2HZqI" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
      <media:content url="http://posterous.com/getfile/files.posterous.com/timocratic/lCv2qthH4Jg2VGmKLt58iNEN7LUxdXDTkAW5bwhCTVfRUoqsz0aQBYCyhozt/photo.jpg" type="image/jpeg" height="800" width="599">
        <media:thumbnail url="http://posterous.com/getfile/files.posterous.com/timocratic/i56MgY1rG6L1iklTXTqRH9D7ITCPx5wCxGBr4YWmIascqE9lUbmidnKridnj/photo.jpg.scaled.500.jpg" height="668" width="500" />
      </media:content>
    <feedburner:origLink>http://posterous.timocracy.com/just-making-sure-it-fits-before</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 13 Apr 2010 12:28:00 -0700</pubDate>
      <title>Beware respond_to format with redirects in shared systems before_filter - DoubleRenderError</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/GW54lPIqFDo/beware-respondto-format-with-redirects-in-sha</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/beware-respondto-format-with-redirects-in-sha</guid>
      <description>&lt;p&gt;
	&lt;p&gt;If you have global before_filters for things like requiring login to access pages (such as in authenticated_system.rb), be careful of missing formats in the respond_to.  I just tracked down a bug on an app where we were getting DoubleRenderErrors because of unauthenticated requests directly against a dynamic csv file.  &lt;p /&gt;We had a before_filter that was denying request and redirecting them to login, in different ways, depending on the format, but hadn't thought to include csv.  In this case, it is wise to include a catch-all at the end using .any&lt;p /&gt;&lt;div class="data syntax type-ruby"&gt;
    
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            
            &lt;pre class="line_numbers"&gt;
&lt;span rel="#L1" id="LID1"&gt;1&lt;/span&gt;
&lt;span rel="#L2" id="LID2"&gt;2&lt;/span&gt;
&lt;span rel="#L3" id="LID3"&gt;3&lt;/span&gt;
&lt;span rel="#L4" id="LID4"&gt;4&lt;/span&gt;
&lt;span rel="#L5" id="LID5"&gt;5&lt;/span&gt;
&lt;span rel="#L6" id="LID6"&gt;6&lt;/span&gt;
&lt;span rel="#L7" id="LID7"&gt;7&lt;/span&gt;
&lt;span rel="#L8" id="LID8"&gt;8&lt;/span&gt;
&lt;span rel="#L9" id="LID9"&gt;9&lt;/span&gt;
&lt;span rel="#L10" id="LID10"&gt;10&lt;/span&gt;
&lt;span rel="#L11" id="LID11"&gt;11&lt;/span&gt;
&lt;span rel="#L12" id="LID12"&gt;12&lt;/span&gt;
&lt;span rel="#L13" id="LID13"&gt;13&lt;/span&gt;
&lt;span rel="#L14" id="LID14"&gt;14&lt;/span&gt;
&lt;span rel="#L15" id="LID15"&gt;15&lt;/span&gt;
&lt;span rel="#L16" id="LID16"&gt;16&lt;/span&gt;
&lt;/pre&gt;
          &lt;/td&gt;
          &lt;td width="100%"&gt;
            
              &lt;div class="highlight"&gt;&lt;pre /&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;anon_access_denied&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;respond_to&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;accepts&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;accepts&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;store_location&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="n"&gt;login_path&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC6"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;accepts&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Status&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;           &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Unauthorized&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC9"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;WWW-Authenticate&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sx"&gt;%(Basic realm=&amp;quot;Web Password&amp;quot;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC10"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:text&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Could&amp;#39;t authenticate you&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:status&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;401 Unauthorized&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC11"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC12"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;accepts&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;js&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;/div&gt;&lt;div class="line" id="LC13"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:update&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;redirect_to&lt;/span&gt; &lt;span class="n"&gt;login_path&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC14"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC15"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC16"&gt;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
            
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    
  &lt;/div&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/beware-respondto-format-with-redirects-in-sha"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/beware-respondto-format-with-redirects-in-sha#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/GW54lPIqFDo" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/beware-respondto-format-with-redirects-in-sha</feedburner:origLink></item>
    <item>
      <pubDate>Sun, 28 Mar 2010 11:51:25 -0700</pubDate>
      <title>Simplicity *does* mean simple, readable methods</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/chqaukOUXUs/simplicity-does-mean-simple-readable-methods</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/simplicity-does-mean-simple-readable-methods</guid>
      <description>&lt;p&gt;
	&lt;div&gt;Following a link from &lt;a href="http://twitter.com/raganwald"&gt;@raganwald&lt;/a&gt; I came across an article where Mike Taylor was debating wether the &lt;a href="http://reprog.wordpress.com/2010/03/28/what-is-simplicity-in-programming-redux/"&gt;concept of simplicity, as it pertains to the length and complexity of methods isn&amp;#39;t subjective&lt;/a&gt;.  He read a decent chunk of Fowler&amp;#39;s Refactoring, found himself disagreeing with the tendency to composable, well named methods, in favor larger methods with the low-level implementation in the method itself, and hoped maybe he was wrong, because the lure of The One True Way is strong.  While I am often a subjectivist, as I told my fiance, &amp;quot;Honey, somebody on the internet is wrong - I must inform them immediately.&amp;quot;&lt;/div&gt; &lt;p /&gt;Basically Mike breaks it down into two approaches: top-down, where the methods are named what they do and abstracted away so you don&amp;#39;t see each step of implementation at the top, and bottom-up, where the main method is a little larger and is built up of the implementation itself.  He favors bottom-up, and I am a partisan of the other camp, as rubyists often seem to be.&lt;p /&gt;&lt;div&gt;I think there is one most important reason to favor the big-picture top-down in this dichotomy.  From top-down you can dive down into the implementation and see the details if you chose, but in bottom-up there is no way to get the equivalent top-down view without just reading and understanding the whole program.  Basically, advocating the bottom up approach is like making world-maps illegal, because you can get a better feel for navigating your hometown with a city-map.&lt;/div&gt; &lt;p /&gt;&lt;div&gt;From this flows the second most important reason, the inability to mentally page out to disk, so to speak, means you have to hold more of the program in your head to understand what is going on.  That means as the program grows in size, it gets harder and harder to keep track of it all.  And the reason this is really a problem, is when it comes time to introduce new people to the code.  By not abstracting things away into bite-sized chunks you&amp;#39;ve just forced them to learn every piece of everything involved to have a hope of understand things enough to actually get any work done.&lt;/div&gt; &lt;p /&gt;&lt;div&gt;A third point: various software engineering theories like: cyclomatic complexity and single-responsibility principle.&lt;/div&gt;&lt;p /&gt;&lt;div&gt;I will admit that getting carried away with classitis and class hierarchies, Java style, has some cost, when it comes to following what a program does.  There is a little balancing act required there.  But, I do think, that decomposing methods is an unequivocal win.  I think Rein&amp;#39;s &lt;a href="http://rubyconf2008.confreaks.com/unfactoring-from-patterns.html"&gt;tongue-in-cheek talk on Unfactoring&lt;/a&gt; is a better visual, code-based proof of the importance of this for maintainability than anything I could whip up here (about 5 minutes in he gets into the examples).&lt;/div&gt; &lt;p /&gt;&lt;div&gt;Lastly, who &lt;b&gt;hasn&amp;#39;t&lt;/b&gt; gone back and looked at their old code and wondered what they were doing?  If you want to go back and tweak something, it&amp;#39;s painful if you have to refigure out &lt;b&gt;every&lt;/b&gt; piece of implementation.  This is a case where scanability and readability is a huge win.&lt;/div&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/simplicity-does-mean-simple-readable-methods"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/simplicity-does-mean-simple-readable-methods#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/chqaukOUXUs" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/simplicity-does-mean-simple-readable-methods</feedburner:origLink></item>
    <item>
      <pubDate>Sat, 06 Mar 2010 14:44:00 -0800</pubDate>
      <title>The trouble with bash colored prompts munging your control-r bash history searches</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/EaFwCzzRI4Q/the-trouble-with-bash-colored-prompts-munging</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/the-trouble-with-bash-colored-prompts-munging</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Basically, you just want to be very careful properly escaping and ending color sequences in your bash prompt. &amp;nbsp;If you mess them up, when you try to use spiffy bash tricks that alter the text on your current input line, such as control-r to search through your bash history and then left of right arrow to edit that line, you'll get a partially overwritten line that is impossible to read or edit properly.&lt;/p&gt;
&lt;p&gt;&lt;div class="data syntax type-bash"&gt;
    
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            
            &lt;pre class="line_numbers"&gt;
&lt;span rel="#L1" id="LID1"&gt;1&lt;/span&gt;
&lt;span rel="#L2" id="LID2"&gt;2&lt;/span&gt;
&lt;span rel="#L3" id="LID3"&gt;3&lt;/span&gt;
&lt;span rel="#L4" id="LID4"&gt;4&lt;/span&gt;
&lt;span rel="#L5" id="LID5"&gt;5&lt;/span&gt;
&lt;span rel="#L6" id="LID6"&gt;6&lt;/span&gt;
&lt;span rel="#L7" id="LID7"&gt;7&lt;/span&gt;
&lt;span rel="#L8" id="LID8"&gt;8&lt;/span&gt;
&lt;span rel="#L9" id="LID9"&gt;9&lt;/span&gt;
&lt;span rel="#L10" id="LID10"&gt;10&lt;/span&gt;
&lt;span rel="#L11" id="LID11"&gt;11&lt;/span&gt;
&lt;/pre&gt;
          &lt;/td&gt;
          &lt;td width="100%"&gt;
            
              &lt;div class="highlight"&gt;&lt;pre /&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="c"&gt;#Just be careful.  Safest to properly end color sequence, so instead of this&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&lt;span class="c"&gt;#export PS1=&amp;quot;\[\033[01;32m\]\u\[\033[00m\]\[\033[01;31m\]\$(git_br)\[\033[01;32m\]\[\033[00m\]:\[\033[01;36m\]\$(git_pwd)\[\033[00m\]\$ &amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC3"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC4"&gt;&lt;span class="c"&gt;#do this&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;&lt;span class="nv"&gt;USER_GREEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\[\e[01;32m\]&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC6"&gt;&lt;span class="c"&gt;#NO_COLOR=&amp;#39;\[\e[00m\]&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC7"&gt;&lt;span class="nv"&gt;REPO_RED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\[\e[01;31m\]&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC8"&gt;&lt;span class="nv"&gt;PATH_BLUE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\[\e[01;36m\]&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC9"&gt;&lt;span class="nv"&gt;END_COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\e[m&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC10"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC11"&gt;&lt;span class="nv"&gt;PS1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;${USER_GREEN}\u${END_COLOR}${REPO_RED}\$(git_br)${END_COLOR}:${PATH_BLUE}\$(git_pwd)${END_COLOR}$ &amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
            
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    
  &lt;/div&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/the-trouble-with-bash-colored-prompts-munging"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/the-trouble-with-bash-colored-prompts-munging#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/EaFwCzzRI4Q" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/the-trouble-with-bash-colored-prompts-munging</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 25 Feb 2010 06:40:00 -0800</pubDate>
      <title>Using open3 in ruby to call an interactive shell command with all 	three pipes while avoiding block</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/J41FzDE55Qs/using-open3-in-ruby-to-call-an-interactive-sh</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/using-open3-in-ruby-to-call-an-interactive-sh</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Apparently when using the three standard pipes (stdin, stdout, stderr) &lt;br /&gt;in your own programming, it is REALLY easy to block or deadlock on &lt;br /&gt;them. At first I figured there were problems in the ruby *open3 &lt;br /&gt;library, but this is not ruby specific, I found message board &lt;br /&gt;discussions about similar problems using perl open3 libraries. &lt;p /&gt; Trying to figure out these quirks is made harder by the fact that all &lt;br /&gt;of the common ruby examples are non-interactive, and just close the &lt;br /&gt;stdin before trying to read any output. Even worse, many, many shell &lt;br /&gt;programs don't use stderr and stdout in what I understood as the &lt;br /&gt;proper way. For instance I first as trying to use ftp as the command, &lt;br /&gt;but this proved beyond my abilities. I then came up with a simple &lt;br /&gt;working example that calls dc (the simple reverse polish calculator &lt;br /&gt;available on most unixes), and discovered that on errors it outputs to &lt;br /&gt;both stderr and stdout (different text). I was not able to in any way &lt;br /&gt;to get the output from stderr until I closed stdin (short of &lt;br /&gt;redirecting stderr to a temp file). &lt;p /&gt; This drives home the point that you shouldn't be doing this too much, &lt;br /&gt;in ruby. Generally, use a better, task-specific ruby library, for &lt;br /&gt;these sort of tasks. If you want to use ftp, use net-ftp, for &lt;br /&gt;instance. If you want to use more extensive interactive shell &lt;br /&gt;sessions, check out &lt;a href="http://github.com/ahoward/session"&gt;Ara Howard's session &lt;br /&gt;gem&lt;/a&gt;&lt;p /&gt; &lt;div class="data syntax type-rb"&gt;
    
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            
            &lt;pre class="line_numbers"&gt;
&lt;span rel="#L1" id="LID1"&gt;1&lt;/span&gt;
&lt;span rel="#L2" id="LID2"&gt;2&lt;/span&gt;
&lt;span rel="#L3" id="LID3"&gt;3&lt;/span&gt;
&lt;span rel="#L4" id="LID4"&gt;4&lt;/span&gt;
&lt;span rel="#L5" id="LID5"&gt;5&lt;/span&gt;
&lt;span rel="#L6" id="LID6"&gt;6&lt;/span&gt;
&lt;span rel="#L7" id="LID7"&gt;7&lt;/span&gt;
&lt;span rel="#L8" id="LID8"&gt;8&lt;/span&gt;
&lt;span rel="#L9" id="LID9"&gt;9&lt;/span&gt;
&lt;span rel="#L10" id="LID10"&gt;10&lt;/span&gt;
&lt;span rel="#L11" id="LID11"&gt;11&lt;/span&gt;
&lt;span rel="#L12" id="LID12"&gt;12&lt;/span&gt;
&lt;span rel="#L13" id="LID13"&gt;13&lt;/span&gt;
&lt;span rel="#L14" id="LID14"&gt;14&lt;/span&gt;
&lt;span rel="#L15" id="LID15"&gt;15&lt;/span&gt;
&lt;span rel="#L16" id="LID16"&gt;16&lt;/span&gt;
&lt;span rel="#L17" id="LID17"&gt;17&lt;/span&gt;
&lt;span rel="#L18" id="LID18"&gt;18&lt;/span&gt;
&lt;span rel="#L19" id="LID19"&gt;19&lt;/span&gt;
&lt;span rel="#L20" id="LID20"&gt;20&lt;/span&gt;
&lt;span rel="#L21" id="LID21"&gt;21&lt;/span&gt;
&lt;span rel="#L22" id="LID22"&gt;22&lt;/span&gt;
&lt;span rel="#L23" id="LID23"&gt;23&lt;/span&gt;
&lt;span rel="#L24" id="LID24"&gt;24&lt;/span&gt;
&lt;span rel="#L25" id="LID25"&gt;25&lt;/span&gt;
&lt;span rel="#L26" id="LID26"&gt;26&lt;/span&gt;
&lt;span rel="#L27" id="LID27"&gt;27&lt;/span&gt;
&lt;span rel="#L28" id="LID28"&gt;28&lt;/span&gt;
&lt;span rel="#L29" id="LID29"&gt;29&lt;/span&gt;
&lt;span rel="#L30" id="LID30"&gt;30&lt;/span&gt;
&lt;span rel="#L31" id="LID31"&gt;31&lt;/span&gt;
&lt;span rel="#L32" id="LID32"&gt;32&lt;/span&gt;
&lt;span rel="#L33" id="LID33"&gt;33&lt;/span&gt;
&lt;span rel="#L34" id="LID34"&gt;34&lt;/span&gt;
&lt;span rel="#L35" id="LID35"&gt;35&lt;/span&gt;
&lt;span rel="#L36" id="LID36"&gt;36&lt;/span&gt;
&lt;span rel="#L37" id="LID37"&gt;37&lt;/span&gt;
&lt;span rel="#L38" id="LID38"&gt;38&lt;/span&gt;
&lt;span rel="#L39" id="LID39"&gt;39&lt;/span&gt;
&lt;/pre&gt;
          &lt;/td&gt;
          &lt;td width="100%"&gt;
            
              &lt;div class="highlight"&gt;&lt;pre /&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="c1"&gt;#http://github.com/ahoward/open4 is an alternative that handles pid and exit status&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&lt;span class="c1"&gt;#http://github.com/ahoward/session a more fleshed our shell utility&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC3"&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;open3&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC4"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;&lt;span class="no"&gt;Open3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;popen3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;dc&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC6"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Thread&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;terr&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;terr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gets&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;stderr: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC9"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC10"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC11"&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC12"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;pushing 5 to stack&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC13"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC14"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;pushing 10 to stack&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC15"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC16"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;pushing + to stack&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC17"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;+&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC18"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;sending print command&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC19"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;p&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC20"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gets&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC21"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;stdout: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC22"&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC23"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;trying an unsupported command&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC24"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;b&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC25"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC26"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC27"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;extra_info_not_in_stderror&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gets&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC28"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;stdout: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;extra_info_not_in_stderror&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC29"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC30"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC31"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;closing stdin to avoid deadlock with stderr&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC32"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC33"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC34"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="c1"&gt;# puts &amp;quot;let&amp;#39;s give stderr a chance to run&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC35"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="c1"&gt;# t.run or sleep 1&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC36"&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC37"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;joining&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC38"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC39"&gt;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
            
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    
  &lt;/div&gt;&lt;p /&gt; *Open3 as a naming convention tends to be a library to call shell &lt;br /&gt;commands with the three aforementioned pipes.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/using-open3-in-ruby-to-call-an-interactive-sh"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/using-open3-in-ruby-to-call-an-interactive-sh#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/J41FzDE55Qs" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/using-open3-in-ruby-to-call-an-interactive-sh</feedburner:origLink></item>
    <item>
      <pubDate>Mon, 15 Feb 2010 23:40:00 -0800</pubDate>
      <title>Call a custom jar from ruby in jruby</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/6q2BLA4MDng/call-a-custom-jar-from-ruby-in-jruby-ruby-tec</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/call-a-custom-jar-from-ruby-in-jruby-ruby-tec</guid>
      <description>&lt;p&gt;
	&lt;p&gt;&lt;div class="data syntax type-rb"&gt;
    
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            
            &lt;pre class="line_numbers"&gt;
&lt;span rel="#L1" id="LID1"&gt;1&lt;/span&gt;
&lt;span rel="#L2" id="LID2"&gt;2&lt;/span&gt;
&lt;span rel="#L3" id="LID3"&gt;3&lt;/span&gt;
&lt;span rel="#L4" id="LID4"&gt;4&lt;/span&gt;
&lt;span rel="#L5" id="LID5"&gt;5&lt;/span&gt;
&lt;span rel="#L6" id="LID6"&gt;6&lt;/span&gt;
&lt;span rel="#L7" id="LID7"&gt;7&lt;/span&gt;
&lt;span rel="#L8" id="LID8"&gt;8&lt;/span&gt;
&lt;span rel="#L9" id="LID9"&gt;9&lt;/span&gt;
&lt;/pre&gt;
          &lt;/td&gt;
          &lt;td width="100%"&gt;
            
              &lt;div class="highlight"&gt;&lt;pre /&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="c1"&gt;#javac HelloWorld.java &amp;amp;&amp;amp; jar cvf HelloWorld.jar HelloWorld.class&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;java&amp;#39;&lt;/span&gt; &lt;/div&gt;&lt;div class="line" id="LC3"&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;HelloWorld.jar&amp;#39;&lt;/span&gt; &lt;/div&gt;&lt;div class="line" id="LC4"&gt;&lt;span class="n"&gt;import&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;HelloWorld&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC6"&gt;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="no"&gt;HelloWorld&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hello&lt;/span&gt; &lt;/div&gt;&lt;div class="line" id="LC7"&gt;&lt;span class="c1"&gt;#=&amp;gt; &amp;quot;Hello cruel world&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC8"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC9"&gt;&lt;span class="c1"&gt;#jruby hello_world.rb&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
            
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    
  &lt;/div&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/call-a-custom-jar-from-ruby-in-jruby-ruby-tec"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/call-a-custom-jar-from-ruby-in-jruby-ruby-tec#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/6q2BLA4MDng" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/call-a-custom-jar-from-ruby-in-jruby-ruby-tec</feedburner:origLink></item>
    <item>
      <pubDate>Sat, 13 Feb 2010 17:57:26 -0800</pubDate>
      <title>Making config.gem in Rails 2.3.x allow you to install from a direct url or the local filesystem</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/1HgFWVL1V9c/making-configgem-in-rails-23x-allow-you-to-in</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/making-configgem-in-rails-23x-allow-you-to-in</guid>
      <description>&lt;p&gt;
	&lt;p&gt;If you are on Rails 2.3.x (pre-Bundler) and want to organize some of your shared functionality into gems, but they are for internal use only, you could set-up a private gem server and point the :source at this server. &amp;nbsp;And then you could deal with authentication, and then...&lt;/p&gt;
&lt;p&gt;Or as a quick hack you could just allow for config.gem to reference the gemfile directly, which would then mean 'rake gems:install' would work, even if the gem were stored locally, or on a file-server, etc. &amp;nbsp;Also useful as you could then just point at a .gem file on github.&lt;/p&gt;
&lt;p&gt;&lt;div class="data syntax type-rb"&gt;
    
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            
            &lt;pre class="line_numbers"&gt;
&lt;span rel="#L1" id="LID1"&gt;1&lt;/span&gt;
&lt;span rel="#L2" id="LID2"&gt;2&lt;/span&gt;
&lt;span rel="#L3" id="LID3"&gt;3&lt;/span&gt;
&lt;span rel="#L4" id="LID4"&gt;4&lt;/span&gt;
&lt;span rel="#L5" id="LID5"&gt;5&lt;/span&gt;
&lt;span rel="#L6" id="LID6"&gt;6&lt;/span&gt;
&lt;span rel="#L7" id="LID7"&gt;7&lt;/span&gt;
&lt;span rel="#L8" id="LID8"&gt;8&lt;/span&gt;
&lt;span rel="#L9" id="LID9"&gt;9&lt;/span&gt;
&lt;span rel="#L10" id="LID10"&gt;10&lt;/span&gt;
&lt;span rel="#L11" id="LID11"&gt;11&lt;/span&gt;
&lt;span rel="#L12" id="LID12"&gt;12&lt;/span&gt;
&lt;span rel="#L13" id="LID13"&gt;13&lt;/span&gt;
&lt;span rel="#L14" id="LID14"&gt;14&lt;/span&gt;
&lt;span rel="#L15" id="LID15"&gt;15&lt;/span&gt;
&lt;span rel="#L16" id="LID16"&gt;16&lt;/span&gt;
&lt;span rel="#L17" id="LID17"&gt;17&lt;/span&gt;
&lt;span rel="#L18" id="LID18"&gt;18&lt;/span&gt;
&lt;span rel="#L19" id="LID19"&gt;19&lt;/span&gt;
&lt;span rel="#L20" id="LID20"&gt;20&lt;/span&gt;
&lt;span rel="#L21" id="LID21"&gt;21&lt;/span&gt;
&lt;span rel="#L22" id="LID22"&gt;22&lt;/span&gt;
&lt;span rel="#L23" id="LID23"&gt;23&lt;/span&gt;
&lt;span rel="#L24" id="LID24"&gt;24&lt;/span&gt;
&lt;/pre&gt;
          &lt;/td&gt;
          &lt;td width="100%"&gt;
            
              &lt;div class="highlight"&gt;&lt;pre /&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="c1"&gt;## require in config/environment.rb before init starts&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&lt;span class="c1"&gt;#require &amp;#39;config/add_explicit_path_to_config_gem&amp;#39;&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC3"&gt;&lt;span class="c1"&gt;#Rails::Initializer.run do |config|&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC4"&gt;&lt;span class="c1"&gt;#config.gem &amp;#39;my_gem&amp;#39;, :version =&amp;gt; &amp;#39;0.0.1&amp;#39;, :explicit_path =&amp;gt; &amp;quot;#{RAILS_ROOT}/vendor/local_gemfiles/my_gem-0.0.1.gem&amp;quot; #or&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;&lt;span class="c1"&gt;#config.gem &amp;#39;my_gem&amp;#39;, :version =&amp;gt; &amp;#39;0.0.1&amp;#39;, :explicit_path =&amp;gt; &amp;quot;http://github.com/myname/myrepo/raw/master/mygem.gem&amp;quot; #or&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC6"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC7"&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Rails&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC8"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GemDependency&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC9"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize_with_explicit_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC10"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="vi"&gt;@explicit_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:explicit_path&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC11"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;initialize_without_explicit_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC12"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC13"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;alias_method_chain&lt;/span&gt; &lt;span class="ss"&gt;:initialize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:explicit_path&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC14"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC15"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="kp"&gt;private&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC16"&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class="line" id="LC17"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;install_command&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC18"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sx"&gt;%w(install)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vi"&gt;@explicit_path&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC19"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;--version&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="sx"&gt;%(&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;requirement&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_s&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sx"&gt;&amp;quot;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;requirement&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC20"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;cmd&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;--source&amp;quot;&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="vi"&gt;@source&lt;/span&gt;  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vi"&gt;@source&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC21"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="n"&gt;cmd&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC22"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC23"&gt;&amp;nbsp;&amp;nbsp;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC24"&gt;&lt;span class="k"&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
            
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    
  &lt;/div&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/making-configgem-in-rails-23x-allow-you-to-in"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/making-configgem-in-rails-23x-allow-you-to-in#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/1HgFWVL1V9c" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/making-configgem-in-rails-23x-allow-you-to-in</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 10 Feb 2010 16:12:00 -0800</pubDate>
      <title>"Object is not missing constant XXX" and "A copy of YYY has been removed from the module tree but is still active" when using Rails metal</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/W_tK8U_LIUo/object-is-not-missing-constant-xxx-and-a-copy</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/object-is-not-missing-constant-xxx-and-a-copy</guid>
      <description>&lt;p&gt;
	&lt;p&gt;If you have a Rails metals that has enough code to have its own subdirectories that live in your Rails load_paths you can get stuck in dependency hell. The combinations of autoloading, rails reloading on development, and running through the metal can intersect in nasty ways: on the first request you get "Object is not missing constant XXX" and subsequent requests kick off "A copy of YYY has been removed from the module tree but is still active."&lt;/p&gt;
&lt;p&gt;The easiest solution is to kill magic reloading for this metal's code by adding the metal's directories of code to the Rails load_once_paths and then using explicit require_dependency calls for any files that give you trouble. For example, I have a MadMetal that referenced a Mad which has a whole sub-directory structure of code that, for now, lives under lib/mad:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#config/environment.rb
config.load_once_paths += Dir["#{RAILS_ROOT}/lib/mad/**/"]

#app/metal/mad_metal.rb
require_dependency 'mad'
class MadMetal
  def self.call(env)
    if (env["PATH_INFO"] == '/the_path_to_my_metal')
      Mad.call(env)
    else
      [404, {"Content-Type" =&amp;gt; "text/html"}, ["Not Found"]]
    end
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And wallah, no more conflicts between development auto-reloading and metal.&lt;/p&gt;
&lt;p&gt;Of course, now you need to restart the server if you change code in lib/mad. In this case it's not a problem for me because the app is also a stand-alone rack app that I run with &lt;a href="http://github.com/rtomayko/shotgun"&gt;shotgun when I want development environment reloading&lt;/a&gt;.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/object-is-not-missing-constant-xxx-and-a-copy"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/object-is-not-missing-constant-xxx-and-a-copy#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/W_tK8U_LIUo" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/object-is-not-missing-constant-xxx-and-a-copy</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 02 Feb 2010 13:57:00 -0800</pubDate>
      <title>Tagging a git release with current branch name and date</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/G3FGhL58kOk/tagging-a-git-release-with-current-branch-nam</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/tagging-a-git-release-with-current-branch-nam</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Either add this to your .git/config&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[alias]
datetag = !git tag `git name-rev --name-only HEAD`-`date \"+%Y%m%d%H%M\"`&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or run it in your project folder to add it to the config for that project:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git config alias.datetag '!git tag `git name-rev --name-only HEAD`-`date "+%Y%m%d%H%M"`'&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then you can just run 'git datetag' to create a new tag to use as a release&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/tagging-a-git-release-with-current-branch-nam"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/tagging-a-git-release-with-current-branch-nam#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/G3FGhL58kOk" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/tagging-a-git-release-with-current-branch-nam</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 02 Feb 2010 01:47:41 -0800</pubDate>
      <title>Setting RAILS_ENV on Dreamhost when running Passenger</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/JV_YCMvazvc/setting-railsenv-on-dreamhost-when-running-pa</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/setting-railsenv-on-dreamhost-when-running-pa</guid>
      <description>&lt;p&gt;
	It may depend on which server you are on, but mine has mod_env &lt;br /&gt;enabled, so it's a simple matter of setting the ENV['RAILS_ROOT'] in &lt;br /&gt;an .htacess file &lt;br /&gt;&lt;pre&gt;&lt;code&gt; &lt;br /&gt;SetEnv RAILS_ENV staging&lt;/code&gt;&lt;/pre&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/setting-railsenv-on-dreamhost-when-running-pa"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/setting-railsenv-on-dreamhost-when-running-pa#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/JV_YCMvazvc" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/setting-railsenv-on-dreamhost-when-running-pa</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 09 Dec 2009 13:26:45 -0800</pubDate>
      <title>http://g.raphaeljs.com/</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/2hlM_QaVanI/httpgraphaeljscom</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/httpgraphaeljscom</guid>
      <description>&lt;p&gt;
	A sweet javascript charting/graphing library. Soon there may be no &lt;br /&gt;need for flash/flex every again?
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/httpgraphaeljscom"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/httpgraphaeljscom#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/2hlM_QaVanI" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/httpgraphaeljscom</feedburner:origLink></item>
    <item>
      <pubDate>Mon, 23 Nov 2009 11:12:00 -0800</pubDate>
      <title>Avoiding some of the negative trade-offs in the template pattern with ruby's dynamicism?</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/YL1n1UcFnuA/avoiding-some-of-the-negative-trade-offs-in-t</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/avoiding-some-of-the-negative-trade-offs-in-t</guid>
      <description>&lt;p&gt;
	&lt;p&gt;So my buddy &lt;a href="http://tammersaleh.com/posts/the-template-pattern-is-underused"&gt;Tammer's recent post about the Gang of Four's Template Pattern&lt;/a&gt; reminded me of some code I saw recently.  A start-up's greenfield project had it's authorization done in a pretty clean way using the template pattern.  Basically every object determined what could be done to it, something like this:&lt;/p&gt;
&lt;p&gt;&lt;script src="http://gist.github.com/241282.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;After continuing this approach to fully cover CRUD you make a straight-forward set of accessors that can be used to easily enforce permissions in the controller in a programmatic way (this project was using on of the inherited resourceful-controller plugins, so that was a big plus).  The developer who implemented this commented that the trade-off for this simplicity was having to look in each individual model file to figure out what a user can do overall.&lt;/p&gt;
&lt;p&gt;I figured I liked everything about this scheme except that trade-off, and since ruby is so dynamic, why settle for almost.  Why not just reopen each class in the authorization file and add the methods.  You still get the simplicity and encapsulation of having the model able to determine it's own permissions, based on it's state and methods, and there is still one place to look to review/change the permissions for the whole project:&lt;/p&gt;
&lt;p&gt;&lt;script src="http://gist.github.com/241288.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;Thoughts?&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/avoiding-some-of-the-negative-trade-offs-in-t"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/avoiding-some-of-the-negative-trade-offs-in-t#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/YL1n1UcFnuA" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://posterous.timocracy.com/avoiding-some-of-the-negative-trade-offs-in-t</feedburner:origLink></item>
    <item>
      <pubDate>Sat, 14 Nov 2009 18:23:41 -0800</pubDate>
      <title>Maus hanging out in bed</title>
      <link>http://feedproxy.google.com/~r/timocracy/~3/Ix2qPwTg-kM/maus-hanging-out-in-bed</link>
      <guid isPermaLink="false">http://posterous.timocracy.com/maus-hanging-out-in-bed</guid>
      <description>&lt;p&gt;
	&lt;a href='http://posterous.com/getfile/files.posterous.com/timocratic/DpkrNiiNaKeCgn75JD1ot3nmBDhsVIdHiRyKU4bSXXL1Wx0WdpfDguX4CJCH/photo.jpg'&gt;&lt;img src="http://posterous.com/getfile/files.posterous.com/timocratic/BFt7XLm3SVJAKiT1Wttf8liZ13p4QXnCr2hnDyBk7JNMKt5ydhKS5xgtboXx/photo.jpg.scaled.500.jpg" width="500" height="667"/&gt;&lt;/a&gt;

	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://posterous.timocracy.com/maus-hanging-out-in-bed"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://posterous.timocracy.com/maus-hanging-out-in-bed#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/Ix2qPwTg-kM" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/268173/3615386840_8daa074da0.jpg</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/36jCZ6DFuhgZ</posterous:profileUrl>
        <posterous:firstName>Tim</posterous:firstName>
        <posterous:lastName>Connor</posterous:lastName>
        <posterous:nickName>timocratic</posterous:nickName>
        <posterous:displayName>Tim Connor</posterous:displayName>
      </posterous:author>
      <media:content url="http://posterous.com/getfile/files.posterous.com/timocratic/DpkrNiiNaKeCgn75JD1ot3nmBDhsVIdHiRyKU4bSXXL1Wx0WdpfDguX4CJCH/photo.jpg" type="image/jpeg" height="800" width="600">
        <media:thumbnail url="http://posterous.com/getfile/files.posterous.com/timocratic/BFt7XLm3SVJAKiT1Wttf8liZ13p4QXnCr2hnDyBk7JNMKt5ydhKS5xgtboXx/photo.jpg.scaled.500.jpg" height="667" width="500" />
      </media:content>
    <feedburner:origLink>http://posterous.timocracy.com/maus-hanging-out-in-bed</feedburner:origLink></item>
  </channel>
</rss>
