<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Jesse Dearing | Looping Infinitely</title>
    <link>http://jessedearing.com</link>
    <description>My name is Jesse Dearing and I am a full-stack developer. This is where I write about stuff that interests me.</description>
    <language>en</language>
    <item>
      <title>DDD Aggregates in Rails with ActiveRecord</title>
      <link>http://jessedearing.com/nodes/16</link>
      <description>&lt;p&gt;In Domain Driven Design there is a concept of an &lt;a href="http://domaindrivendesign.org/node/88"&gt;Aggregate&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;A cluster of associated objects that are treated as a unit for the purpose of data changes. External references are restricted to one member of the Aggregate, designated as the root.&lt;/blockquote&gt;

&lt;p&gt;Simply put: an aggregate has one entity that is designated as the root
and an object of the root's class is what you would manipulate in your code. The other
entities in an aggregate could not stand on their own outside of the
aggregate. It is possible to use the aggregate concept using just ActiveRecord in Rails.&lt;p&gt;
</description>
      <guid>http://jessedearing.com/nodes/16</guid>
    </item>
    <item>
      <title>Top Chef: Cloud Edition</title>
      <link>http://jessedearing.com/nodes/15</link>
      <description>&lt;p&gt;Lately at &lt;a href="http://purecharity.com"&gt;Pure Charity&lt;/a&gt; I&amp;rsquo;ve been using
&lt;a href="http://www.opscode.com/chef/"&gt;Chef&lt;/a&gt; to build our infrastructure on
Amazon&amp;rsquo;s EC2. After using chef for the last few weeks I have come to
fully embrace it and I will never again build a Linux box by hand. I
know that sounds pretty dramatic, but if you build servers (in the cloud
or bare metal) you &lt;strong&gt;NEED&lt;/strong&gt; to do yourself a favor and look at Chef. In
the coming week I&amp;rsquo;m going to write a series of posts about Chef. This
week I&amp;rsquo;m going to explain what Chef is and why it matters.&lt;/p&gt;
</description>
      <guid>http://jessedearing.com/nodes/15</guid>
    </item>
    <item>
      <title>My World Through Vim Colored Glasses</title>
      <link>http://jessedearing.com/nodes/14</link>
      <description>&lt;p&gt;I like &lt;a href="http://vim.org"&gt;Vim&lt;/a&gt;. I like it a lot. I&amp;rsquo;m sure Emacs is good to, but I&amp;rsquo;m flying the Vim flag. I
used to use a Big Enterprise IDE&amp;trade; but I have found that Vim gives me a lot of power without using
all of my memory to run an IDE.&lt;/p&gt; 
 
&lt;p&gt;Through all my years of experience with Vim, I have become more and more proficient with the Vi
keybindings. For example I used to rely on the arrow keys when I started using Vim, but now h/j/k/l have
become my preferred way to navigate. I find myself exiting insert mode more often than not to accomplish
tasks, compared to spending almost all of my time in insert mode.&lt;/p&gt; 
 
&lt;p&gt;With this ever growing proficiency, I find my interactions with everything else&amp;hellip;a bit lacking. My
terminal feels slower, my IRB sessions feel slower, I wanted to be able to use my Vim-fu everywhere.
After some digging and investigating I found ways that I could do it.&lt;/p&gt; 
</description>
      <guid>http://jessedearing.com/nodes/14</guid>
    </item>
    <item>
      <title>Demystifying Ruby&#8217;s case-when Statement</title>
      <link>http://jessedearing.com/nodes/12</link>
      <description>&lt;p&gt;Today I was writing some code to check the type of a method parameter. I opted
to use a case statement for better clarity. To my surprise I was able to simply
pass the name of the class. So this got me thinking about the internals and how
case-when actually works.&lt;/p&gt;

&lt;p&gt;The case-when statement is using the &lt;code&gt;===&lt;/code&gt; method to perform the match in the
when clause of the statement.&lt;/p&gt;

&lt;p&gt;For example, following two pieces of code are equivalent:&lt;/p&gt;
&lt;code&gt;
&lt;pre&gt;
&lt;span class="Conditional"&gt;case&lt;/span&gt; &lt;span class="Number"&gt;1&lt;/span&gt; + &lt;span class="Number"&gt;1&lt;/span&gt;
&lt;span class="Conditional"&gt;when&lt;/span&gt; &lt;span class="Number"&gt;2&lt;/span&gt; &lt;span class="Conditional"&gt;then&lt;/span&gt; puts &lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;win&lt;/span&gt;&lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="Conditional"&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/code&gt;

&lt;code&gt;
&lt;pre&gt;
&lt;span class="Conditional"&gt;if&lt;/span&gt; &lt;span class="Number"&gt;2&lt;/span&gt; === &lt;span class="Number"&gt;1&lt;/span&gt; + &lt;span class="Number"&gt;1&lt;/span&gt;
  puts &lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;win&lt;/span&gt;&lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="Conditional"&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/code&gt;

&lt;p&gt;Take note of the comparison, the &lt;code&gt;when&lt;/code&gt; clause is compared to the &lt;code&gt;case&lt;/code&gt; clause. I
thought it would be the other way around, but this makes sense.&lt;/p&gt;

&lt;p&gt;So to create your own classes that match this condition then you would have to
simply implement the &lt;code&gt;===&lt;/code&gt; method:&lt;/p&gt;
&lt;code&gt;
&lt;pre&gt;
&lt;span class="rubyClass"&gt;class&lt;/span&gt; &lt;span class="Type"&gt;AlwaysMatches&lt;/span&gt;
  &lt;span class="Define"&gt;def&lt;/span&gt; &lt;span class="rubyPseudoVariable"&gt;self&lt;/span&gt;.&lt;span class="rubyFunction"&gt;===&lt;/span&gt;(value)
    &lt;span class="Boolean"&gt;true&lt;/span&gt;
  &lt;span class="Define"&gt;end&lt;/span&gt;
&lt;span class="rubyClass"&gt;end&lt;/span&gt;

&lt;span class="Conditional"&gt;case&lt;/span&gt; &lt;span class="rubySymbol"&gt;:something_crazy&lt;/span&gt;
&lt;span class="Conditional"&gt;when&lt;/span&gt; &lt;span class="rubyRegexpDelimiter"&gt;/&lt;/span&gt;&lt;span class="Special"&gt;\w&lt;/span&gt;&lt;span class="Special"&gt;+&lt;/span&gt;&lt;span class="rubyRegexp"&gt;_sane&lt;/span&gt;&lt;span class="Special"&gt;$&lt;/span&gt;&lt;span class="rubyRegexpDelimiter"&gt;/&lt;/span&gt; &lt;span class="Conditional"&gt;then&lt;/span&gt; &lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;this won't match&lt;/span&gt;&lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="Conditional"&gt;when&lt;/span&gt; &lt;span class="Type"&gt;String&lt;/span&gt; &lt;span class="Conditional"&gt;then&lt;/span&gt; &lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;this won't match either&lt;/span&gt;&lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="Conditional"&gt;when&lt;/span&gt; &lt;span class="Type"&gt;AlwaysMatches&lt;/span&gt; &lt;span class="Conditional"&gt;then&lt;/span&gt; &lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;Game...Set...&lt;/span&gt;&lt;span class="rubyStringDelimiter"&gt;&amp;quot;&lt;/span&gt;

&lt;span class="Comment"&gt;# =&amp;gt; &amp;quot;Game...Set...&amp;quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/code&gt;

&lt;p&gt;This class will always return true when compared in a case-when but if compared
in an &lt;code&gt;if&lt;/code&gt; statement with an equality operator will return false unless compared
with itself.&lt;/p&gt;

&lt;p&gt;The potential usage I see for this is if you have written a class that can
compare with Ruby&amp;rsquo;s primitive types.&lt;/p&gt;</description>
      <guid>http://jessedearing.com/nodes/12</guid>
    </item>
    <item>
      <title>Setting up Wildcard Subdomains on OS X 10.6</title>
      <link>http://jessedearing.com/nodes/9</link>
      <description>&lt;p&gt;The new trend in web applications is to have your customers name or account code in the URL as a
subdomain. Like in &lt;a href="http://www.37signals.com" target="_blank"&gt;37 Signals&lt;/a&gt; &lt;a href="http://campfirenow.com" target="_blank"&gt;Campfire&lt;/a&gt; web
application the URLs look like: myaccount.campfirenow.com. This is pretty cool because is gives your
customers a little bit of customization and it is one less thing that you have to maintain in your
session state store. It makes development a real beating though because most of the time you have to
maintain a set of accounts in your /etc/hosts file. I&amp;rsquo;m going to walk you through getting all the
subdomains you want with a little upfront configuration.&lt;/p&gt;

&lt;p&gt;I know that the Passenger PrefPane and other solutions like &lt;a href="http://pow.cx" target="_blank"&gt;Pow&lt;/a&gt; handle this for you, but I prefer to run the same server for development that I will be running in production and I currently use &lt;a href="http://unicorn.bogomips.org/" target="_blank"&gt;Unicorn&lt;/a&gt; on all my production apps. I won't go into setting up Unicorn, but I just set up the standard Nginx reverse proxy to Unicorn configuration.&lt;/p&gt;
</description>
      <guid>http://jessedearing.com/nodes/9</guid>
    </item>
  </channel>
</rss>

