<rss version="2.0">
  <channel>
    <title>brentmc79.com - RSS Feed</title>
    <link>http://www.brentmc79.com/rss</link>
    <description/>
    <item>
      <title>Snow Leopard Rails Dev Setup Guides</title>
      <link>http://www.brentmc79.com/posts/osx-rails-dev-setup-walk-throughs</link>
      <description>&lt;p&gt;You can never have too many.&lt;br /&gt;&lt;br /&gt;Much like every new version of OSX, there have been a plethora of "How to install BLANK on Snow Leopard" blog posts and walk-throughs detailing all the little tips and tricks around how to install some tool or piece of software.&amp;nbsp; Having a lot of options is awesome, but in the words of the great Biggie Smalls, "mo' blog posts, mo' problems".&lt;br /&gt;&lt;br /&gt;That IS how it went, right?&lt;br /&gt;&lt;br /&gt;Anyway, with all of these walk-throughs, how do you know which ones are good, and which one just suck.&amp;nbsp; Well, you don't really...&lt;br /&gt;&lt;br /&gt;So here's a list of a few [confirmed] valid and useful dev setup walk-throughs:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;First, this is actually a series of posts, as opposed to one single write-up.&amp;nbsp; Actually, its not even a series of posts.&amp;nbsp; Its just the search results for 'Snow Leopard' on the &lt;a title="Hive Logic website" href="http://hivelogic.com/" target="_blank"&gt;Hive Logic&lt;/a&gt; site.&amp;nbsp; So really, its only the first 3-5 posts that matter.&lt;br /&gt;&lt;br /&gt;&lt;a title="Snow Leopard search results on HiveLogic.com" href="http://hivelogic.com/search/results/a7a831b978f2667fa301ea095d3d8fa7" target="_blank"&gt;http://hivelogic.com/search/results/a7a831b978f2667fa301ea095d3d8fa7&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is the route that I personally followed after a fresh install of Snow Leopard, and I had everything up and running in no time.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next, &lt;a title="RobbyOnRails.com" href="http://robbyonrails.com/" target="_blank"&gt;Robby On Rails&lt;/a&gt; did a thorough and entertaining post on Snow Leopard Rails dev env setup, or SLRDESU for short.&amp;nbsp; Acronyms make everything better (AMEB).&amp;nbsp; I don't know about you, but Robby's older post about getting setup with Passenger came in handy for me on more than one occasion.&lt;br /&gt;&lt;br /&gt;&lt;a title="The Robby On Rails walk-through" href="http://www.robbyonrails.com/articles/2010/02/08/installing-ruby-on-rails-passenger-postgresql-mysql-oh-my-zsh-on-snow-leopard-fourth-edition" target="_blank"&gt;http://www.robbyonrails.com/articles/2010/02/08/installing-ruby-on-rails-passenger-postgresql-mysql-oh-my-zsh-on-snow-leopard-fourth-edition&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;His latest post covers everything from start to finish, and he even included a few video to pass the time while waiting for binaries to build and whatnot.&amp;nbsp; I haven't personally used this walk-through, but based on my previous experience with Robby's posts, and the recommendation from coworkers, I'm sure it'll get you where you need to be.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another noteworthy mention comes from the guys over at &lt;a title="Thoughbot website" href="http://thoughtbot.com/" target="_blank"&gt;Thoughtbot&lt;/a&gt;, the makers of such wonderful tools as Shoulda, Paperclip, and Factory Girl.&amp;nbsp; Their robot-laden guide goes beyond just Rails/dev-related stuff, and covers the likes of several generally useful OSX tools.&amp;nbsp; Things like Quicksilver, Fluid, and Firefox/Firebug.&lt;br /&gt;&lt;br /&gt;&lt;a title="Thoughbot walk-through" href="http://robots.thoughtbot.com/post/159805668/2009-rubyists-guide-to-a-mac-os-x-development" target="_blank"&gt;http://robots.thoughtbot.com/post/159805668/2009-rubyists-guide-to-a-mac-os-x-development&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is another one that I haven't personally used, but I think we can trust the guys over at Thoughtbot.&amp;nbsp; After all, their company reputation depends on it!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So there you have it.&amp;nbsp; Three different hand-holding recipes for getting you set up on Snow Leopard.&amp;nbsp; If you haven't upgraded yet, what're you waiting for?&amp;nbsp; Get to it!&lt;/p&gt;</description>
      <pubDate>Fri, 05 Mar 2010 02:36:39 +0000</pubDate>
    </item>
    <item>
      <title>Geoip_city gem install on Snow Leopard</title>
      <link>http://www.brentmc79.com/posts/geoip-city-gem-on-snow-leopard</link>
      <description>&lt;p&gt;I had recently upgraded my MacBook Pro to OS X 10.6 Snow Leopard, and I was in the process of reinstalling most of the ruby gems.&amp;nbsp; The geoip_city gem was the only one that gave me a bit of trouble, so I figured I'd post how I got it working.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go &lt;a title="Maxmind GeoIP source download" href="http://geolite.maxmind.com/download/geoip/api/c/" target="_blank"&gt;here&lt;/a&gt; and download the latest source for the GeoIP C api&lt;/li&gt;
&lt;li&gt;Untar the source, cd into the directory&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;./configure&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Then run &lt;code&gt;make &amp;amp;&amp;amp; sudo make install&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Finally, run &lt;code&gt;sudo env ARCHFLAGS="-arch x86_64" gem install geoip_city -- --with-geoip-dir=/opt/GeoIP&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The key is the &lt;code&gt;ARCHFLAGS&lt;/code&gt; parameter in the last step.&amp;nbsp; This indicates the native extensions are to be built for a 64 bit architecture.&lt;/p&gt;
&lt;p&gt;Also, if you need the free GeoIP City Lite database, you can find it &lt;a title="GeoIP City Lite database download link" href="http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"&gt;here&lt;/a&gt;.&amp;nbsp; I hope this helps.&lt;/p&gt;</description>
      <pubDate>Mon, 28 Dec 2009 19:15:07 +0000</pubDate>
    </item>
    <item>
      <title>IE7's Accept Header And Rails respond_to Bug</title>
      <link>http://www.brentmc79.com/posts/ie7-accept-header-and-rails-respon-to-bug</link>
      <description>&lt;p&gt;Earlier this afternoon, I was debugging an ajax call that consistently resulted in an error, but only in IE.&amp;nbsp; Checking the log file, I found this:&lt;/p&gt;
&lt;pre class="terminal"&gt;Processing ApplicationController#index (for 192.168.1.108 at 2009-10-27 14:37:03) [GET]&lt;br /&gt;  Session ID: ddde16cf83baca85a81e9fb0772c2844&lt;br /&gt;  Parameters: {"format"=&amp;gt;"js", "page"=&amp;gt;"1"}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ActionController::MethodNotAllowed (Only get, head, post, put, and delete requests are allowed.):&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb:65:in `recognize_path'&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:384:in `recognize'&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:154:in `handle_request'&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'&lt;br /&gt;    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/request_handler.rb:50:in `process_request'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/application_spawner.rb:378:in `start_request_handler'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/application_spawner.rb:336:in `handle_spawn_application'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb:183:in `safe_fork'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/application_spawner.rb:334:in `handle_spawn_application'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server.rb:352:in `__send__'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server.rb:163:in `start'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/application_spawner.rb:213:in `start'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server.rb:352:in `__send__'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'&lt;br /&gt;    /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/bin/passenger-spawn-server:61&lt;br /&gt;&lt;br /&gt;Rendering /Users/brent/Intridea/project/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb (method_not_allowed)&lt;/pre&gt;
&lt;p&gt;WTF?&amp;nbsp; That told me a whole lotta nothing.&lt;/p&gt;
&lt;p&gt;First of all, it was blowing up before it even got into the application code, which was was strange because it worked just fine in Firefox, Safari, etc.&amp;nbsp; Second, I checked the response body and it was returning html.&amp;nbsp; Html?&amp;nbsp; The format is clearly specified as "js" in the request parameters.&amp;nbsp; Double-checking the controller code, there was definitely a respond_to block with format.js, so why was it returning html?&lt;/p&gt;
&lt;p&gt;I showed this to one of my coworkers and he asked if I had tried switching the format calls in the respond_to block.&amp;nbsp; There were two, one for html and one for javascript.&amp;nbsp; I switched them up, and put the format.js first.&amp;nbsp; I reloaded the page, and what do you know, it worked!&amp;nbsp; No error.&amp;nbsp; Again, wtf?&amp;nbsp; He told me that this same bug had kicked his ass on a previous project.&lt;/p&gt;
&lt;p&gt;Aparently, IE7 isn't specific about what sort of response it expects in the accept header.&amp;nbsp; This causes Rails to merely return the first format that it comes to.&amp;nbsp; In my case, the html.&lt;/p&gt;
&lt;p&gt;So if you're not seeing the format that you're expecting when testing with IE7, try reordering the format calls in the respond_to block.&lt;/p&gt;</description>
      <pubDate>Wed, 28 Oct 2009 01:26:30 +0000</pubDate>
    </item>
    <item>
      <title>Access Your Passenger App From Windows</title>
      <link>http://www.brentmc79.com/posts/access-your-passenger-app-from-windows</link>
      <description>&lt;p&gt;Eww, Windows?&lt;/p&gt;
&lt;p&gt;Yeah, I said it.&amp;nbsp; As we all know, there's a million and one schmucks out there still rockin' Internet Explorer as their default browser.&amp;nbsp; That means if you want that spreadsheet-in-the-cloud app you've been working on to hit critical mass, you better test it in IE.&lt;/p&gt;
&lt;p&gt;If you're like me, then you've recently started running some or all of your apps locally via &lt;a title="The Passenger Homepage" href="http://www.modrails.com/" target="_blank"&gt;Passenger&lt;/a&gt;.&amp;nbsp; This can cause a bit of a problem when it comes time to test in IE.&amp;nbsp; At least, it did for me anyway.&lt;/p&gt;
&lt;p&gt;I use &lt;a title="Parallels Desktop for Mac" href="http://www.parallels.com/products/desktop/" target="_blank"&gt;Parallels&lt;/a&gt; for my Windows testing, and an old version at that.&amp;nbsp; From what I hear, &lt;a title="VMWare Fusion - Mac Desktop Virtualization" href="http://www.vmware.com/products/fusion/" target="_blank"&gt;VMWare&lt;/a&gt; is better, but I'm too cheap to buy it and I just don't really care that much.&amp;nbsp; Prior to using Passenger locally, I would just point IE at my mac's IP address, port 3000, and everything was kosher.&amp;nbsp; Well, with Passenger, that no worky.&lt;/p&gt;
&lt;p&gt;Now, I'm sure there's probably a way to configure Parallels to allow me to test a Passenger app, but from what I can tell that either requires an updated version of Parallels or more time Googling than I'm willing to spend.&lt;/p&gt;
&lt;p&gt;I knew that I could access my local Apach instance from any machine on my home network, so I figured there's got to be a way to hit my Passenger apps since they're running under that same Apach instance.&amp;nbsp; With a little help from a fellow &lt;a title="Dave's Intridea profile" href="http://www.intridea.com/about/people/naffis" target="_blank"&gt;Intridean&lt;/a&gt;, I got it working.&lt;/p&gt;
&lt;p&gt;Here's what you do:&lt;/p&gt;
&lt;p&gt;1. Set your app up in Passenger, like you normally would.&amp;nbsp; I use the pref pane.&lt;/p&gt;
&lt;p&gt;&lt;a title="Passenger Pref Pane" href="http://s3.amazonaws.com/brentmc79-prod/files/17/original.png?1256675869"&gt;&lt;img style="margin-top: 5px; margin-bottom: 5px;" src="http://s3.amazonaws.com/brentmc79-prod/files/17/medium.png?1256675869" alt="passengerpane.png" width="300" height="223" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. Determine you mac's IP address.&amp;nbsp; An easy way is to look in the sharing section of the System Preferences.&lt;/p&gt;
&lt;p&gt;&lt;a title="Sharing Pref Pane" href="http://s3.amazonaws.com/brentmc79-prod/files/18/original.png?1256676029"&gt;&lt;img style="margin-top: 5px; margin-bottom: 5px;" src="http://s3.amazonaws.com/brentmc79-prod/files/18/medium.png?1256676029" alt="sharingprefpane.png" width="300" height="247" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. On your Windows machine, add an entry to the hosts file with your mac's IP address and the app's domain (local) domain name.&amp;nbsp; The host file is in C:\WINDOWS\system32\drivers\etc.&lt;/p&gt;
&lt;p&gt;&lt;a title="Windows Host File" href="http://s3.amazonaws.com/brentmc79-prod/files/19/original.png?1256676196"&gt;&lt;img style="margin-top: 5px; margin-bottom: 5px;" src="http://s3.amazonaws.com/brentmc79-prod/files/19/medium.png?1256676196" alt="hostsfile.png" width="300" height="196" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That's it!&amp;nbsp; Point IE at http://yourapp.local and you should be golden.&amp;nbsp; This will work for subdomains also, assuming you've added the *.yourapp.local alias to you Passenger conf.&lt;/p&gt;</description>
      <pubDate>Tue, 27 Oct 2009 21:03:24 +0000</pubDate>
    </item>
    <item>
      <title>Now in mobile format...</title>
      <link>http://www.brentmc79.com/posts/now-in-mobile-format</link>
      <description>&lt;p&gt;&lt;img style="float: left;" src="http://s3.amazonaws.com/brentmc79-prod/files/12/medium.png?1250352229" alt="Picture_6.png" width="280" height="300" /&gt;&lt;/p&gt;
&lt;p&gt;Out of sheer boredom last night, I decided to whip up a mobile view for my blog.&lt;/p&gt;
&lt;p&gt;It was extremely easy thanks to the &lt;a title="Mobile-fu github page" href="http://github.com/brendanlim/mobile-fu/tree/master" target="_blank"&gt;mobile-fu&lt;/a&gt; plugin by my friend &lt;a title="Brendan's blog" href="http://brendanlim.com/" target="_blank"&gt;Brendan&lt;/a&gt;.&amp;nbsp; I also found a few tips and tricks from &lt;a title="Jun 19 Tutorial: Building a website for the iPhone" href="http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/" target="_blank"&gt;this post&lt;/a&gt; on the Engage Interactive blog such as how to handle orientation changes and how to specify an image for home screen bookmarks.&lt;/p&gt;
&lt;p&gt;I did most of my testing via the iPhone Simulator from the SDK and also a &lt;a title="Fluid App-specific browser" href="http://fluidapp.com/" target="_blank"&gt;Fluid&lt;/a&gt; browser which allows you to specify mobile safari as the user agent, giving you the proper look, and you can use Safari's built-in Firebug-like tools.&lt;/p&gt;
&lt;p&gt;If you've got an iPhone, give it a look...&lt;/p&gt;</description>
      <pubDate>Sat, 15 Aug 2009 20:01:38 +0000</pubDate>
    </item>
    <item>
      <title>iPhone hack day at Viget Labs</title>
      <link>http://www.brentmc79.com/posts/iphone-hack-day-at-viget-labs</link>
      <description>&lt;p&gt;&lt;a href="http://s3.amazonaws.com/brentmc79-prod/files/10/original.jpg?1250189401"&gt;&lt;img style="margin:0px 0px 5px 5px" src="http://s3.amazonaws.com/brentmc79-prod/files/10/medium.jpg?1250189401" alt="photo.jpg" width="300" height="225" align="right" /&gt;&lt;/a&gt;I recently spent a day hanging out with a few of the guys at &lt;a title="Viget Labs homepage" href="http://www.viget.com" target="_blank"&gt;Viget Labs&lt;/a&gt; hacking on the iPhone.&amp;nbsp; &lt;a title="Ben Scofield's professional blog" href="http://benscofield.com/" target="_blank"&gt;Ben Scofield&lt;/a&gt;, the Technology Director at Viget Labs, was leading an iPhone development primer for a few of Viget's finest, and they were nice enough to let a handful of "outsiders" join the fun.&lt;/p&gt;
&lt;p&gt;My iPhone development experience at that point was very minimal.&amp;nbsp; I had done a few online tutorials and walk-throughs, but nowhere near enough to really understand what I was doing.&amp;nbsp; On top of that, my Objective-C knowledge was pretty much non-existant.&amp;nbsp; Fortunately, none of this was a problem.&lt;/p&gt;
&lt;p&gt;We spent the first half of the day going over the basics.&amp;nbsp; Ben walked us through Xcode and Interface Builder, and we talked about basic project layout, the different types of iPhone apps (list, view, and navigation-based, etc).&lt;/p&gt;
&lt;p&gt;We then broke off into small groups, pairs mostly, to do a little hacking.&amp;nbsp; &lt;a title="David's professional blog" href="http://davideisinger.com/"&gt;David Eisinger &lt;/a&gt;and myself put our heads together on something amazing.&amp;nbsp; The Text-EmBIGiner, we called it (or something like that).&amp;nbsp; Picture this, a text field, a button, and a label.&amp;nbsp; You enter your text, hit the buttom, and BAM -- the label is updated with your text.&amp;nbsp; Fucking amazing.&amp;nbsp; We thought so at least.&amp;nbsp; Many high-fives were had.&lt;/p&gt;
&lt;p&gt;Lunch was provided in the form of &lt;a href="http://www.amantepizza.com/"&gt;Amante Pizza&lt;/a&gt;.&amp;nbsp; Thanks Viget!&lt;/p&gt;
&lt;p&gt;In the afternoon we moved on to talk about ways of makin iPhone development less painful.&amp;nbsp; In other words, removing the Objective-C.&amp;nbsp; We briefly talked about &lt;a href="http://rhomobile.com/home"&gt;Rhomobile&lt;/a&gt;, an open source framwork for building cross-platform mobile apps.&lt;/p&gt;
&lt;p&gt;The remainder of the day was spent talking about and playing with two other frameworks, Appcelerator's &lt;a href="http://www.appcelerator.com/products/titanium-mobile/" target="_blank"&gt;Titanium&lt;/a&gt; and the open source &lt;a href="http://phonegap.com" target="_blank"&gt;PhoneGap&lt;/a&gt;.&amp;nbsp; Both frameworks allow you to build your app using primarily HTML and javascript, but they still give you access to the iPhone native controls and features.&amp;nbsp; They were very cool and I could definitely see myself playing with these more in the future.&lt;/p&gt;
&lt;p&gt;Overall it was a really fun day, and I'm looking forward to putting my new knowledge to good use.&lt;/p&gt;
&lt;p&gt;Thanks again Viget!&lt;/p&gt;</description>
      <pubDate>Thu, 13 Aug 2009 21:30:40 +0000</pubDate>
    </item>
    <item>
      <title>I decided to "role" my own...  get it?</title>
      <link>http://www.brentmc79.com/posts/new_plugin_role_fu</link>
      <description>&lt;p&gt;I had some spare time the other day, which doesn't happen often, so I thought I'd take advantage of it by building something useful rather than tenderizing my brain via social media like I usually do.&lt;/p&gt;
&lt;p&gt;After hearing numerous complaints recently about shitty role/authorization implementations, I thought I'd take a stab at it, so I whipped up role_fu.&amp;nbsp; It's a rails plugin that simplifies the process of setting up role access rules for controller actions.&lt;/p&gt;
&lt;p&gt;Check out the &lt;a title="role_fu project page" href="../../../role_fu" target="_self"&gt;project page&lt;/a&gt; or the &lt;a title="role_fu github repo" href="http://github.com/brentmc79/role_fu/tree/master" target="_blank"&gt;readme&lt;/a&gt; for more details.&lt;/p&gt;
&lt;p&gt;If you've got any feedback, do me a favor and leave a comment on the project page, or just shoot me an email brentmc79(@)gmail(dot)com.&lt;/p&gt;</description>
      <pubDate>Sun, 26 Jul 2009 20:19:36 +0000</pubDate>
    </item>
    <item>
      <title>properly using the flash</title>
      <link>http://www.brentmc79.com/posts/properly-using-the-flash</link>
      <description>&lt;p&gt;&lt;img style="float: left; margin: 5px;" src="http://s3.amazonaws.com/brentmc79-prod/files/8/medium.jpg?1244596649" alt="Are those pants made of mirrors, because I can see myself in them..." width="193" height="300" /&gt;&lt;/p&gt;
&lt;p&gt;No, I'm not going to tell you how to seduce the comic book superhero with an evening of dinner, cocktails, and smooth talk while demonstrating impeccable manners and etiquette.&lt;/p&gt;
&lt;p&gt;What I am going to tell you is how to correctly use the handy Rails tool for passing objects between actions.&amp;nbsp; Now, this is no huge secret or stunningly clever trick.&amp;nbsp; In fact, you probably already know what I'm about to tell you.&amp;nbsp; It's just one of those things that I never think to do until after it's a problem.&lt;/p&gt;
&lt;p&gt;In the typical Rails app, there a snippet/partial/whatever that displays anything from the flash hash with either :notice or :error keys.&amp;nbsp; If, in your controller action, you set flash[:notice] equal to some message and then redirect to another action, that message will persist through the redirect and get displayed on the subsequent view.&lt;/p&gt;
&lt;p&gt;Here's the problem.&amp;nbsp; If, in your action, you just render a view template instead of redirecting, then the user will see that message like you intended but it will also still remain on the following request which may or may not be confusing.&amp;nbsp; Fortunately, there's an easy way to avoid this.&lt;/p&gt;
&lt;p&gt;If you know you'll be redirecting, then there's nothing to worry about.&amp;nbsp; Business as usual.&amp;nbsp; But if you're not redirecting, just rendering a view, then you can use flash.now[:key].&amp;nbsp; The 'now' method only maintains the flash contents through the current request and is cleared before the next action.&amp;nbsp; Check it out.&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;def create
&amp;nbsp; @thing = Thing.new(params[:thing])
&amp;nbsp; if @thing.save
&amp;nbsp;&amp;nbsp;&amp;nbsp; flash[:notice] = "Oh snap!&amp;nbsp; You created a thing!"
&amp;nbsp;&amp;nbsp;&amp;nbsp; redirect_to @thing
&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; flash.now[:error] = "Damn dog, you messed up"
&amp;nbsp;&amp;nbsp;&amp;nbsp; render :action =&amp;gt; :new
&amp;nbsp; end
end&lt;/pre&gt;
&lt;p&gt;Notice how when the thing save without errors we use flash[] and redirect, but when there are errors we use flash.now[] and there's no redirect.&amp;nbsp; This will keep your app users from seeing any strance, out of place errors.&lt;/p&gt;
&lt;p&gt;So that's it.&amp;nbsp; Like I said, it's nothing monumental.&amp;nbsp; As you were...&lt;/p&gt;</description>
      <pubDate>Wed, 10 Jun 2009 02:13:41 +0000</pubDate>
    </item>
    <item>
      <title>hookers, nuts, and ActiveRecord callbacks</title>
      <link>http://www.brentmc79.com/posts/hookers-nuts-and-activerecord-callbacks</link>
      <description>&lt;p&gt;&lt;img src="http://s3.amazonaws.com/brentmc79-prod/files/7/original.jpg?1241728881" alt="feat-shamwow.jpg" width="487" height="409" /&gt;&lt;/p&gt;
&lt;p&gt;Remember my post from a few weeks back about temporarily &lt;a href="../temporarily-disable-activerecord-callbacks" target="_blank"&gt;disabling ActiveRecord callbacks&lt;/a&gt;?&amp;nbsp; Well, I decided to extend the functionality a bit and wrap it all up in a plugin.&lt;/p&gt;
&lt;p&gt;You can now specify one or more callbacks to disable, or specify nothing and disable all callbacks by default.&lt;/p&gt;
&lt;p&gt;You can check out the &lt;a href="../../without_callbacks" target="_blank"&gt;project page&lt;/a&gt; or jump over to the &lt;a href="http://github.com/brentmc79/without_callbacks/tree/master" target="_blank"&gt;Github repo&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 07 May 2009 20:44:36 +0000</pubDate>
    </item>
    <item>
      <title>Git checkout woes [updated]</title>
      <link>http://www.brentmc79.com/posts/git-checkout-woes-updated</link>
      <description>&lt;p&gt;I ran into a strange issue while attempting to checkout a remote tracking branch of an Intridea project earlier today, so I thought I'd post up my work around.&lt;/p&gt;
&lt;p&gt;I ran my normal checkout command, like so...&lt;/p&gt;
&lt;pre class="terminal"&gt;brent:~/Intridea/earthaid[master]$ git checkout -b prod origin/prod&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;which resulted in this error message&lt;/p&gt;
&lt;pre class="terminal"&gt;fatal: git checkout: updating paths is incompatible with switching branches.&lt;br /&gt;Did you intend to checkout 'origin/prod' which can not be resolved as commit&lt;/pre&gt;
&lt;p&gt;After a bit of googling, I'm still not sure of the cause as most of the search results were related to issues around deploying tags, and I was merely attempting a checkout.&amp;nbsp; What I did find out was that I could specify the start point of my new branch by the revision/commit sha instead of the remote branch name, like so...&lt;/p&gt;
&lt;pre class="terminal"&gt;brent:~/Intridea/earthaid[master]$ git branch prod 02314583a99abdc276cde968c20babbadd23&lt;br /&gt;brent:~/Intridea/earthaid[master]$ gc prod&lt;br /&gt;Switched to branch "prod"&lt;br /&gt;brent:~/Intridea/earthaid[prod]$&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Once I had applied my changes, I just had to make sure to push them to the proper branch.&lt;/p&gt;
&lt;p&gt;[update]&lt;/p&gt;
&lt;p&gt;&lt;img src="http://s3.amazonaws.com/brentmc79-prod/files/6/original.jpg?1241620873" alt="farside_cartoon.jpg" width="320" height="231" /&gt;&lt;/p&gt;
&lt;p&gt;Ok, I'm a retard.&amp;nbsp; About a minute or two after I typed up this post, it occurred to me that Git couldn't resolve the remote branch name because I hadn't pulled first.&amp;nbsp; Yeah, that's right.&amp;nbsp; All I need to do was pull and then everything worked properly.&lt;/p&gt;</description>
      <pubDate>Wed, 06 May 2009 14:49:42 +0000</pubDate>
    </item>
  </channel>
</rss>
