<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Rian Rainey | Software Engineer | Nashville | Ruby/iOS/Javascript</title>
    <description>Rian Rainey is a software engineer in Nashville, Tennessee. He specializes in Ruby, Rails, HTML/CSS/JS and iOS.</description>
    <link>http://www.rian.me/</link>
    <atom:link href="http://www.rian.me/feed.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>Replace Codekit with Grunt</title>
        <description>&lt;p&gt;At &lt;a href=&quot;http://www.centresource.com&quot;&gt;Centresource&lt;/a&gt;, we’ve been using
&lt;a href=&quot;http://incident57.com/codekit/&quot;&gt;Codekit&lt;/a&gt; for the majority of our
projects for over a year now. Codekit is a Mac desktop application that provides
a nice UI to help concatenate, minify and otherwise optimize your
javascript and SASS files. In our entire workflow, this is the only
non open-source piece of software we use.&lt;/p&gt;

&lt;p&gt;For our Rails projects, this isn’t a problem because the asset pipeline
does this for us. We use Codekit primarily for our Wordpress and Drupal
projects.&lt;/p&gt;

&lt;h3 id=&quot;why-codekit-is-bad&quot;&gt;Why Codekit Is Bad&lt;/h3&gt;

&lt;p&gt;Don’t get me wrong, Codekit is great if you are new to SASS and/or
Coffeescript and you are in need of a tool the processes and optimizes
the output. But once you feel comfortable taking the training wheels
off, you should be looking for the best practice when it comes to
this part of your dev workflow. The following reasons why Codekit is a
bad practice will make sense to you:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;A contributing developer will need to have Codekit watching their
code to prevent superfluous changes to your JS or SASS.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;It’s a proprietary piece of software in an otherwise open-source
codebase. Why use it if there are equal or better, free alternatives?&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;It assumes all developers will be using a Mac OS.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;why-gruntjs-is-a-good-solution-to-codekit&quot;&gt;Why GruntJS Is A Good Solution to Codekit&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;It’s the hot thing right now. Check out the &lt;a href=&quot;http:yeoman.io&quot;&gt;Yeoman&lt;/a&gt;
workflow.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;It’s free.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The open-source natures makes it customizable with tons of
&lt;a href=&quot;http://gruntjs.com/plugins&quot;&gt;plugins&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;how-to-use-gruntjs-with-wordpress&quot;&gt;How To Use GruntJS With Wordpress&lt;/h3&gt;

&lt;p&gt;Below is a basic run down of steps, but I recommend the &lt;a href=&quot;http://gruntjs.com/getting-started&quot;&gt;GruntJS Getting
Started documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
npm install grunt-cli -g #install the Grunt Command Line Interface globally
cd ./path/to/your/app
npm init #create package.json file. Defaults are adequate. We&#39;ll change things later.
npm install grunt-contrib-sass --save-dev #add SASS preprocessor
npm install grunt-contrib-watch --save-dev #add ability to run GruntJS anytime there is a change to your app
npm install node-bourbon --save-dev #for ability to @import &quot;bourbon&quot; in your SASS file.
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gist.github.com/rianrainey/7443208&quot;&gt;Download my recommended
Gruntfile.js&lt;/a&gt;. Be sure to
change the source and destination paths for the Uglify build parameters
for what is specific to your Wordpress application.&lt;/p&gt;

&lt;p&gt;Refrences:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/lacroixdesign/node-bourbon&quot;&gt;Node Bourbon&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://gruntjs.com/getting-started&quot;&gt;GruntJS Getting Started Guide&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yeoman.io/&quot;&gt;Yeoman&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Tue, 12 Nov 2013 19:24:00 +0000</pubDate>
        <link>http://www.rian.me/2013/11/12/replace-codekit-with-grunt/</link>
        <guid isPermaLink="true">http://www.rian.me/2013/11/12/replace-codekit-with-grunt/</guid>
      </item>
    
      <item>
        <title>Waking Up Early</title>
        <description>&lt;p&gt;Today, I’m giving “Becoming A Morning Person” another chance to be a
habit in my life. I recently read an article on
&lt;a href=&quot;http://99u.com/workbook/19887/labrat-become-a-morning-person&quot;&gt;99U&lt;/a&gt; that
encourgaged readers to wake up early in an effort to be more productive
and happy. I decided to join this movement. I spoke so much about this
that my wife decided to do day 1 with me too. You can follow more of the
movement with the hastag,
&lt;a href=&quot;http://twitter.com/#labrat&quot;&gt;#labrat&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here was my schedule for night/day 1:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;9:30pm&lt;/strong&gt; - Start getting ready for bed&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;9:45pm&lt;/strong&gt; - Roughly list items to do at 6am&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;10:00pm&lt;/strong&gt; - Go to sleep&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;6:00am&lt;/strong&gt; - Attempt to wake up. Reset alarm to 6:30am.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;6:30am&lt;/strong&gt; - Convince my wife to get up with me since she requested that
encouragement.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;6:45am&lt;/strong&gt; - With coffee in hand, I read my text messages and found my brother
wanted me to listen to his recent podcast episode. So, I derailed once again from my to
do list and listened to the podcast.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;7:00am&lt;/strong&gt; - Convince my wife to let me go upstairs where I could be alone
to journal for 1/2 hour.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;7:15am&lt;/strong&gt; - Journaling results in getting motivated to do work. So I stop
journaling early to start coding. My email is open so I’m getting
inundated with auto-generated subscription emails. Responded to a few
emails and then promptly closed it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;7:30am&lt;/strong&gt; - Coding results in me debugging my Octopress blog install for
the next 1.5 hours before I really need to start doing some real,
“pay-the-bills”, work.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;takeaways&quot;&gt;Takeaways&lt;/h2&gt;

&lt;p&gt;I set out to do tons of work in the morning but didn’t get nearly as
much done as I wanted. It was a good start to the “morning person”
routine, I believe. &lt;/p&gt;

&lt;p&gt;Things I want to do better tomorrow:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Wake up at 6am. No snoozing.&lt;/li&gt;
  &lt;li&gt;Don’t read email, text messages, Twitter, or Instagram before 9am.&lt;/li&gt;
  &lt;li&gt;Set out to accomplish only 1 thing in the morning instead of
attempting to do many things.&lt;/li&gt;
  &lt;li&gt;Keep journaling in my morning routine.&lt;/li&gt;
  &lt;li&gt;Make sure my wife has tasks to accomplish so I’m free to work :)&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Mon, 11 Nov 2013 07:58:00 +0000</pubDate>
        <link>http://www.rian.me/2013/11/11/waking-up-early/</link>
        <guid isPermaLink="true">http://www.rian.me/2013/11/11/waking-up-early/</guid>
      </item>
    
      <item>
        <title>What is the difference between &#39;===&#39;, &#39;==&#39;, &#39;.equal?&#39; and &#39;.eql?&#39; in Ruby?</title>
        <description>&lt;p&gt;My years of programming have taking me along the lines of
learning Java in college, to PHP as a CMS hacker and now to Ruby. I was
recently going through an exercise in
&lt;a href=&quot;http://www.exercism.io&quot;&gt;Exercism.io&lt;/a&gt; and while somebody was
“nitpicking” my code, they mentioned that I probably didn’t need the &lt;code&gt;===&lt;/code&gt; in my
code. My code was making sure two variables were of the same type and
value. It looked a little like this:&lt;/p&gt;

&lt;p&gt;``` ruby
# Bad - my original code
variableA === variableB&lt;/p&gt;

&lt;h1 id=&quot;good---my-new-code&quot;&gt;Good - my new code&lt;/h1&gt;
&lt;p&gt;variableA == variableB
```&lt;/p&gt;

&lt;p&gt;My nitpicker mentioned that I only needed &lt;code&gt;==&lt;/code&gt;. But since I came from
the recent world of PHP, I was confused why I shouldn’t use &lt;code&gt;===&lt;/code&gt;. In
PHP, the double equals just checks for the same value and disregards
type. In Ruby, it’s a whole different story.&lt;/p&gt;

&lt;p&gt;I discovered it had to do with the fact that everything in Ruby is an
object and different objects can have different definitions for equality
(same goes for all object orient languages). Ruby’s Object class has &lt;code&gt;===&lt;/code&gt;, &lt;code&gt;.equal?&lt;/code&gt;,
and &lt;code&gt;.eql?&lt;/code&gt; by default. Many times Ruby classes override &lt;code&gt;==&lt;/code&gt; but &lt;code&gt;.equal?&lt;/code&gt; &lt;strong&gt;should never be overriden&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;what-is-the-&quot;&gt;What is the ‘==’?&lt;/h3&gt;

&lt;p&gt;At the Ruby Object level, &lt;code&gt;==&lt;/code&gt; returns true only if the two compared
entities are the same object. Typically this is overriden in descendant
classes. You’ll want to use this method if your object implements this. &lt;/p&gt;

&lt;p&gt;If you are looking for generic equality,
consider using, &lt;code&gt;.eql?&lt;/code&gt;. You should look at your particular Ruby
object in question to see how they implemented &lt;code&gt;==&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;what-is-the--1&quot;&gt;What is the ‘===’?&lt;/h3&gt;

&lt;h4 id=&quot;is-the-case-equality-operator-case-subsumption-operator&quot;&gt;&lt;code&gt;===&lt;/code&gt; is the Case Equality Operator (Case Subsumption Operator)&lt;/h4&gt;

&lt;p&gt;The best answer I found was the Subsumption Operator answers the
question, “If I have a drawer labeled ‘a’ would it make sense to put ‘b’ in that drawer?”&lt;/p&gt;

&lt;p&gt;```
(1..5) === 3           # =&amp;gt; true
(1..5) === 6           # =&amp;gt; false&lt;/p&gt;

&lt;p&gt;Integer === 42          # =&amp;gt; true
Integer === ‘fourtytwo’ # =&amp;gt; false
```&lt;/p&gt;

&lt;h3 id=&quot;what-is-the-eql&quot;&gt;What is the ‘.eql?’&lt;/h3&gt;

&lt;p&gt;A good synonym phrase would be ‘Generic Equality’. &lt;strong&gt;The eql? method returns true if obj and other have the same value.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.eql?&lt;/code&gt; method returns &lt;code&gt;true&lt;/code&gt; if both objects in question return the
same hash key. This is used by Hash to test members for equality. For objects of class Object,
&lt;code&gt;eql?&lt;/code&gt; is synonymous with ==.&lt;/p&gt;

&lt;p&gt;Subclasses normally continue this tradition, but there are exceptions. Numeric types, for example, perform type conversion across ==, but not across eql?, so:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
1 == 1.0     #=&amp;gt; true
1.eql? 1.0   #=&amp;gt; false
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The Ruby Documentation explains &lt;code&gt;==&lt;/code&gt; well:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;At the Object level, &lt;code&gt;==&lt;/code&gt; returns true only if obj and other are the same object.
Typically, this method is overridden in descendant classes to provide class-specific
meaning.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;what-is-the-equal---determines-object-identitfy&quot;&gt;What is the ‘.equal?’ - determines object identitfy&lt;/h3&gt;

&lt;p&gt;This is effectively pointer comparison. “Is this the &lt;em&gt;exact&lt;/em&gt; same
object?”&lt;/p&gt;

&lt;h3 id=&quot;tldr&quot;&gt;tldr;&lt;/h3&gt;

&lt;p&gt;Equality in Ruby is confusing. You’ll want to be informed when using it
and make sure you have an effective test suite.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;==&lt;/code&gt; is overriden on a per class basis. Usually you’ll
want to use the class’s implementation of equals.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;===&lt;/code&gt; answers the question “If I have a drawer labeled ‘a’, would it
make sense to put ‘b’ in that drawer?”. You don’t use this as often.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.equal?&lt;/code&gt; should never be overriden by a subclass.&lt;/p&gt;

&lt;p&gt;```
a = “a”         # =&amp;gt; “a”
other = a.dup   # =&amp;gt; “a”&lt;/p&gt;

&lt;p&gt;a == other      # =&amp;gt; true
a === other     # =&amp;gt; true
a.eql? other    # =&amp;gt; true
a.equal? other  # =&amp;gt; false
```&lt;/p&gt;

&lt;h4 id=&quot;resources&quot;&gt;Resources&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;http://ruby-doc.org/core-2.0.0/Object.html&quot;&gt;Ruby Object Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://ruby-doc.org/core-2.0.0/String.html#method-i-3D-3D-3D&quot;&gt;Ruby String === Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/a/4467823/652200&quot;&gt;Stack Overflow 1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/a/7157051/652200&quot;&gt;Stack Overflow 2&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Tue, 15 Oct 2013 19:02:00 +0000</pubDate>
        <link>http://www.rian.me/2013/10/15/what-is-the-difference-between-equals-equals-equals-and-equals-equals-in-ruby/</link>
        <guid isPermaLink="true">http://www.rian.me/2013/10/15/what-is-the-difference-between-equals-equals-equals-and-equals-equals-in-ruby/</guid>
      </item>
    
      <item>
        <title>How To Find A File Using Unix&#39;s Find</title>
        <description>&lt;p&gt;Whenever I need to find text within a file, I use
&lt;a href=&quot;http://www.beyondgrep.com&quot;&gt;Ack&lt;/a&gt;. However, when I need to find where a
particular file is and I know the name of the file, there is nothing
better than using &lt;code&gt;find&lt;/code&gt;. What the below command is doing is finding, in
the current directory, by name, the file, &lt;code&gt;deploy.yml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
find . -name deploy.yml
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For information, check out &lt;code&gt;man find&lt;/code&gt;. I’m still making a more conserted
effort to read and more easily interpret Man pages.&lt;/p&gt;
</description>
        <pubDate>Thu, 03 Oct 2013 09:39:00 +0000</pubDate>
        <link>http://www.rian.me/2013/10/03/how-to-find-a-file-using-unix-slash-s-find/</link>
        <guid isPermaLink="true">http://www.rian.me/2013/10/03/how-to-find-a-file-using-unix-slash-s-find/</guid>
      </item>
    
  </channel>
</rss>
