<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">

 <title>Marcelo Silveira</title>
 
 <link href="http://mhfs.com.br/" />
 <updated>2012-05-20T14:53:11+00:00</updated>
 <id>http://mhfs.com.br/</id>
 <author>
   <name>Marcelo Silveira</name>
   <email>grande@gmail.com</email>
 </author>

 
 <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/mhfs" /><feedburner:info uri="mhfs" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
   <title>devise-async: Send devise emails in background</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/KWBOZwC04zE/devise-async-send-devise-emails-background.html" />
   <updated>2012-05-15T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2012/05/15/devise-async-send-devise-emails-background</id>
   <content type="html">&lt;p&gt;If you ever had to direct Devise email notifications to be send asynchronously you know it&amp;#8217;s usualy a process that involves some degree of monkey patching.&lt;/p&gt;

&lt;p&gt;This week I got tired of repeating this app after app and decided to create a small gem to solve the issue.&lt;/p&gt;

&lt;p&gt;I just released &lt;a href='https://github.com/mhfs/devise-async'&gt;devise-async&lt;/a&gt;. It lets you easily setup devise to use a proxy mailer that is capable of sending devise&amp;#8217;s emails via your preferred queueing backend. It currently supports Resque (default), Sidekiq and Delayed::Job.&lt;/p&gt;

&lt;p&gt;To use it you just need to tell devise to use &lt;code&gt;Devise::Async::Proxy&lt;/code&gt; as its mailer class.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='n'&gt;config&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;mailer&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='s2'&gt;&amp;quot;Devise::Async::Proxy&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;If you use Sidekiq or Delayed::Job you also need to let DeviseAsync knows your taste in config/initializers/devise_async.rb. Don&amp;#8217;t botter if you use Resque since it&amp;#8217;s the default backend.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='no'&gt;Devise&lt;/span&gt;&lt;span class='o'&gt;::&lt;/span&gt;&lt;span class='no'&gt;Async&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;backend&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='ss'&gt;:resque&lt;/span&gt;
&lt;span class='no'&gt;Devise&lt;/span&gt;&lt;span class='o'&gt;::&lt;/span&gt;&lt;span class='no'&gt;Async&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;backend&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='ss'&gt;:sidekiq&lt;/span&gt;
&lt;span class='no'&gt;Devise&lt;/span&gt;&lt;span class='o'&gt;::&lt;/span&gt;&lt;span class='no'&gt;Async&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;backend&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='ss'&gt;:delayed_job&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Check out the &lt;a href='https://github.com/mhfs/devise-async#devise-async'&gt;README&lt;/a&gt; for more details.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

&lt;p&gt;UPDATE: updated classes for new version&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/KWBOZwC04zE" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2012/05/15/devise-async-send-devise-emails-background.html</feedburner:origLink></entry>
 
 <entry>
   <title>Sandboxed SSH Login for Remote Pairing</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/W_zDqsHEeEs/osx-sandboxed-ssh-remote-pairing.html" />
   <updated>2012-05-14T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2012/05/14/osx-sandboxed-ssh-remote-pairing</id>
   <content type="html">&lt;p&gt;Today I needed to configure my personal machine for some VIM pairing and wanted to make the SSH connection restrictive in a way that the only thing my pair can do is get into a tmux section I create.&lt;/p&gt;

&lt;p&gt;This article is a step-by-step guide on how I did it.&lt;/p&gt;

&lt;h3 id='sshd_config'&gt;SSHD Config&lt;/h3&gt;

&lt;h4 id='enable_remote_login_on_the_sharing_pane_of_system_preferences'&gt;Enable &amp;#8220;Remote Login&amp;#8221; on the &amp;#8220;Sharing&amp;#8221; pane of System Preferences.&lt;/h4&gt;

&lt;p&gt;The first thing we need to do is let the user ssh to your machine.&lt;/p&gt;

&lt;p&gt;&lt;img src='/assets/remote_login.jpg' alt='enable remote login' /&gt;&lt;/p&gt;

&lt;h4 id='change_default_sshd_port_optional'&gt;Change default SSHD port (Optional)&lt;/h4&gt;

&lt;p&gt;If you don&amp;#8217;t want (or your ISP blocks) port 22, make the following change to &lt;code&gt;/System/Library/LaunchDaemons/ssh.plist&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src='/assets/ssh_port.jpg' alt='sshd_config change' /&gt;&lt;/p&gt;

&lt;p&gt;And restart the daemon:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;launchctl stop com.openssh.sshd
launchctl start com.openssh.sshd&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id='user_creation'&gt;User Creation&lt;/h3&gt;

&lt;p&gt;Create a regular user on the &amp;#8220;Users &amp;amp; Groups&amp;#8221; pane of System Preferences. We&amp;#8217;ll assume a &amp;#8220;johndoe&amp;#8221; login name for the rest of this tutorial.&lt;/p&gt;

&lt;h3 id='setup_restrictions'&gt;Setup Restrictions&lt;/h3&gt;

&lt;p&gt;Now we need to protect the system commands from execution by that user.&lt;/p&gt;

&lt;p&gt;As root, cd into &lt;code&gt;/Users/johndoe&lt;/code&gt; and create the following files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/.bashrc&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#Resticted Shell
set -r&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;~/.bash_profile&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# remove global environment
/usr/bin/env -

# set restricted path
PATH=/Users/johndoe/bin

# local bashrc sets restricted shell
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs
export PATH
unset USERNAME&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will basically keep the user far from any system commands.&lt;/p&gt;

&lt;p&gt;Next let&amp;#8217;s be sure he doesn&amp;#8217;t have write permission or own his home files:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;chown root:staff *
chmod -R -w /Users/johndoe&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now is a good time to login with the user you created and check if everything is unavailable (play around with cd, ls, etc).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh johndoe@localhost -p 22022&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note: adjust the &lt;code&gt;-p&lt;/code&gt; option according to your port choice. Default is 22.&lt;/p&gt;

&lt;h3 id='setup_allowed_commands'&gt;Setup Allowed Commands&lt;/h3&gt;

&lt;p&gt;Finally we need to make some commands available for the guest user. Everything in &lt;code&gt;/Users/johndoe/bin&lt;/code&gt; will be available for execution so be free to create as much links/scripts as you want:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /Users/johndoe/bin
ln -s /usr/bin/clear
ln -s /usr/bin/tmux&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note: these are just examples, adjust to your paths.&lt;/p&gt;

&lt;h3 id='pairing_with__and_vim'&gt;Pairing with &lt;code&gt;tmux&lt;/code&gt; and VIM&lt;/h3&gt;

&lt;p&gt;Now with your regular user create a &lt;code&gt;tmux&lt;/code&gt; session and invite your pair to ssh as the guest user you created. Once in, he&amp;#8217;ll be able to attach to your &lt;code&gt;tmux&lt;/code&gt; session.&lt;/p&gt;

&lt;p&gt;If you don&amp;#8217;t have &lt;code&gt;tmux&lt;/code&gt; installed, I recommend installing it using Homebrew.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;brew install tmux&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you are not familiar with &lt;code&gt;tmux&lt;/code&gt; I recommend this article for a quick introduction:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/
http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Happy (sandboxed) pairing.&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/W_zDqsHEeEs" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2012/05/14/osx-sandboxed-ssh-remote-pairing.html</feedburner:origLink></entry>
 
 <entry>
   <title>Git tag management</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/CG00zxNK4EQ/git-tag-management.html" />
   <updated>2011-04-28T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2011/04/28/git-tag-management</id>
   <content type="html">&lt;p&gt;Today I needed to manage some git tags for the first time and want to share how to do it.&lt;/p&gt;
&lt;p&gt;Create a tag:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;git tag &lt;span class="s2"&gt;&amp;quot;v0.0.1&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Push the tag to GitHub:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;git push origin --tags
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;In case you need to remove the tag:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="c"&gt;# delete local tag&lt;/span&gt;
git tag -d &lt;span class="s2"&gt;&amp;quot;0.0.1&amp;quot;&lt;/span&gt;

&lt;span class="c"&gt;# delete remote tag&lt;/span&gt;
git push origin :refs/tags/0.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/CG00zxNK4EQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2011/04/28/git-tag-management.html</feedburner:origLink></entry>
 
 <entry>
   <title>Setting Ubuntu wireless network via terminal</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/tbJr_RfixzE/setting-ubuntu-server-wireless-manually.html" />
   <updated>2010-12-16T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/12/16/setting-ubuntu-server-wireless-manually</id>
   <content type="html">&lt;p&gt;I have an old laptop that I use as a home server. I wanted to move it away from my workstation and that also means moving it away from the internet router. In other words, I had to setup the wireless connection without any visual assistent.&lt;/p&gt;
&lt;p&gt;Turns out it wasn&amp;#8217;t that difficult. For a WPA2/&lt;span class="caps"&gt;AES&lt;/span&gt; wireless connection place this into your &lt;code&gt;/etc/network/interfaces&lt;/code&gt; file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;auto wlan0
iface wlan0 inet static
  address 192.168.1.10
  gateway 192.168.1.1
  dns-nameservers 192.168.1.1
  netmask 255.255.255.0
  wpa-ssid &amp;lt;NETWORK_NAME&amp;gt;
  wpa-ap-scan 2
  wpa-proto RSN
  wpa-pairwise AES
  wpa-group AES
  wpa-key-mgmt WPA-PSK
  wpa-psk &amp;lt;ASCII_ACCESS_KEY&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;If you want &lt;span class="caps"&gt;DHCP&lt;/span&gt; instead of a static address go with this.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;auto wlan0
iface wlan0 inet dhcp
  wpa-ssid &amp;lt;NETWORK_NAME&amp;gt;
  wpa-ap-scan 2
  wpa-proto RSN
  wpa-pairwise AES
  wpa-group AES
  wpa-key-mgmt WPA-PSK
  wpa-psk &amp;lt;ASCII_ACCESS_KEY&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Then just run &lt;code&gt;sudo /etc/init.d/networking restart&lt;/code&gt; and you should be good.&lt;/p&gt;
&lt;p&gt;Note: This assumes you have your wireless card working with its kernel module on. You can check it out with lspci and lsmod.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/tbJr_RfixzE" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/12/16/setting-ubuntu-server-wireless-manually.html</feedburner:origLink></entry>
 
 <entry>
   <title>Slides from my talk at semcomp13</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/ay_8aabPXlY/slides-from-my-talk-at-semcomp13.html" />
   <updated>2010-09-21T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/09/21/slides-from-my-talk-at-semcomp13</id>
   <content type="html">&lt;p&gt;Here are the slides (in portuguese) from my talk at semcomp13 at &lt;span class="caps"&gt;USP&lt;/span&gt; São Carlos yesterday.&lt;/p&gt;
&lt;p&gt;You can download the &lt;a href="http://mhfs.com.br/assets/37865302-Familiar-Grande-Propria-ou-Freelancer.pdf"&gt;&lt;span class="caps"&gt;PDF&lt;/span&gt; here&lt;/a&gt; or view it directly on &lt;a href="http://www.scribd.com/doc/37865302/Familiar-Grande-Propria-ou-Freelancer"&gt;Scribd&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Thanks to all who attended and feel free to contact me for anything. It&amp;#8217;s always a pleasure to talk.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Update: fixed the direct download link.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/ay_8aabPXlY" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/09/21/slides-from-my-talk-at-semcomp13.html</feedburner:origLink></entry>
 
 <entry>
   <title>Make up excuses to learn</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/tIwU3dbHUGU/make-up-excuses-to-learn.html" />
   <updated>2010-07-28T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/07/28/make-up-excuses-to-learn</id>
   <content type="html">&lt;p&gt;I love to study and play with new stuff. I really enjoy this but there&amp;#8217;s something that bothers me. My studies rarely result in something useful.&lt;/p&gt;
&lt;p&gt;Some weeks ago I was watching one of &lt;a href="http://gilesbowkett.blogspot.com/"&gt;Giles Bowkett&amp;#8217;s&lt;/a&gt; screencasts and got caught by a goal he imposed himself some years ago: create a new app every month. Although that seemed a little too much for my available time, the thought itself kept coming back to my mind.&lt;/p&gt;
&lt;p&gt;A few days later I was in trouble to sleep and started thinking about something to do with those hours. I knew I&amp;#8217;d like to play with Sinatra and explore Selenium usage via Capybara but I decided I wouldn&amp;#8217;t do it without concrete outcomes.&lt;/p&gt;
&lt;p&gt;I ended up starting the development of a &lt;a href="http://cpfcnpj.mhfs.com.br/"&gt;&lt;span class="caps"&gt;CPF&lt;/span&gt; and &lt;span class="caps"&gt;CNPJ&lt;/span&gt; generator&lt;/a&gt; which, even though there are dozens out there in the internet and is not very creative, is being useful for me when testing my apps.&lt;/p&gt;
&lt;p&gt;Habit changes are tough to achieve and demand constant effort, but I&amp;#8217;m totally into it.&lt;/p&gt;
&lt;p&gt;Study, play around stuff, but apply it to something you or someone else will use. A real world example will guide your studies and usually takes your first contact with a technology much closer to what truly working with it would feel. And pushing a new app to the wild is always fun.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s not new. A lot of people talk about it. Very few people do it.&lt;/p&gt;
&lt;p&gt;In case you&amp;#8217;re interested, you can view the &lt;a href="http://github.com/mhfs/cpfcnpj"&gt;source code&lt;/a&gt; on GitHub.&lt;/p&gt;
&lt;p&gt;More apps coming soon.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/tIwU3dbHUGU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/07/28/make-up-excuses-to-learn.html</feedburner:origLink></entry>
 
 <entry>
   <title>Paul Graham about developer productivity</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/wDDtNwUWzEQ/paul-graham-about-developer-productivity.html" />
   <updated>2010-07-17T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/07/17/paul-graham-about-developer-productivity</id>
   <content type="html">At Viaweb we had one programmer who was a sort of monster of productivity. I remember watching what he did one
long day and estimating that he had added several hundred thousand dollars to the market value of the company.
A great programmer, on a roll, could create a million dollars worth of wealth in a couple weeks.
A mediocre programmer over the same period will generate zero or even negative wealth (e.g. by introducing bugs).&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/wDDtNwUWzEQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/07/17/paul-graham-about-developer-productivity.html</feedburner:origLink></entry>
 
 <entry>
   <title>Paul Graham about iPod + cell phone + browser</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/S0_7cM6HnlY/paul-graham-ipod-cell-browser-2004.html" />
   <updated>2010-07-16T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/07/16/paul-graham-ipod-cell-browser-2004</id>
   <content type="html">If Apple were to grow the iPod into a cell phone with a web browser, Microsoft would be in big trouble.&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/S0_7cM6HnlY" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/07/16/paul-graham-ipod-cell-browser-2004.html</feedburner:origLink></entry>
 
 <entry>
   <title>Ruby 1.9.2 + RVM + RubyDebug</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/6gJtPzqSUw4/ruby-1-9-2-rvm-ruby-debug.html" />
   <updated>2010-06-03T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/06/03/ruby-1-9-2-rvm-ruby-debug</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;&lt;/strong&gt;: This post is outdated. It should all work out of the box now.&lt;/p&gt;
&lt;p&gt;I have been investing some time in Rails3 and Ruby 1.9. Unfortunately that also means facing a lot of beta and release candidate gems.&lt;/p&gt;
&lt;p&gt;One that I was specially missing was ruby-debug. Looking around I found &lt;a href="http://github.com/mark-moseley/ruby-debug"&gt;ruby-debug19&lt;/a&gt; but the Mac OS installation instructions are focused on MacPorts. After some research I was able to adapt the steps to my &lt;span class="caps"&gt;RVM&lt;/span&gt; based ruby install.&lt;/p&gt;
&lt;p&gt;First, get rid of possible ruby-debug related gems:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;gem unsintall columnize linecache linecache19 ruby-debug-base ruby-debug-base19
  ruby-debug ruby-debug19 ruby-debug-ide ruby_core_source
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Then you&amp;#8217;ll have to figure out where is your ruby source code. Adapt it to your username and ruby version. It&amp;#8217;ll be something like &lt;code&gt;/Users/&amp;lt;username&amp;gt;/.rvm/src/&amp;lt;ruby-version&amp;gt;&lt;/code&gt;. For me it&amp;#8217;s &lt;code&gt;/Users/mhfs/.rvm/src/ruby-1.9.2-preview3&lt;/code&gt;. Adapt to your own username and ruby version.&lt;/p&gt;
&lt;p&gt;And finally, let&amp;#8217;s install ruby-debug19.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;gem install ruby-debug19 -- --with-ruby-include&lt;span class="o"&gt;=&lt;/span&gt;/Users/mhfs/.rvm/src/ruby-1.9.2-preview3
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;You should now be fine. Let me know if didn&amp;#8217;t work.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;d like to congratulate and thank &lt;a href="http://github.com/mark-moseley"&gt;Mark Moseley&lt;/a&gt; for the port of ruby-debug to 1.9.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/6gJtPzqSUw4" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/06/03/ruby-1-9-2-rvm-ruby-debug.html</feedburner:origLink></entry>
 
 <entry>
   <title>Truly making Rails3 use JQuery</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/3PFGCmOWPTQ/truly-making-rails3-use-jquery.html" />
   <updated>2010-05-24T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/05/24/truly-making-rails3-use-jquery</id>
   <content type="html">&lt;p&gt;Being myself a &lt;a href="http://jquery.com/"&gt;JQuery&lt;/a&gt; fan, I always make the change from Prototype to JQuery in the rails projects I start.&lt;/p&gt;
&lt;p&gt;The addition of the &lt;code&gt;--skip-prototype&lt;/code&gt; option to the rails command was certainly a huge progress, but (you&amp;#8217;ll probably call me a purist) not being able to use &lt;code&gt;javascript_include_tag :defaults&lt;/code&gt; with JQuery used to annoy me.&lt;/p&gt;
&lt;p&gt;Not anymore. Reading &lt;a href="http://www.railsinside.com/tips/451-howto-unobtrusive-javascript-with-rails-3.html"&gt;Rails Inside&lt;/a&gt; I figured out there&amp;#8217;s a way of teaching Rails what your defaults are.&lt;/p&gt;
&lt;p&gt;Just create an initializer with the following content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;ActionView::Helpers::AssetTagHelper&lt;/span&gt;
  &lt;span class="n"&gt;remove_const&lt;/span&gt; &lt;span class="ss"&gt;:JAVASCRIPT_DEFAULT_SOURCES&lt;/span&gt;
  &lt;span class="no"&gt;JAVASCRIPT_DEFAULT_SOURCES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sx"&gt;%w(jquery.js rails.js)&lt;/span&gt;

  &lt;span class="n"&gt;reset_javascript_include_default&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And now your call to &lt;code&gt;javascript_include_tag :defaults&lt;/code&gt; will include JQuery instead of Prototype.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/3PFGCmOWPTQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/05/24/truly-making-rails3-use-jquery.html</feedburner:origLink></entry>
 
 <entry>
   <title>Windows like Home and End keys on the Mac</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/dESwTkt88lY/windows-like-home-and-end-keys-on-the-mac.html" />
   <updated>2010-02-04T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/02/04/windows-like-home-and-end-keys-on-the-mac</id>
   <content type="html">&lt;p&gt;When I bought an &lt;a href="http://store.apple.com/us/product/MB110LL/A?fnode=MTY1NDA1Mg&amp;amp;mco=MTA4Mzc4ODA"&gt;external keyboard&lt;/a&gt; to use with my macbook, I had 2 expectations. Stop burning my fingers in the freaking hot aluminum (I live in a hot &lt;a href="http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=campinas,+sp&amp;amp;sll=-22.815614,-47.092891&amp;amp;sspn=0.015408,0.018754&amp;amp;ie=UTF8&amp;amp;hq=&amp;amp;hnear=Campinas+-+SP,+Brazil&amp;amp;ll=-9.449062,-21.972656&amp;amp;spn=111.92208,153.632813&amp;amp;z=3"&gt;city&lt;/a&gt;) and have Home/End/Delete keys.&lt;/p&gt;
&lt;p&gt;My fingers were fine but the Home/End keys didn&amp;#8217;t work as I expected. I wanted the same behavior I used to have in Windows, moving the cursor to the begin/end of each line.&lt;/p&gt;
&lt;p&gt;After some research I discovered a small trick to achieve that. You can create a file named &lt;code&gt;DefaultKeyBinding.dict&lt;/code&gt; under &lt;code&gt;~/Library/KeyBindings/&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;  &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;&amp;quot;\UF729&amp;quot;&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;moveToBeginningOfLine:&amp;quot;&lt;/span&gt;;
      &lt;span class="s2"&gt;&amp;quot;$\UF729&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;moveToBeginningOfLineAndModifySelection:&amp;quot;&lt;/span&gt;;
      &lt;span class="s2"&gt;&amp;quot;\UF72B&amp;quot;&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;moveToEndOfLine:&amp;quot;&lt;/span&gt;;
      &lt;span class="s2"&gt;&amp;quot;$\UF72B&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;moveToEndOfLineAndModifySelection:&amp;quot;&lt;/span&gt;;
  &lt;span class="o"&gt;}&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Restart the application and you should be fine.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/dESwTkt88lY" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/02/04/windows-like-home-and-end-keys-on-the-mac.html</feedburner:origLink></entry>
 
 <entry>
   <title>RMagick and Snow Leopard</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/9YZY8GEmUaA/rmagick-and-snow-leopard.html" />
   <updated>2010-02-03T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/02/03/rmagick-and-snow-leopard</id>
   <content type="html">&lt;p&gt;&lt;a href="http://rmagick.rubyforge.org/"&gt;RMagick&lt;/a&gt; is a RubyGem that wraps ImageMagick&amp;#8217;s features.&lt;/p&gt;
&lt;p&gt;I never used it by myself but the project I&amp;#8217;m working on uses a gem who depends on it.&lt;/p&gt;
&lt;p&gt;I installed it twice. In the day I started working in the project and in my &lt;a href="http://mhfs.com.br/2010/02/01/rebuilding-my-dev-env.html"&gt;dev env rebuild&lt;/a&gt; last weekend. Both times it was a &lt;span class="caps"&gt;PITA&lt;/span&gt;. For different reasons.&lt;/p&gt;
&lt;p&gt;The first time it was a conflict with a library MacPorts installed which I had to remove. Obviously after a lot of wasted hours.&lt;/p&gt;
&lt;p&gt;This time it was a little bit harder to figure out. I installed ImageMagick via &lt;a href="http://github.com/mxcl/homebrew/"&gt;Homebrew&lt;/a&gt; and then installed RMagick via gem install. The installation went well and I wrongly assumed everything was fine, but when I tried script/server I got a frozen process. No error messages.&lt;/p&gt;
&lt;p&gt;After a lot of research I discovered that even though RMagick 2.12.2 (latest available gem) compile against ImageMagick 6.5.6 (the version Homebrew installs) it only works with ImageMagick &amp;gt;= 6.5.8. My work around was a customized Homebrew formula for 6.5.9.&lt;/p&gt;
&lt;p&gt;So, after the story, let&amp;#8217;s make things happen.&lt;/p&gt;
&lt;p&gt;Download the custom formula &lt;a href="http://gist.github.com/293828"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Someone told me brew install -i &amp;#60;formula&amp;#62; would work, but it didn&amp;#8217;t, so copy the file to /usr/local/Library/Formula/ and then:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew install imagemagick_rmagick --with-ghostscript
&lt;span class="nv"&gt;$ &lt;/span&gt;gem install rmagick
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;That should make you ok.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ruby 1.8.6 note:&lt;/strong&gt; it seems ruby 1.8.6 has an issue with RMagick and Snow Leopard. You can see all the hardcore details &lt;a href="http://www.ruby-forum.com/topic/196606"&gt;here&lt;/a&gt;. It&amp;#8217;s safer to go with 1.8.7.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Homebrew note:&lt;/strong&gt; I created an issue asking for a ImageMagick formula update. The custom formula won&amp;#8217;t be required soon.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/9YZY8GEmUaA" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/02/03/rmagick-and-snow-leopard.html</feedburner:origLink></entry>
 
 <entry>
   <title>Rebuilding my development environment</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/s4csTvxMeRk/rebuilding-my-dev-env.html" />
   <updated>2010-02-01T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2010/02/01/rebuilding-my-dev-env</id>
   <content type="html">&lt;p&gt;Some time ago I had to compile some libraries for a project I&amp;#8217;m working on and that made me realize my machine was all messed up.&lt;/p&gt;
&lt;p&gt;It had ruby and mysql manually compiled into /usr/local, imagemagick installed via a package, postgres installed via macports (arghh) and some other stuff that I don&amp;#8217;t even recall compiled via different install scripts. I was also trapped to a single ruby version.&lt;/p&gt;
&lt;p&gt;One may say it&amp;#8217;s not a big deal but to a control freak like me, that&amp;#8217;s more of a mess than I can leave with.&lt;/p&gt;
&lt;p&gt;I guess my lack of familiarity with a Mac took me to that point and I finally decided to put some effort on rebuilding my environment.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not the step-by-step kind of guy, so I&amp;#8217;ll just present the tools that I now rely on and made the difference to me.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/mxcl/homebrew"&gt;Homebrew&lt;/a&gt; is a recipe based package installer that&amp;#8217;s becoming very popular. It&amp;#8217;s great and the formula library is growing fast. It beautifully organizes everything into /usr/local and have a great symlinks approach. Very easy to install and uninstall stuff. Some basic dependency resolution is also present. It quickly gave me wget, mysql, postgres and imagemagick. Take a look on the &lt;a href="http://github.com/mxcl/homebrew/tree/master/Library/Formula/"&gt;list of recipes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://rvm.beginrescueend.com/"&gt;&lt;span class="caps"&gt;RVM&lt;/span&gt;&lt;/a&gt; or Ruby Version Manager is a sweet gem which allows you to have multiple versions of Ruby installed in the same machine and easily switch among them. Gem sets is a cool feature it offers which allows you to jail that app which purpose seems to be using all the gems out there.&lt;/p&gt;
&lt;p&gt;One more cool side effect of using Homebrew and &lt;span class="caps"&gt;RVM&lt;/span&gt; is that I no longer need to use sudo all the time.&lt;/p&gt;
&lt;p&gt;Hope it works well for other people like it&amp;#8217;s working for me.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/s4csTvxMeRk" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2010/02/01/rebuilding-my-dev-env.html</feedburner:origLink></entry>
 
 <entry>
   <title>Get to know Heroku</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/hSZdVwEED2E/get-to-know-heroku.html" />
   <updated>2009-11-06T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/11/06/get-to-know-heroku</id>
   <content type="html">&lt;p&gt;If you&amp;#8217;re looking for a hosting solution for your Rails app I have a suggestion. Try out &lt;a href="http://www.heroku.com/"&gt;Heroku&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s a git based deploy solution really easy to get running and with a decent free plan for small apps.&lt;/p&gt;
&lt;p&gt;Once you start getting more traffic/data you can dynamically scale resources.&lt;/p&gt;
&lt;p&gt;My blog is running on a free Heroku plan for a couple of months now and I have no complaints. I have some difficulties when deploying it but their support were great even for the free plan. And it was my fault on the .gems file anyway.&lt;/p&gt;
&lt;p&gt;Now that I feel comfortable having tested it with my blog I&amp;#8217;ll start migrating/deploying some other apps to it.&lt;/p&gt;
&lt;p&gt;And keep an eye on the AddOns. They&amp;#8217;re getting better everyday.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/hSZdVwEED2E" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/11/06/get-to-know-heroku.html</feedburner:origLink></entry>
 
 <entry>
   <title>Apple Brazil Fail</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/5GH3Cg1ZmZI/apple-brazil-fail.html" />
   <updated>2009-10-08T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/10/08/apple-brazil-fail</id>
   <content type="html">&lt;p&gt;Apple recently launched their online store in Brazil and I immediately ordered a full keyboard to use with my hot-as-hell-macbook.&lt;/p&gt;
&lt;p&gt;The order was placed and processed on Oct 6th. The delivery was initially supposed to happen in 3 to 7 business days. From Oct 9th to Oct 15th.&lt;/p&gt;
&lt;p&gt;Yesterday, Oct 7th, I received another email telling me they were sorry to inform my order would be shipped only on Oct 23th and could take up to Oct 30th to get to my home.&lt;/p&gt;
&lt;p&gt;So I ask:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;how could the estimated date vary that much in 2 days?&lt;/li&gt;
	&lt;li&gt;why are they stating on the online store they are shipping in 7 to 10 business days if my 2 days ago processed order will ship just in 12 business days?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Incredibly, It seems they still didn&amp;#8217;t learn the lesson.&lt;/p&gt;
&lt;p&gt;Very frustrating first experience. Specially considering all my expectation. I mean, it&amp;#8217;s Apple.&lt;/p&gt;
&lt;p&gt;Where&amp;#8217;s Tim Cook, the master of distribution and logistics?&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Update: after all the mess with my order they ended up delivering the keyboard today, Oct 14th.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/5GH3Cg1ZmZI" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/10/08/apple-brazil-fail.html</feedburner:origLink></entry>
 
 <entry>
   <title>Craziness</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/ap4PSEd9L-Y/craziness.html" />
   <updated>2009-10-05T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/10/05/craziness</id>
   <content type="html">&lt;p&gt;Every year in Brazil 60000 people don&amp;#8217;t receive appropriate Radiotherapy treatment due to lack of equipment.&lt;/p&gt;
&lt;p&gt;Specialists estimates the country needs a 100 new machines.&lt;/p&gt;
&lt;p&gt;And people celebrate Rio 2016.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/ap4PSEd9L-Y" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/10/05/craziness.html</feedburner:origLink></entry>
 
 <entry>
   <title>Finally some good Police work</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/YohE0SEkxB8/finally-some-good-police-work.html" />
   <updated>2009-09-27T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/09/27/finally-some-good-police-work</id>
   <content type="html">&lt;p&gt;In my humble opinion there was a major public security happening in Rio de Janeiro last week.&lt;/p&gt;
&lt;p&gt;An asshole tried to rob a drug store and found himself surrounded by the cops. As a good robber-asshole-coward he took a women as a hostage and started threatening to explode a hand grenade (understanding how a drug store robber was in possession of a grenade is something reserved to Brazilian people).&lt;/p&gt;
&lt;p&gt;The cops started to negotiate and things seemed to go bad when something I&amp;#8217;d never expect happened. A sniper shot the guy in the head. No injuries to the hostage. Being myself a victim of several robberies and other violence acts I felt really great about it.&lt;/p&gt;
&lt;p&gt;I hope his family cries the tiers of all his victims families and his children misses all the money he robbed from someone else.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=eFqZNJtOiZQ"&gt;Video on YouTube&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Looking forward on watching more of those.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/YohE0SEkxB8" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/09/27/finally-some-good-police-work.html</feedburner:origLink></entry>
 
 <entry>
   <title>Enki Blog App</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/im3duJ4NUH8/enki-blog-app.html" />
   <updated>2009-09-22T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/09/22/enki-blog-app</id>
   <content type="html">&lt;p&gt;Since my move from &lt;span class="caps"&gt;PHP&lt;/span&gt; to Ruby some months ago I was desiring to move the &lt;span class="caps"&gt;PHP&lt;/span&gt; systems I use to something Ruby based. Mainly this Blog which originally used Wordpress.&lt;/p&gt;
&lt;p&gt;My personal stuff has always been a tech playground and I was missing it so I started searching for alternatives. I looked into Mephisto, SimpleBlog and Radiant but they all looked more of the same. I was aiming on something I could have more control of and ended up facing &lt;a href="http://www.enkiblog.com/"&gt;Enki Blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Enki is a no fluff, straight Rails blog app, conceived to allow developers to dive into it and customize whatever they want. It&amp;#8217;s like a ready to use blog scaffold I can evolve in any way I want.&lt;/p&gt;
&lt;p&gt;The migration process was very simple with the help of this &lt;a href="http://github.com/rb2k/enki-wp-importer/"&gt;simple script&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In some aspects it represented a couple of steps backwards but it will allow me to evolve in another directions more easily and, hopefully, more interestingly.&lt;/p&gt;
&lt;p&gt;ps.: I&amp;#8217;d like to thanks Wordpress for the good moments I had with it. Also, not choosing Mephisto or Radiant doesnt&amp;#8217;t mean they aren&amp;#8217;t good. I use Radiant myself for my company website and love it.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/im3duJ4NUH8" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/09/22/enki-blog-app.html</feedburner:origLink></entry>
 
 <entry>
   <title>IE6 No More</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/aq0irP_D-eM/ie6-no-more.html" />
   <updated>2009-08-07T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/08/07/ie6-no-more</id>
   <content type="html">&lt;p&gt;&lt;a href="http://www.weebly.com"&gt;Weebly&lt;/a&gt; had a great initiative to finish this web curse called IE6. If you can support it somehow don&amp;#8217;t think twice.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.ie6nomore.com"&gt;www.ie6nomore.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/aq0irP_D-eM" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/08/07/ie6-no-more.html</feedburner:origLink></entry>
 
 <entry>
   <title>Amazon accepting Snow Leopard Pre-Orders</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/qVNRVBNSWoA/amazon-accepting-snow-leopard-pre-orders.html" />
   <updated>2009-08-03T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/08/03/amazon-accepting-snow-leopard-pre-orders</id>
   <content type="html">&lt;p&gt;Just a heads up on Amazon&amp;#8217;s Snow Leopard pre-order release yesterday (I guess).&lt;/p&gt;
&lt;p&gt;They&amp;#8217;re charging U$ 29,00 and there&amp;#8217;s a money back guarantee if they lower the price before shipping day.&lt;/p&gt;
&lt;p&gt;No expected date tough. Go Apple!&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s the link: &lt;a href="http://www.amazon.com/Mac-version-10-6-Snow-Leopard/dp/B001AMHWP8/"&gt;http://www.amazon.com/Mac-version-10-6-Snow-Leopard/dp/B001AMHWP8/&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/qVNRVBNSWoA" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/08/03/amazon-accepting-snow-leopard-pre-orders.html</feedburner:origLink></entry>
 
 <entry>
   <title>Replace TextMate Drawer</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/ICdrbBir7jE/replace-textmate-drawer.html" />
   <updated>2009-07-30T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/07/30/replace-textmate-drawer</id>
   <content type="html">&lt;p&gt;With the switch from my old Vaio to a MacBook I finally had the chance to dive into &lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt;. And I have to say that it is what all the people say of it. Awesome software.&lt;/p&gt;
&lt;p&gt;But like every software it has its drawbacks and one that bored me a lot is the drawer file browser which seems to doesn&amp;#8217;t be part of the window itself. A quick google search showed me I wasn&amp;#8217;t the only one who don&amp;#8217;t like it and took me to the &lt;a href="http://code.google.com/p/textmate-missingdrawer/"&gt;textmate-missingdrawer&lt;/a&gt; plugin. Easy to install and delivers what the name states. Worth a try.&lt;/p&gt;
&lt;p&gt;See the result below.&lt;/p&gt;
&lt;p&gt;&lt;img src="/assets/textmate_drawer.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/ICdrbBir7jE" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/07/30/replace-textmate-drawer.html</feedburner:origLink></entry>
 
 <entry>
   <title>Installing Ruby on Rails Environment on a Mac</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/LOp4Umd32Ak/installing-ruby-on-rails-environment-on-a-mac.html" />
   <updated>2009-07-30T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/07/30/installing-ruby-on-rails-environment-on-a-mac</id>
   <content type="html">&lt;p&gt;When I got my MacBook I was in the middle of a RoR development project and needed to get everything up and running really quick. After trying a couple of approaches and wasting a lot of precious time I ended up in this &lt;a href="http://hivelogic.com"&gt;Hivelogic&lt;/a&gt; article.&lt;/p&gt;
&lt;p&gt;My unique intention with this post is to offer a straight answer on how to setup a RoR environment. Follow their guide. You&amp;#8217;ll get everything up even if it&amp;#8217;s the first time you&amp;#8217;re looking to a Mac.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://hivelogic.com/articles/ruby-rails-leopard"&gt;Installing Ruby, Rubygems, Rails, and Mongrel on Mac OS X 10.5 (Leopard)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/LOp4Umd32Ak" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/07/30/installing-ruby-on-rails-environment-on-a-mac.html</feedburner:origLink></entry>
 
 <entry>
   <title>Netbeans Error: Rails requires RubyGems &gt;= 1.3.1</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/-MFqijhS6FQ/rails-requires-rubygems-131.html" />
   <updated>2009-04-30T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/04/30/rails-requires-rubygems-131</id>
   <content type="html">&lt;p&gt;I have been working with &lt;a href="http://netbeans.org"&gt;Netbeans&lt;/a&gt; on a daily basis for a while and every time I load it up I get an annoying &amp;#8220;Rails requires RubyGems &amp;gt;= 1.3.1 (you have 1.2.0). Please `gem update &amp;#8212;system` and try again.&amp;#8221; message.&lt;/p&gt;
&lt;p&gt;Since I&amp;#8217;m using it just as an editor, not making use of its embeded Rails environment, I ignored it for a while but today I decided to face the problem and solve it definitely.&lt;/p&gt;
&lt;p&gt;If you already tried to run &amp;#8220;gem update &amp;#8212;system&amp;#8221; in your Netbeans JRuby folder you know it just says there&amp;#8217;s nothing to update and the errror message persists. After some research on the web I discovered the rubygems-update gem.&lt;/p&gt;
&lt;p&gt;To make use of it, just go to your JRuby folder (usually C:\Program Files\Netbeans 6.5.1\ruby2\jruby\bin\jruby) and type the following commands as follows.&lt;/p&gt;
&lt;p&gt;First of all check if you find the home of the problem with the following command which should give you &amp;#8220;1.2.0&amp;#8221; back.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;mhfs@vm &lt;span class="nv"&gt;$ &lt;/span&gt;jruby gem --version
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now type these two commands for the update process to work:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;mhfs@vm &lt;span class="nv"&gt;$ &lt;/span&gt;jruby gem install rubygems-update
mhfs@vm &lt;span class="nv"&gt;$ &lt;/span&gt;jruby update_rubygems
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And check the version again to be sure you got to 1.3.X.&lt;/p&gt;
&lt;p&gt;That should be enough. The message will be gone. If any of you have any problem drop a comment and I&amp;#8217;ll try to help.&lt;/p&gt;
&lt;p&gt;Update: There seams to be a way to install a newer version of JRuby by downloading it (http://jruby.codehaus.org/:http://jruby.codehaus.org/) and expanding into your &amp;#8220;C:\Program Files\Netbeans 6.5.1\ruby2\&amp;#8221; folder. Then all you have to do is adding a new Ruby Platform in your Netbeans project properties. Please notice that a new JRuby install means you&amp;#8217;ll have to reinstall your gems (if you installed new ones since you first installed Netbeans).&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/-MFqijhS6FQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/04/30/rails-requires-rubygems-131.html</feedburner:origLink></entry>
 
 <entry>
   <title>Rails Learning Guide by Me</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/fCywuEyP110/rails-learning-guide-by-me.html" />
   <updated>2009-04-23T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/04/23/rails-learning-guide-by-me</id>
   <content type="html">&lt;p&gt;When I look back to the day I started learning Rails it seems it was more confusing than it should be. Maybe the problem was my approach and anxiety to quickly understand everything. To avoid that you possibly get in the same situation I decided to write something about the steps and resources I&amp;#8217;d like to know when I started.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.Get introduced to Ruby&lt;/strong&gt;: For this the best resource I got to know so far for someone who already have programming skills is the Ruby appendix of the great Agile Web Development with Rails book by Sam Ruby, Dave Thomas and David Heinemeier Hansson. Not too much. Just the basics for you to understand Rails code. You can buy it online &lt;a href="http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.Setting a Rails Environment:&lt;/strong&gt; Well &amp;#8230; lot&amp;#8217;s of options here. My choice is to install &lt;a href="http://www.netbeans.org/downloads/index.html"&gt;NetBeans&lt;/a&gt; for Ruby/Rails. It comes bundled with a full Ruby/Rails environment. Of course you can google for options for different IDEs and OSes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3.First Contact with Rails:&lt;/strong&gt; An obvious place that I took a while to notice was the &lt;a href="http://guides.rubyonrails.org/"&gt;Rails Guides&lt;/a&gt;. Their introductory chapter entitled &lt;a href="http://guides.rubyonrails.org/getting_started.html"&gt;Getting Started with Rails&lt;/a&gt; is a must read for a quick overview of Rails architecture and features. If you prefer, the chapters 5 to 13 of the book will work too (I went this way but wouldn&amp;#8217;t again).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.Getting Deeper:&lt;/strong&gt; My suggestion here is for you to find something to code that you really need. You&amp;#8217;ll probably find yourself in trouble and almost everything you&amp;#8217;ll need is at &lt;a href="http://guides.rubyonrails.org/"&gt;Rails Guides&lt;/a&gt; topics and the&lt;a href="http://api.rubyonrails.org/"&gt; Rails &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt;. Another priceless resource is the community itself. I like to get to them through the #rubyonrails &lt;span class="caps"&gt;IRC&lt;/span&gt; channel on Freenode.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. Understanding the Rails way:&lt;/strong&gt; something I noticed about Rails is that almost all the time there is a right way of doing what you want. And it&amp;#8217;ll be simple. But it might be difficult to realize it by yourself if you come from another language/framework with distinct paradigms. Somewhere you can find a lot on the right way of doing things with Rails is the fantastic &lt;a href="http://railscasts.com/"&gt;Rails Casts&lt;/a&gt; by Ryan Bates.&lt;/p&gt;
&lt;p&gt;A general advice would be to read much more than code for a couple of weeks untill you got familiar with Rails. And never forget of you&amp;#8217;re good friend Google. Rails has an awesome community who loves to share knowledge. It&amp;#8217;s spread everywhere.&lt;/p&gt;
&lt;p&gt;If you have any suggestion to this minimal guide do not hesitate to suggest it. In a future post I&amp;#8217;ll write something about the gems and plugins I like to use.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/fCywuEyP110" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/04/23/rails-learning-guide-by-me.html</feedburner:origLink></entry>
 
 <entry>
   <title>Ruby/Rails fading in</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/WQzRlsDFRBA/rails-fading-in.html" />
   <updated>2009-04-04T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/04/04/rails-fading-in</id>
   <content type="html">&lt;p&gt;So .. as I stated in my previous post &lt;a href="http://rubyonrails.org/"&gt;Rails&lt;/a&gt; felt into my life some weeks ago.&lt;/p&gt;
&lt;p&gt;I started looking into it and a feeling that it rocks started growing into me. In the beginning it was difficulty to put that feeling in words. I was getting surprised by features I already knew from &lt;a href="http://www.symfony-project.org/"&gt;Symfony&lt;/a&gt;. That was when I figured it out: the first great thing about Rails is Ruby. I&amp;#8217;m still far from being a Ruby expert &amp;#8211; really far &amp;#8211; but I can definitely say that it is a powerful language.&lt;/p&gt;
&lt;p&gt;The second thing I couldn&amp;#8217;t let by is the hability the developers had to make a lot with a few line of codes. I want to give a simple example about it .&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s grab some posts with category id &amp;#8216;1&amp;#8217; from the database and pass it to the view.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="php"&gt;&lt;span class="x"&gt;//Symfony&lt;/span&gt;
&lt;span class="x"&gt;$c = new Criteria();&lt;/span&gt;
&lt;span class="x"&gt;$c-&amp;gt;add(PostPeer::CATEGORY_ID, 1, Criteria::EQUAL);&lt;/span&gt;
&lt;span class="x"&gt;$this-&amp;gt;posts = PostPeer::doSelect($c);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;#Rails&lt;/span&gt;
&lt;span class="vi"&gt;@posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Post&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find_by_category_id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Ok &amp;#8230; I know a lot of you would say I could create a doSelectByCategory() method inside of PostPeer and I respond to that with &amp;#8220;but I would have to do it&amp;#8221;. In a large application that would end up with thousands of avoidable lines of code. Every single feature I code in rails feels shorter and much more readable. End of story.&lt;/p&gt;
&lt;p&gt;Another small detail that took my attention was the partial engine. The way it accepts both a single object or a collection (iterating through it by itself) plus a view variable being created with the same name as the partial is great. Again .. nothing special but so awesomely handy.&lt;/p&gt;
&lt;p&gt;One more example &amp;#8230; which way of validating the length of a field looks better for you?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="php"&gt;&lt;span class="x"&gt;// symfony&lt;/span&gt;
&lt;span class="x"&gt;$this-&amp;gt;setValidators(array(&lt;/span&gt;
&lt;span class="x"&gt;  &amp;#39;message&amp;#39; =&amp;gt; new sfValidatorString(array(&amp;#39;min_length&amp;#39; =&amp;gt; 4))&lt;/span&gt;
&lt;span class="x"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;# rails&lt;/span&gt;
&lt;span class="n"&gt;validates_length_of&lt;/span&gt;       &lt;span class="ss"&gt;:message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="ss"&gt;:minimum&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Want another one? What&amp;#8217;s the simpler and clearest way of declaring a relation between two of your models?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="yaml"&gt;&lt;span class="c1"&gt;# symfony - inside a schema file which gives you no visibility in your model&lt;/span&gt;
&lt;span class="l-Scalar-Plain"&gt;business_unit&lt;/span&gt;&lt;span class="p-Indicator"&gt;:&lt;/span&gt;
  &lt;span class="l-Scalar-Plain"&gt;manager_id&lt;/span&gt;&lt;span class="p-Indicator"&gt;:&lt;/span&gt; &lt;span class="p-Indicator"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;type&lt;/span&gt;&lt;span class="p-Indicator"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;integer&lt;/span&gt;&lt;span class="p-Indicator"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;foreignTable&lt;/span&gt;&lt;span class="p-Indicator"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;user&lt;/span&gt;&lt;span class="p-Indicator"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;foreignReference&lt;/span&gt;&lt;span class="p-Indicator"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;id&lt;/span&gt;&lt;span class="p-Indicator"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;# rails - inside your model with fully visibility - read and understand&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BusinessUnit&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
  &lt;span class="n"&gt;belongs_to&lt;/span&gt; &lt;span class="ss"&gt;:user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:foreign_key&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;manager_id&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I could continue with that longer and longer &amp;#8230; the routing system is great &amp;#8230; I would definitely fail to describe in words how fantastic the migration system is.&lt;/p&gt;
&lt;p&gt;Rails gave me back my pleasure to develop. And when I finish I look to the result and it&amp;#8217;s beautiful.&lt;/p&gt;
&lt;p&gt;I challenge you. Go to &lt;a href="http://guides.rubyonrails.org/index.html"&gt;Rails Guides&lt;/a&gt;, read something and tell me you don&amp;#8217;t like it. :D&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Next: when I started I felt a little bit confused on the way to go. My next post will provide some links and tips on what I believe to be a good way for a newcomer to approach Rails.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/WQzRlsDFRBA" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/04/04/rails-fading-in.html</feedburner:origLink></entry>
 
 <entry>
   <title>PHP/Symfony fading out</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/Wgah1Oo3Rgo/symfony-fading-out.html" />
   <updated>2009-03-25T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/03/25/symfony-fading-out</id>
   <content type="html">&lt;p&gt;Back when I was a college student, around 2001, I had my first contact with &lt;a href="http://www.php.net/"&gt;&lt;span class="caps"&gt;PHP&lt;/span&gt;&lt;/a&gt;. Since that time 8 years had passed and I got really close to it. About 3 years ago I joined a project and had to choose one among several &lt;span class="caps"&gt;PHP&lt;/span&gt; frameworks available out there to use as the base for all the development.&lt;/p&gt;
&lt;p&gt;This was when I first got in touch with &lt;a href="http://www.symfony-project.org/"&gt;Symfony&lt;/a&gt;. Love at first sight. Compared to the &amp;#8220;procedural way of coding&amp;#8221; I was used to it was like being instantly dropped into heaven.&lt;/p&gt;
&lt;p&gt;Time got gone, code got written, customers got happy and me too. Keeping surfing the delightful waves of great Symfony features.&lt;/p&gt;
&lt;p&gt;But like everything else in life, while time went away things that I didn&amp;#8217;t even notice in the beginning started to get really annoying.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s the case of:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;writing nested foreachs in plain php mixed with html&lt;/li&gt;
	&lt;li&gt;writing a 50 chars long line of code to fetch a simple session variable&lt;/li&gt;
	&lt;li&gt;keeping track of database modifications manually to apply into production later on &amp;#8211; also manually&lt;/li&gt;
	&lt;li&gt;typing &amp;#8220;php symfony cc&amp;#8221; a thousand times a day&lt;/li&gt;
	&lt;li&gt;finding out that the code you just grabbed from the 1.2 version of the symfony book actually doesn&amp;#8217;t work in Symfony 1.2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The list could continue a lot longer. But pushing Symfony down is not the point. The point is that even if Symfony is still great and has a lot of fantastic features it simply doesn&amp;#8217;t feel anymore like the solution for all my problems like it used to feel.&lt;/p&gt;
&lt;p&gt;I have Symfony applications live with which I am pretty happy, Symfony applications under development becoming awesome and I&amp;#8217;ll keep using Symfony when it fits specific needs. Probably I&amp;#8217;ll even write technical posts about it in here.&lt;/p&gt;
&lt;p&gt;But happens that a couple of weeks ago in an afternoon full of Symfony frustration, without looking for it, I found myself in front of a &lt;a href="http://rubyonrails.org/"&gt;Ruby on Rails&lt;/a&gt; blog post. A Rails which by the way I was already been hearing of a lot. Since then I&amp;#8217;m investing a lot of free time on it. Sharing this experience will be the objective of my next post.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/Wgah1Oo3Rgo" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/03/25/symfony-fading-out.html</feedburner:origLink></entry>
 
 <entry>
   <title>Comments Count Bug in iNove WP Theme</title>
   <link href="http://feedproxy.google.com/~r/mhfs/~3/XObN-F1wxls/comments-count-bug-in-inove-wp-theme.html" />
   <updated>2009-03-25T00:00:00+00:00</updated>
   <id>http://mhfs.com.br/2009/03/25/comments-count-bug-in-inove-wp-theme</id>
   <content type="html">&lt;p&gt;Well&amp;#8230; I was looking into the blog thinking about what would be the next post when I noticed that some unapproved spam comments were being taking into consideration in the iNove theme comments&amp;#8217; count.&lt;/p&gt;
&lt;p&gt;A post was stating &amp;#8220;1 comment&amp;#8221; but when I clicked on that it took me to the post detail page where there was no comment.&lt;/p&gt;
&lt;p&gt;After trying a little by myself I ended up asking for help in the #wordpress irc channel on freenode.&lt;/p&gt;
&lt;p&gt;Thanks to sivel I was able to correct a small bug in functions.php.&lt;/p&gt;
&lt;p&gt;On line 363 (3 below)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="php"&gt;&lt;span class="x"&gt;function comment_count($commentcount){&lt;/span&gt;
&lt;span class="x"&gt;  global $id;&lt;/span&gt;
&lt;span class="x"&gt;  $_commnets = get_comments(&amp;#39;post_id=&amp;#39; . $id);&lt;/span&gt;
&lt;span class="x"&gt;  $comments_by_type = &amp;amp;separate_comments($_commnets);&lt;/span&gt;
&lt;span class="x"&gt;  return count($comments_by_type[&amp;#39;comment&amp;#39;]);&lt;/span&gt;
&lt;span class="x"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#8230; should actually be &amp;#8230;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="php"&gt;&lt;span class="x"&gt;function comment_count($commentcount){&lt;/span&gt;
&lt;span class="x"&gt;  global $id;&lt;/span&gt;
&lt;span class="x"&gt;  $_commnets = get_comments(&amp;#39;status=approve&amp;amp;amp;post_id=&amp;#39; . $id);&lt;/span&gt;
&lt;span class="x"&gt;  $comments_by_type = &amp;amp;separate_comments($_commnets);&lt;/span&gt;
&lt;span class="x"&gt;  return count($comments_by_type[&amp;#39;comment&amp;#39;]);&lt;/span&gt;
&lt;span class="x"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Clear your cache (if you have it enabled) and you&amp;#8217;ll be done.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mhfs/~4/XObN-F1wxls" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://mhfs.com.br/2009/03/25/comments-count-bug-in-inove-wp-theme.html</feedburner:origLink></entry>
 

</feed>

