<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.refactormycode.com,2007:users1596</id>
  <link type="application/atom+xml" href="http://www.refactormycode.com/users/1596" rel="self"/>
  <title>carlpelletier.myopenid.com</title>
  <updated>Mon Jul 27 17:45:14 -0700 2009</updated>
  <entry>
    <id>tag:www.refactormycode.com,2007:Code970</id>
    <published>2009-07-27T17:45:14-07:00</published>
    <updated>2009-09-09T19:31:27-07:00</updated>
    <title>[Bash] How to quiclky change this bash command</title>
    <content type="html">&lt;p&gt;I looking for a quick easy way to change this command. I would like to use the !! command with bash to put the -i at the correct place:&lt;/p&gt;

&lt;pre&gt;#This is the error command
egrep &amp;quot;smtp&amp;quot; -i ./production.log

#Would like to correct it with !! to have this: (whitout taping it again)
egrep -i &amp;quot;smtp&amp;quot; ./production.log&lt;/pre&gt;</content>
    <author>
      <name>carlpelletier.myopenid.com</name>
      <email>carlpelletier@me.com</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/970-how-to-quiclky-change-this-bash-command" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor218738</id>
    <published>2009-07-23T16:49:26-07:00</published>
    <title>[Ruby] On Add 1- in front of a number</title>
    <content type="html">&lt;p&gt;Thanks all, andyjeffries your code is not working. Dont known why? This code work:&lt;/p&gt;

&lt;pre&gt;##ruby
def toll_free_dealer_phone(phone)
  phone.gsub(/(^.*)(866|877|888)/, '1-\1\2')
end&lt;/pre&gt;</content>
    <author>
      <name>carlpelletier.myopenid.com</name>
      <email>carlpelletier@me.com</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/960-add-1-in-front-of-a-number/refactors/218738" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Code960</id>
    <published>2009-07-20T19:11:33-07:00</published>
    <updated>2010-10-28T01:45:04-07:00</updated>
    <title>[Ruby] Add 1- in front of a number</title>
    <content type="html">&lt;p&gt;I need to build a helper method that will add a 1- in front of a toll free number if that number begin with 866, 877 or 888. This is my helper method. Wondering if you have better implementation?&lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;

&lt;pre&gt;def toll_free_dealer_phone(phone)
    formated_phone = phone
    area_code_supported = %w( 866 877 888)
    area_code_supported.each do |area|
      if phone.include?(area)
        formated_phone =  &amp;quot;1-#{phone}&amp;quot;
      end
    end
    return formated_phone
  end
&lt;/pre&gt;</content>
    <author>
      <name>carlpelletier.myopenid.com</name>
      <email>carlpelletier@me.com</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/960-add-1-in-front-of-a-number" rel="alternate"/>
  </entry>
</feed>

