<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4172981932098931033</id><updated>2020-03-14T09:26:46.079-07:00</updated><category term="ruby on rails"/><category term="freeciv"/><category term="software development"/><category term="mac os x"/><category term="miscellaneous"/><category term="leopard"/><category term="ruby"/><category term="macports"/><category term="ajax"/><category term="hardware"/><category term=".net"/><category term="flex"/><category term="github"/><category term="macintosh"/><category term="plugin"/><category term="programming"/><category term="unit test"/><category term="video"/><category term="apache"/><category term="book"/><category term="cocoa"/><category term="css"/><category term="factory_girl"/><category term="git"/><category term="javascript"/><category term="jquery"/><category term="linux"/><category term="mocha"/><category term="mod_rails"/><category term="movie"/><category term="outsourcing"/><category term="passenger"/><category term="prototype"/><category term="shell script"/><category term="sql"/><category term="subversion"/><category term="terminal"/><category term="ubuntu"/><category term="windows"/><title type='text'>The Banana Peel</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>68</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-354408261726216664</id><published>2014-07-17T08:13:00.001-07:00</published><updated>2020-03-14T09:17:19.123-07:00</updated><title type='text'>Why Controller#pre_render?</title><content type='html'>&lt;p&gt;Recently I was pleasantly surprised that my &lt;a href=&quot;http://the-banana-peel.saltybanana.com/2013/02/controllerprerender.html&quot;&gt;pre_render&lt;/a&gt; methodology still works with Rails 4.1.4, which led me to re-visit and re-answer for myself the question of why it is helpful.&lt;/p&gt; &lt;p&gt;Consider the following Account model.  To properly create an account, we need to associate it with a user record:&lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;code data-language=&quot;ruby&quot;&gt;class Account &amp;lt; ActiveRecord::Base&lt;br /&gt;  belongs_to :user&lt;br /&gt;  validates :user, :presence =&gt; true&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt; &lt;p&gt;To do so, the following AccountsController#new is necessary:&lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot;&gt;class AccountsController &lt; AuthenticatedController&lt;br /&gt;&lt;br /&gt;  before_action :set_account, only: [:show, :edit, :update, :destroy]&lt;br /&gt;&lt;br /&gt;  # GET /accounts/new&lt;br /&gt;  def new&lt;br /&gt;    @account = Account.new&lt;br /&gt;    # Will be used by view to populate a&lt;br /&gt;    # user drop down&lt;br /&gt;    @users = User.all.order(:last_name)&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # GET /accounts/1/edit&lt;br /&gt;  def edit&lt;br /&gt;    # Will be used by view to populate a&lt;br /&gt;    # user drop down&lt;br /&gt;    @users = User.all.order(:last_name)&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # POST /accounts&lt;br /&gt;  # POST /accounts.json&lt;br /&gt;  def create&lt;br /&gt;    @account = Account.new(account_params)&lt;br /&gt;    respond_to do |format|&lt;br /&gt;      if @account.save&lt;br /&gt;        format.html { ... }&lt;br /&gt;        format.json { ... }&lt;br /&gt;      else&lt;br /&gt;        format.html do&lt;br /&gt;          # Needed here again to populate the user&lt;br /&gt;          # drop down in error case&lt;br /&gt;          @users = User.all.order(:last_name)&lt;br /&gt;          render action: &#39;new&#39;&lt;br /&gt;        end&lt;br /&gt;        format.json { ... }&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # PATCH/PUT /accounts/1&lt;br /&gt;  # PATCH/PUT /accounts/1.json&lt;br /&gt;  def update&lt;br /&gt;    respond_to do |format|&lt;br /&gt;      if @account.update(account_params)&lt;br /&gt;        format.html { ... }&lt;br /&gt;        format.json { ... }&lt;br /&gt;      else&lt;br /&gt;        format.html do&lt;br /&gt;          # Needed here again to populate the user&lt;br /&gt;          # drop down in error case&lt;br /&gt;          @users = User.all.order(:last_name)&lt;br /&gt;          render action: &#39;edit&#39;&lt;br /&gt;        end&lt;br /&gt;        format.json { ... }&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt; &lt;p&gt;The same pattern needs to be repeated for the edit/update actions as well.  Which means there are 4 different code paths in which @users needs to be initialized.  This problem will grow for models with more complex relationships as well.  So wouldn&#39;t it be nice if we can have a central place where @user is initialized?  We can accomplish this using the #pre_render approach to be DRY-ier:&lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;code data-language=&quot;ruby&quot;&gt;class AccountsController &lt; AuthenticatedController&lt;br /&gt;&lt;br /&gt;  before_action :set_account, only: [:show, :edit, :update, :destroy]&lt;br /&gt;&lt;br /&gt;  # GET /accounts/new&lt;br /&gt;  def new&lt;br /&gt;    @account = Account.new&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # GET /accounts/1/edit&lt;br /&gt;  def edit&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # POST /accounts&lt;br /&gt;  # POST /accounts.json&lt;br /&gt;  def create&lt;br /&gt;    @account = Account.new(account_params)&lt;br /&gt;    respond_to do |format|&lt;br /&gt;      if @account.save&lt;br /&gt;        format.html { ... }&lt;br /&gt;        format.json { ... }&lt;br /&gt;      else&lt;br /&gt;        format.html { render action: &#39;new&#39; }&lt;br /&gt;        format.json { ... }&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  # PATCH/PUT /accounts/1&lt;br /&gt;  # PATCH/PUT /accounts/1.json&lt;br /&gt;  def update&lt;br /&gt;    respond_to do |format|&lt;br /&gt;      if @account.update(account_params)&lt;br /&gt;        format.html { ... }&lt;br /&gt;        format.json { ... }&lt;br /&gt;      else&lt;br /&gt;        format.html { render action: &#39;edit&#39; }&lt;br /&gt;        format.json { ... }&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;protected&lt;br /&gt;&lt;br /&gt;  def pre_render(action)&lt;br /&gt;    case action&lt;br /&gt;    when :edit, :new&lt;br /&gt;      # Will be used by view to populate a&lt;br /&gt;      # user drop down&lt;br /&gt;      @users = User.all.order(:last_name)&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt; &lt;p&gt;Pretty nifty!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/354408261726216664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=354408261726216664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/354408261726216664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/354408261726216664'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2014/07/why-controllerprerender.html' title='Why Controller#pre_render?'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-1084666418950726435</id><published>2013-08-15T03:04:00.000-07:00</published><updated>2013-08-15T03:27:07.861-07:00</updated><title type='text'>Add new page to Rails app documentation</title><content type='html'>&lt;p&gt;I learnt about &lt;code&gt;rake doc:app&lt;/code&gt; in Rails 4.0.0 the other day.  Pretty handy stuff.  But, it turns out if I wanted to add, say, a &lt;code&gt;CHANGES.rdoc&lt;/code&gt; at the same level as &lt;code&gt;README.rdoc&lt;/code&gt;, and have it included as a page in the generated HTML output, there is no simple, built-in way to do it. &lt;/p&gt; &lt;p&gt;I know this because I figured out that the &lt;code&gt;doc:app&lt;/code&gt; task is part of the railties gem.  Opening up its &lt;code&gt;documentation.rake&lt;/code&gt; file, I found this code block: &lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;&lt;code data-language=&quot;ruby&quot;&gt;RDocTaskWithoutDescriptions.new(&quot;app&quot;) { |rdoc|&lt;br /&gt;  rdoc.rdoc_dir = &#39;doc/app&#39;&lt;br /&gt;  rdoc.template = ENV[&#39;template&#39;] if ENV[&#39;template&#39;]&lt;br /&gt;  rdoc.title    = ENV[&#39;title&#39;] || &quot;Rails Application Documentation&quot;&lt;br /&gt;  rdoc.options &lt;&lt; &#39;--line-numbers&#39;&lt;br /&gt;  rdoc.options &lt;&lt; &#39;--charset&#39; &lt;&lt; &#39;utf-8&#39;&lt;br /&gt;  rdoc.rdoc_files.include(&#39;README.rdoc&#39;)&lt;br /&gt;  rdoc.rdoc_files.include(&#39;app/**/*.rb&#39;)&lt;br /&gt;  rdoc.rdoc_files.include(&#39;lib/**/*.rb&#39;)&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt; &lt;p&gt;As you can see, the task only recognizes &lt;code&gt;README.rdoc&lt;/code&gt; in an app&#39;s top-level directory.  But, if I change the code a tiny bit, then it will happily include as many &lt;code&gt;.rdoc&lt;/code&gt; files as I create. &lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;&lt;code data-language=&quot;ruby&quot;&gt;RDocTaskWithoutDescriptions.new(&quot;app&quot;) { |rdoc|&lt;br /&gt;  rdoc.rdoc_dir = &#39;doc/app&#39;&lt;br /&gt;  rdoc.template = ENV[&#39;template&#39;] if ENV[&#39;template&#39;]&lt;br /&gt;  rdoc.title    = ENV[&#39;title&#39;] || &quot;Rails Application Documentation&quot;&lt;br /&gt;  rdoc.options &lt;&lt; &#39;--line-numbers&#39;&lt;br /&gt;  rdoc.options &lt;&lt; &#39;--charset&#39; &lt;&lt; &#39;utf-8&#39;&lt;br /&gt;  rdoc.rdoc_files.include(&#39;*.rdoc&#39;) # include all .rdoc files&lt;br /&gt;  rdoc.rdoc_files.include(&#39;app/**/*.rb&#39;)&lt;br /&gt;  rdoc.rdoc_files.include(&#39;lib/**/*.rb&#39;)&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt; &lt;p&gt;I opened up issue #&lt;a href=&quot;https://github.com/rails/rails/issues/11903&quot;&gt;11903&lt;/a&gt; about this.  Let&#39;s see how it goes. &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/1084666418950726435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=1084666418950726435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1084666418950726435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1084666418950726435'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2013/08/add-new-page-to-rails-app-documentation.html' title='Add new page to Rails app documentation'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-5616967622641584220</id><published>2013-02-17T09:40:00.000-08:00</published><updated>2014-07-17T08:17:35.965-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Controller#pre_render</title><content type='html'>&lt;p&gt;As a follow-up to a previous post about &lt;a href=&quot;http://the-banana-peel.saltybanana.com/2013/02/ruby-test.html&quot;&gt;Initialize Instance Variables Needed By A View In One Place&lt;/a&gt;, here is a more evolved/elegant approach.&lt;/p&gt; &lt;p&gt;First, I override the render method in &lt;code&gt;app/controllers/application_controller.rb&lt;/code&gt;:&lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;code data-language=&quot;ruby&quot;&gt;# override render so we can call pre_render on child classes&lt;br /&gt;&lt;br /&gt;def render(*args)&lt;br /&gt;  if self.class.method_defined? :pre_render&lt;br /&gt;    action = args[0].is_a?(Hash) ? (args[0][:action] || action_name) : action_name&lt;br /&gt;    self.pre_render(action.to_sym)&lt;br /&gt;  end&lt;br /&gt;  super&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt; &lt;p&gt;Then, I optionally define the &lt;code&gt;pre_render&lt;/code&gt; method in my other controllers:&lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;code data-language=&quot;ruby&quot;&gt;# define this method so that we can initialize the needed instance&lt;br /&gt;# variables the views need all in one place&lt;br /&gt;&lt;br /&gt;def pre_render(action)&lt;br /&gt;  case action&lt;br /&gt;  when :edit, :new&lt;br /&gt;    @users = User.all&lt;br /&gt;  when :show&lt;br /&gt;    @subaccounts = @account.subaccounts.order(:name)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt; Conceptually, this is similar to ASP.NET&#39;s &lt;code&gt;PreRender()&lt;/code&gt; event handler.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/5616967622641584220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=5616967622641584220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5616967622641584220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5616967622641584220'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2013/02/controllerprerender.html' title='Controller#pre_render'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-5050700677686145806</id><published>2013-02-14T11:32:00.000-08:00</published><updated>2013-02-14T11:32:48.401-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Linux Myth</title><content type='html'>&lt;p&gt;I remember one of the knocks against Windows was how often it needs to be patched and rebooted, and that Linux/Unix does not.  Well, I am here to say that is a myth.  I manage a couple of Ubuntu boxes, and the rate at which patches and reboots come in are just as frequent, if not more so, than the Windows ones I manage.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/5050700677686145806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=5050700677686145806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5050700677686145806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5050700677686145806'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2013/02/linux-myth.html' title='Linux Myth'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-8917378336685592089</id><published>2013-02-06T23:49:00.000-08:00</published><updated>2013-02-07T01:02:21.650-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Initialize Instance Variables Needed By A View In One Place</title><content type='html'>&lt;p&gt;In Rails, should &lt;code&gt;Controller#create&lt;/code&gt; fail, the pre-generated code will call &lt;code&gt;render :action =&gt; &quot;new&quot;&lt;/code&gt;.  But all too often rendering the &lt;code&gt;new&lt;/code&gt; view requires other instance variables to be assigned, which don&#39;t get assigned in this execution path if I place the initialization code in the &lt;code&gt;Controller#new&lt;/code&gt; method.&lt;/p&gt; &lt;p&gt;I have been frustrated by the lack of a good way to handle it.  At first I looked into the presenter pattern, but did not come up with anything that I liked.&lt;/p&gt; &lt;p&gt;Then, I came across this idea, which at first glance, seems to work well.  My main goal is to have a good place to initialize the needed instance variables needed by the view only once, and overriding &lt;code&gt;#render&lt;/code&gt; seems like a good way to go.&lt;/p&gt; Your thoughts?  &lt;blockquote&gt;&lt;pre&gt;&lt;code data-language=&quot;ruby&quot;&gt;# Override this method so that we can initialize the needed&lt;br /&gt;# instance variables the view needs all in one place&lt;br /&gt;&lt;br /&gt;def render(*args)&lt;br /&gt;  action = args[0][:action] || action_name&lt;br /&gt;  case action&lt;br /&gt;  when &quot;new&quot;&lt;br /&gt;    @accounts = Account.order(:name)&lt;br /&gt;    ...&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/8917378336685592089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=8917378336685592089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/8917378336685592089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/8917378336685592089'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2013/02/ruby-test.html' title='Initialize Instance Variables Needed By A View In One Place'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-4047571214258179071</id><published>2013-01-28T23:22:00.001-08:00</published><updated>2013-02-07T01:01:39.338-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac os x"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><title type='text'>Stream Videos From Mac To AppleTV Without iTunes</title><content type='html'>&lt;p&gt;I have been looking for a solution to stream videos from my iMac to Apple TV without needing to use iTunes.&lt;/p&gt; &lt;p&gt;I don&#39;t like to keep vidoes in iTunes because my iTunes library is already rather unwieldy.  Adding gigabytes of videos to it, and then subjecting the bloated thing to Time Machine backup?  Does not sound like fun.  I could opt to not copy the videos into my iTunes library when I add them, but that same setting will apply to my music as well.  No joy there.  So how can I stream these videos?&lt;/p&gt; &lt;p&gt;First there was AirFlick, but that stopped working with Lion.  Then I thought perhaps Mountain Lion&#39;s AirPlay Mirroring would do the trick, except my iMac isn&#39;t recent enough to use it.  Bummer.  I even purchased a copy of AirParrot to wirelessly use an AppleTV connected HDTV as a second monitor to a MacBook when it&#39;s in the same room as the TV.  But no joy to streaming videos stored on an iMac, which is in an adjacent room.&lt;/p&gt; &lt;p&gt;Then a solution hit me.  Here is what I did to set things up:&lt;/p&gt; &lt;ol style=&quot;margin-bottom:1em&quot;&gt;&lt;li&gt;Open Termninal, and create a symbolic link under /home/me/Sites/Videos, pointing to where I have my videos stored.&lt;/li&gt;&lt;li&gt;Edit /etc/apache2/users/me.conf thusly (sudo required):&lt;/li&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;# Adding the &quot;*&quot; at the end enables the server to serve up sub-directories.&lt;br /&gt;&amp;lt;Directory &quot;/Users/me/Sites/*&quot;&gt;&lt;br /&gt;    Options Indexes MultiViews&lt;br /&gt;    AllowOverride None&lt;br /&gt;    Order allow,deny&lt;br /&gt;    Allow from all&lt;br /&gt;&amp;lt;/Directory&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;li&gt;Go to &lt;em&gt;System Preferences &gt; Sharing&lt;/em&gt;, and turn on &lt;b&gt;Web Sharing&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Turn on and configure AirPlay on my AppleTV.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Now, whenever I want to watch a video stored in my iMac on my HDTV, I just:&lt;/p&gt; &lt;ol style=&quot;margin-bottom:1em&quot;&gt;&lt;li&gt;Open up Safari on an iOS device, and browse to &lt;a href=&quot;#&quot;&gt;http://myimac.local/~me/videos&lt;/a&gt;.  Better yet, bookmark it.&lt;/li&gt;&lt;li&gt;From the simplistic index page generated by Apache, choose a video to play.&lt;/li&gt;&lt;li&gt;Once the video starts to play on my mobile device, tap on the AirPlay icon and choose AppleTV.&lt;/li&gt;&lt;li&gt;In a few seconds, the video will start playing on the AppleTV.  At this point, I can use the Remote app or the Apple Remote to control the playback on AppleTV.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;This solution works perfectly, except for when my iMac is asleep.  To overcome this, I installed the free &lt;a href=&quot;http://www.mochasoft.dk/iphone_wol.htm&quot;&gt;mWOL&lt;/a&gt; app on my iOS devices and configured them to be able to remotely wake up the iMac as needed to stream videos.&lt;/p&gt; &lt;p&gt;By the way, the last two steps about choosing AirPlay to AppleTV are optional, especially when using an iPad.&lt;/p&gt; &lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/4047571214258179071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=4047571214258179071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4047571214258179071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4047571214258179071'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2013/01/stream-videos-from-mac-to-appletv.html' title='Stream Videos From Mac To AppleTV Without iTunes'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-5317162122635150398</id><published>2013-01-27T18:26:00.000-08:00</published><updated>2013-02-07T01:01:55.661-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac os x"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><title type='text'>Stitching Together .m4v Files on OS X Lion</title><content type='html'>&lt;p&gt;So I have a bunch of segmented .m4v files that I wanted to join together into one single file.  A bunch of googling &amp;amp; experimentation later, I came across this solution:&lt;/p&gt; &lt;ol style=&quot;margin-bottom:1em&quot;&gt;&lt;li&gt;Download the most recent/stable version of &lt;a href=&quot;http://gpac.wp.mines-telecom.fr/downloads/&quot;&gt;GPAC&lt;/a&gt;, mount the disk image, and drag the application into the /Applications folder.  Then, unmount the image.&lt;/li&gt;&lt;li&gt;Open Terminal, and &lt;span style=&quot;font-family:courier&quot;&gt;cd&lt;/span&gt; into the directory where my video files are.&lt;/li&gt;&lt;li&gt;Suppose my files are named 1.m4v, 2.m4v, and 3.m4v, etc.  Execute the following commands: &lt;ul style=&quot;font-family:courier;margin-bottom:1em&quot;&gt;&lt;li&gt;/Applications/Osmo4.app/Contents/MacOS/MP4Box -force-cat -cat 1.m4v movie.m4v&lt;/li&gt;&lt;li&gt;/Applications/Osmo4.app/Contents/MacOS/MP4Box -force-cat -cat 2.m4v movie.m4v&lt;/li&gt;&lt;li&gt;/Applications/Osmo4.app/Contents/MacOS/MP4Box -force-cat -cat 3.m4v movie.m4v&lt;/li&gt;&lt;li&gt;... and so on ...&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Voila!  Now I can just play the one file instead of having to either playing each one individually to creating some sort of play list to do so.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/5317162122635150398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=5317162122635150398' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5317162122635150398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5317162122635150398'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2013/01/so-i-have-bunch-of-segmented.html' title='Stitching Together .m4v Files on OS X Lion'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-4675223641335701918</id><published>2010-08-11T22:08:00.000-07:00</published><updated>2010-08-11T22:13:37.911-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="freeciv"/><title type='text'>Freeciv 2.2.2 + Snow Leopard = Half Joy</title><content type='html'>Got some feedback on the Freeciv &lt;a href=&quot;http://forum.freeciv.org/index.php&quot;&gt;forum&lt;/a&gt; regarding Freeciv 2.2.2 on Snow Leopard.  While the SDL version works but without sound, the GTK (X11) version does not.  I asked the kind poster for more info, let&#39;s see what comes of it.&lt;br /&gt;&lt;br /&gt;There is a workaround to enable sounds in the SDL version.  Read about it &lt;a href=&quot;http://forum.freeciv.org/viewtopic.php?t=6343&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/4675223641335701918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=4675223641335701918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4675223641335701918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4675223641335701918'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2010/08/freeciv-222-snow-leopard-half-joy.html' title='Freeciv 2.2.2 + Snow Leopard = Half Joy'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-1146767500457713723</id><published>2010-08-03T00:55:00.000-07:00</published><updated>2010-08-03T01:03:32.373-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="freeciv"/><title type='text'>Freeciv 2.2.2 Trifecta</title><content type='html'>Freeciv 2.2.2 came out not long ago.  I put together the following Mac OS X packages for it:&lt;br /&gt;&lt;ul style=&quot;line-height:1em&quot;&gt;&lt;br /&gt;&lt;li&gt;GTK version for Intel, 10.5.8+&lt;/li&gt;&lt;br /&gt;&lt;li&gt;SDL version for Intel, 10.5.8+&lt;/li&gt;&lt;br /&gt;&lt;li&gt;GTK version for PowerPC, 10.4.11&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;These also install into /opt/com.bitaxis instead of the canonical /opt/local directory used by &lt;a href=&quot;http://macports.org/&quot;&gt;MacPorts&lt;/a&gt;.  Hence, they are now &lt;em&gt;compatible&lt;/em&gt; with MacPorts.&lt;br /&gt;&lt;br /&gt;You can check them out &lt;a href=&quot;http://freeciv.wikia.com/wiki/Download#Mac_OS_X_Packages&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy!</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/1146767500457713723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=1146767500457713723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1146767500457713723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1146767500457713723'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2010/08/freeciv-222-trifecta.html' title='Freeciv 2.2.2 Trifecta'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-6967748107004633428</id><published>2010-07-15T23:14:00.001-07:00</published><updated>2010-07-15T23:37:43.425-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="freeciv"/><title type='text'>Freeciv 2.2.1 -- I am back!</title><content type='html'>I was looking through the &lt;a href=&quot;http://macports.org&quot;&gt;MacPorts&lt;/a&gt; man pages, and noticed the &lt;tt&gt;pkg&lt;/tt&gt; and &lt;tt&gt;mpkg&lt;/tt&gt; directives.  Which got me thinking...&lt;br /&gt;&lt;br /&gt;So, I decided to take another crack at Freeciv packaging for Mac OS X.  As I mentioned in another &lt;a href=&quot;http://the-banana-peel.saltybanana.com/2009/06/freeciv-packaging-troubles.html&quot;&gt;post&lt;/a&gt;, my old way of packaging Freeciv was untenable for me as someone with limited knowledge in GTK+ and X11.&lt;br /&gt;&lt;br /&gt;After some experimentation, and with the help of MacPorts, I put together two brand new Freeciv packages that are much easier to put together, albeit with an ironic twist of the results being incompatible with MacPorts.  Go figure!&lt;br /&gt;&lt;br /&gt;Anyhow, you can read about them &lt;a href=&quot;http://forum.freeciv.org/viewtopic.php?t=6324&quot;&gt;here&lt;/a&gt; as well as try them out for yourselves.&lt;br /&gt;&lt;br /&gt;Enjoy!</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/6967748107004633428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=6967748107004633428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/6967748107004633428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/6967748107004633428'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2010/07/freeciv-221.html' title='Freeciv 2.2.1 -- I am back!'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-4915821163748969431</id><published>2010-06-17T01:29:00.000-07:00</published><updated>2010-06-17T01:38:24.816-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Rails 3 Beta 4 -- Success!</title><content type='html'>After watching this series of Rails 3 &lt;a href=&quot;http://rubyonrails.org/screencasts/rails3&quot;&gt;screencasts&lt;/a&gt;, I decided to give Rails 3 a try.&lt;br /&gt;&lt;br /&gt;Reading the beta &lt;a href=&quot;http://guides.rails.info/3_0_release_notes.html&quot;&gt;release notes&lt;/a&gt;, I updated to the late rvm gem, then proceeded to install Ruby 1.8.7-p174.  While the installation was successful, and I was able to create a Rails 3 app, I couldn&#39;t run rake.  Any attempt to invoke it, even just to list rake tasks, gave me a cryptic error about Rail&#39;s delegate method.&lt;br /&gt;&lt;br /&gt;Next, I tried to install REE&#39;s flavor of Ruby 1.8.7, and that failed to install.&lt;br /&gt;&lt;br /&gt;So lastly, I tried 1.9.2-preview3, and that worked.  Woohoo!</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/4915821163748969431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=4915821163748969431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4915821163748969431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4915821163748969431'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2010/06/rails-3-beta-4-success.html' title='Rails 3 Beta 4 -- Success!'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-469551223284222760</id><published>2009-11-10T15:08:00.000-08:00</published><updated>2009-11-10T15:22:56.999-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><category scheme="http://www.blogger.com/atom/ns#" term="unit test"/><title type='text'>assert_false</title><content type='html'>Ruby has a pretty good unit-test framework.  However, it is annoying that &lt;tt&gt;assert_false&lt;/tt&gt; does not come built-in.  So, here is my own that I use in my Rails applications&#39; test code:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;script src=&quot;http://gist.github.com/231376.js&quot;&gt;&lt;/script&gt;&lt;/blockquote&gt;Enjoy!</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/469551223284222760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=469551223284222760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/469551223284222760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/469551223284222760'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/11/assertfalse.html' title='assert_false'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-6642140278241224386</id><published>2009-10-30T13:55:00.000-07:00</published><updated>2009-10-30T15:00:00.469-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><category scheme="http://www.blogger.com/atom/ns#" term="subversion"/><title type='text'>Peaceful Co-Existence Between Subversion and Git</title><content type='html'>So I have been using &lt;a href=&quot;http://svn.tigris.org&quot;&gt;Subversion&lt;/a&gt; as my source control tool for my Rails apps for a couple of years now, and I am very happy with it.&lt;br /&gt;&lt;br /&gt;Recently, I have begun to use &lt;a href=&quot;http://git-scm.com&quot;&gt;Git&lt;/a&gt; as my source control for plugin development, and using &lt;a href=&quot;http://github.com&quot;&gt;github.com&lt;/a&gt; as a means to share my work with the community.&lt;br /&gt;&lt;br /&gt;So, the dual-tool strategy begs the questions:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Do they play nice together?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;How does a developer make them play nicely with one another?&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;The short answers to these questions is Yes.  If you want the details, read on.&lt;br /&gt;&lt;br /&gt;Given the Tidy code I am versioning using Git is not a full-blown application, I need it to reside within the context of a Rails application to test it.  So this is what I did:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Have my application, let&#39;s call it X, version controlled using Subversion&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In application X&#39;s &lt;tt&gt;vendor/plugins&lt;/tt&gt; directory, I create a Git repository called &lt;tt&gt;tidy&lt;/tt&gt;; this is where I maintain and test Tidy&#39;s code&lt;/li&gt;&lt;br /&gt;&lt;li&gt;This Git repository is tied to &lt;a href=&quot;http://github.com&quot;&gt;github.com&lt;/a&gt;, so that I can push any changes out for the community to see&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The &lt;tt&gt;tidy&lt;/tt&gt; directory is also version controlled by Subversion, so that my application has a working copy of Tidy that I can deploy&lt;/li&gt;&lt;br /&gt;&lt;li&gt;However, Subversion complains about the &lt;tt&gt;tidy/.git&lt;/tt&gt; directory, and Git in turn complains about the various &lt;tt&gt;tidy/*/.svn&lt;/tt&gt; directories&lt;/li&gt;&lt;br /&gt;&lt;li&gt;To remedy this, I added a &lt;tt&gt;tidy/.gitignore&lt;/tt&gt; file to ignore the various &lt;tt&gt;tidy/*/.svn&lt;/tt&gt; directories, and I added set the &lt;tt&gt;svn:ignore&lt;/tt&gt; property on&lt;tt&gt; tidy/&lt;/tt&gt; to ignore the &lt;tt&gt;tidy/.git&lt;/tt&gt; directory&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;With this setup, I can now more easily maintain the code for both my Rails application and the Tidy plugin.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/6642140278241224386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=6642140278241224386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/6642140278241224386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/6642140278241224386'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/10/peaceful-co-existence-between.html' title='Peaceful Co-Existence Between Subversion and Git'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-4304110174830064768</id><published>2009-10-30T08:36:00.000-07:00</published><updated>2009-10-30T14:41:23.049-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="miscellaneous"/><category scheme="http://www.blogger.com/atom/ns#" term="software development"/><title type='text'>Github.com Has Uptime Issues?</title><content type='html'>Since I&#39;ve started to use it frequently within the last month or so, I have noticed several times where &lt;a href=&quot;http://github.com&quot;&gt;github.com&lt;/a&gt; either responds very slowly or is outright unavailable.  Even as I am typing this, my repeated attempts to load github.com in another Safari tab just failed with another server error.&lt;br /&gt;&lt;br /&gt;Has anyone else noticed this, or is it just me?&lt;br /&gt;&lt;br /&gt;Update: Looks like they are having &lt;a href=&quot;http://twitter.com/github&quot;&gt;issues&lt;/a&gt; with their backend...</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/4304110174830064768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=4304110174830064768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4304110174830064768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4304110174830064768'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/10/githubcom-has-uptime-issues.html' title='Github.com Has Uptime Issues?'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-633907381830585127</id><published>2009-10-29T10:10:00.001-07:00</published><updated>2009-10-29T10:15:45.062-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Tidy Plugin Updated for Rails 2.3.4</title><content type='html'>Turns out my Tidy plugin doesn&#39;t work with Rails 2.3.4.  I discovered this when I upgraded one of my apps from Rails 2.2.2 to the latest version.  A quick debug session revealed and fixed the problem.&lt;br /&gt;&lt;br /&gt;However, the change means it will no longer work with Rails 2.2.2.&lt;br /&gt;&lt;br /&gt;Check it out &lt;a href=&quot;http://github.com/bitaxis/tidy&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/633907381830585127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=633907381830585127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/633907381830585127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/633907381830585127'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/10/tidy-plugin-updated-for-rails-234.html' title='Tidy Plugin Updated for Rails 2.3.4'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-3333268918470787535</id><published>2009-10-19T09:51:00.000-07:00</published><updated>2009-10-30T14:36:08.234-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Announcement: Tidy Plugin for Rails</title><content type='html'>I finally put some effort and re-factored my &lt;tt&gt;tidy_javascripts&lt;/tt&gt; and &lt;tt&gt;tidy_stylsheets&lt;/tt&gt; helper methods into a Rails plugin to help me accomplish the following goals:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Ease of re-use across multiple projects&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Learn about &lt;a href=&quot;http://git-scm.com&quot;&gt;git&lt;/a&gt; and &lt;a href=&quot;http://github.com&quot;&gt;github.com&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Learn about authoring a Rails plugin&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Check out my &lt;a href=&quot;http://github.com/bitaxis/tidy&quot;&gt;Tidy&lt;/a&gt; plugin and let me know what you think.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/3333268918470787535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=3333268918470787535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/3333268918470787535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/3333268918470787535'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/10/announcement-tidy-plugin-for-rails.html' title='Announcement: Tidy Plugin for Rails'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-1985562263698147704</id><published>2009-10-16T08:32:00.000-07:00</published><updated>2009-10-16T09:02:40.962-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="factory_girl"/><category scheme="http://www.blogger.com/atom/ns#" term="mocha"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><category scheme="http://www.blogger.com/atom/ns#" term="unit test"/><title type='text'>Unit Test: Take Two, with factory_girl + Mocha</title><content type='html'>In my day job, I occasionally interface with a group of Java developers, who pride themselves in doing a darn good job of testing their own code.  We are talking about unit tests, functional tests, continuous integration tests, the whole shebang.&lt;br /&gt;&lt;br /&gt;I learnt about mocking from them (and was the target of many such jokes, e.g. &quot;So, here to be mocked some more?&quot;), and decided to try out some mocking frameworks for .NET, but am having time comprehending the role of mock objects in testing.  However, recently I was reading Recipe #55 in Advanced Rails Recipes, and was inspired.&lt;br /&gt;&lt;br /&gt;So when I took my reading to the web, largely driven/led by Google, I realized that mocha is another mocking framework that some prefer over flexmock.  I looked into it a bit, and decided that it is for me.&lt;br /&gt;&lt;br /&gt;Now, like many, I have come to dislike fixtures for complex test cases where multiple instances of multiple models are involved.  But I do believe that fixtures have a role.  The way I look at it, if you find that you set up the same data over and over again in your tests, maybe it&#39;s time to push them into fixtures.&lt;br /&gt;&lt;br /&gt;Anyhow, instead of using fixtures, I have been using ThoughtBot&#39;s factory_girl to create my test objects, and am loving it.&lt;br /&gt;&lt;br /&gt;Furthermore, someone challenged me to rip out all my test code and re-write them since they are woefully out-of-date and no longer pass.  But part of my failure to keep my test code fresh was due to frustration with fixtures.&lt;br /&gt;&lt;br /&gt;So now, armed with factory_girl and Mocha, I wiped my test slate clean (removed almost all my test code and fixtures), and am starting over.&lt;br /&gt;&lt;br /&gt;To start things off, I decided to do something akin to that recipe in the ARR book, like so:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;# test/unit/project_test.rb&lt;br /&gt;&lt;br /&gt;require &#39;test_helper&#39;&lt;br /&gt;require &#39;mocha&#39;&lt;br /&gt;&lt;br /&gt;class ProjectTest &lt; ActiveSupport::TestCase&lt;br /&gt;&lt;br /&gt;  test &quot;create&quot; do&lt;br /&gt;    p = Factory.build(:project)&lt;br /&gt;    assert p.valid?&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  test &quot;use mocha to simulate failure&quot; do&lt;br /&gt;    p = Factory.build(:project)&lt;br /&gt;    p.expects(:valid?).returns(false)&lt;br /&gt;    assert p.invalid?&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;/pre&gt;&lt;/blockquote&gt;Now let&#39;s run it:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;% rake test:units&lt;br /&gt;----- &amp;lt;snipped&amp;gt; -----&lt;br /&gt;Started&lt;br /&gt;........................&lt;br /&gt;Finished in 0.179492 seconds.&lt;br /&gt;&lt;br /&gt;24 tests, 41 assertions, 0 failures, 0 errors&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Nice!  Of course I am not yet certain how mocking applies to unit tests, but I will forge ahead and see how things go.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/1985562263698147704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=1985562263698147704' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1985562263698147704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1985562263698147704'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/10/test-code-take-two-factorygirl-mocha.html' title='Unit Test: Take Two, with factory_girl + Mocha'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-5512494236180680337</id><published>2009-08-11T12:33:00.000-07:00</published><updated>2009-10-30T14:38:50.587-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="book"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Learning Ruby and Rails</title><content type='html'>I get occasional messages via &lt;a href=&quot;http://meebo.com&quot;&gt;meebo&lt;/a&gt; (which I love) from folks who have stumbled across this blog, most of them are Ruby and/or Rails related.&lt;br /&gt;&lt;br /&gt;Recently a message came in about learning Ruby, and by extension, I am assuming Ruby on Rails.&lt;br /&gt;&lt;br /&gt;Here&#39;s the route I took:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The &lt;a href=&quot;http://pragprog.com/titles/ruby/programming-ruby&quot;&gt;Pick-axe book&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition&quot;&gt;Agile Web Development with Rails&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;After that, it comes down to lots and lots of practice, all 10,000 hours worth (if you are a fan of &lt;a href=&quot;http://en.wikipedia.org/wiki/Outliers_%28book%29&quot;&gt;Outliers&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;For completeness sake, though, I&#39;ve also read at least portions of the following books that are Rails related:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://pragprog.com/titles/fr_arr/advanced-rails-recipes&quot;&gt;Advanced Rails Recipes&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/Flexible-Rails-Flex-Peter-Armstrong/dp/1933988509/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1250023404&amp;sr=1-1&quot;&gt;Flexible Rails: Flex 3 on Rails 2&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-Ruby/dp/0321445619/ref=sr_1_1?ie=UTF8&amp;qid=1250023348&amp;sr=8-1&quot;&gt;The Rails Way&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/5512494236180680337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=5512494236180680337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5512494236180680337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5512494236180680337'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/08/learning-ruby-and-rails.html' title='Learning Ruby and Rails'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-62644840998523247</id><published>2009-06-17T11:49:00.001-07:00</published><updated>2009-06-17T12:07:08.321-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="macports"/><category scheme="http://www.blogger.com/atom/ns#" term="miscellaneous"/><title type='text'>The unfurl Script</title><content type='html'>I am ashamed to say that I recently fell &lt;i&gt;victim&lt;/i&gt; to a &lt;a href=&quot;http://en.wikipedia.org/wiki/Rickroll&quot;&gt;rickrolling&lt;/a&gt; prank, because the not-so-innocent URL was given to me by someone I know.&lt;br /&gt;&lt;br /&gt;Then I came across the &lt;a href=&quot;http://gumbynet.org.uk/software/furl.html&quot;&gt;furl&lt;/a&gt; utility (easily installed on my systems using &lt;a href=&quot;http://macports.org/&quot;&gt;MacPorts&lt;/a&gt;), which gave me an idea.&lt;br /&gt;&lt;br /&gt;From now on, when I see another such URL, I will just run a simple &lt;tt&gt;unfurl&lt;/tt&gt; script to unroll it.  The script simply does the following:&lt;br /&gt;&lt;pre&gt;    furl http://tinyurl.com/n2o29e \&lt;br /&gt;      | grep -e &quot;^Location&quot;&lt;/pre&gt;There!  Short and sweet.&lt;br /&gt;&lt;br /&gt;Now if someone can come up with a system utility, iChat or browser plug-in that can unroll the URL for me, or perhaps if such a thing already exists, please let me know.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/62644840998523247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=62644840998523247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/62644840998523247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/62644840998523247'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/06/unfurl-script.html' title='The &lt;tt&gt;unfurl&lt;/tt&gt; Script'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-1295960575528310377</id><published>2009-06-05T09:41:00.001-07:00</published><updated>2009-06-05T10:30:51.059-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="freeciv"/><title type='text'>Freeciv Packaging Troubles</title><content type='html'>I have been having increasing issues in maintaining my Freeciv package.&lt;br /&gt;&lt;br /&gt;Recently, when I upgraded my MacPorts installation along with all my ports (which I have neglected to do so for 12+ months), things have changed sufficiently to have broken my current process, beyond my ability to rectify.&lt;br /&gt;&lt;br /&gt;This means until I figure out a way, there will not be any forthcoming Freeciv packages from me.&lt;br /&gt;&lt;br /&gt;In the meantime, for those of you who have wrote me indicating interest in compiling Freeciv for yourselves, the easiest way to get going would be to install it using &lt;a href=&quot;http://macports.org/&quot;&gt; MacPorts &lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Good luck!</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/1295960575528310377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=1295960575528310377' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1295960575528310377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1295960575528310377'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2009/06/freeciv-packaging-troubles.html' title='Freeciv Packaging Troubles'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-1128132501384895375</id><published>2008-12-15T07:46:00.000-08:00</published><updated>2008-12-15T07:51:17.437-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac os x"/><category scheme="http://www.blogger.com/atom/ns#" term="shell script"/><category scheme="http://www.blogger.com/atom/ns#" term="terminal"/><title type='text'>Faster New Terminal Tab/Window Scripts</title><content type='html'>Reader Eric Allen &lt;a href=&quot;http://the-banana-peel.saltybanana.com/2008/02/new-terminal-tab-in-current-directory.html&quot;&gt;commented&lt;/a&gt; on a &lt;a href=&quot;http://gist.github.com/35556&quot;&gt;shell script&lt;/a&gt; he&#39;s written to create new terminal tabs in Leopard faster.  Very cool.&lt;br /&gt;&lt;br /&gt;Thanks, Eric!</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/1128132501384895375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=1128132501384895375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1128132501384895375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/1128132501384895375'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2008/12/faster-new-terminal-tabwindow-scripts.html' title='Faster New Terminal Tab/Window Scripts'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-4495202729403755934</id><published>2008-12-05T08:34:00.000-08:00</published><updated>2008-12-05T09:24:08.294-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="mac os x"/><category scheme="http://www.blogger.com/atom/ns#" term="macports"/><category scheme="http://www.blogger.com/atom/ns#" term="mod_rails"/><category scheme="http://www.blogger.com/atom/ns#" term="passenger"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Passenger Rocks!</title><content type='html'>I am referring to, of course, to &lt;a href=&quot;http://www.modrails.com/&quot;&gt;Phusion Passenger&lt;/a&gt;, a.k.a. mod_rails.&lt;br /&gt;&lt;br /&gt;Prior to using Passenger, I had been serving up a Rails web application I&#39;ve been working on using mongrel.  However, I am anticipating more people hitting it (compared to just me and one other person), so I thought it&#39;s time to move up to something more robust.&lt;br /&gt;&lt;br /&gt;The server platform I am using is the latest version of Tiger (client edition).  I already have &lt;a href=&quot;http://macports.org/&quot;&gt;MacPorts&lt;/a&gt; installed in order to get Ruby and Rails.  So, after installing Apache 2 using the &lt;tt&gt;port&lt;/tt&gt; command, I simply followed the instructions on Passenger&#39;s web site and installed the passenger gem and the Apache module, and was serving up my application via a sub-URI in very little time.  This is significant because I am not very versed in Apache configuration!&lt;br /&gt;&lt;br /&gt;One suggestion.  If you are using Tiger, don&#39;t bother following the link from the Passenger documentation to some guy&#39;s blog about setting up Passenger for Leopard.  Just stick to the official docs.&lt;br /&gt;&lt;br /&gt;As for performance relative to mongrel, it remains to be seen when the app is under some load.  But when I first practiced this on an ancient 400MHz G4 running Tiger, I noticed a 2x jump in performance.  That is, Apache2+Passenger with one user hitting the server is able to serve up pages twice as fast as a single instance of mongrel (using the &lt;tt&gt;-d -e production&lt;/tt&gt; flags) with only one user.  The same can&#39;t be said of the actual deployment machine, both serving methods yielded similar times for the one-user test.&lt;br /&gt;&lt;br /&gt;Furthermore, after I figured out the deployment steps, I wrote a simple Python script to automate it.  Yes, I know I can use capistrano.  But my deployment scenario is to simple right now that I simply don&#39;t need it.&lt;br /&gt;&lt;br /&gt;One note on deployment.  After you execute &lt;tt&gt;sudo apachectl start&lt;/tt&gt; (or &lt;tt&gt;restart&lt;/tt&gt;), it takes a long time to load the first page.  That&#39;s probably when Apache is loading stuff into memory.  After, it&#39;s all good.  So I added a &lt;tt&gt;curl&lt;/tt&gt; command as the last step to my deployment script to kick-start things.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/4495202729403755934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=4495202729403755934' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4495202729403755934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/4495202729403755934'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2008/12/passenger-rocks.html' title='Passenger Rocks!'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-5427409737225057044</id><published>2008-09-07T23:07:00.000-07:00</published><updated>2008-09-08T16:01:34.644-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="freeciv"/><title type='text'>Freeciv 2.1.6</title><content type='html'>I built my package of &lt;a href=&quot;http://freeciv.org/&quot;&gt;Freeciv 2.1.6&lt;/a&gt; for Mac OS X for those who are interested.&lt;br /&gt;&lt;br /&gt;Enjoy!</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/5427409737225057044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=5427409737225057044' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5427409737225057044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/5427409737225057044'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2008/09/freeciv-216.html' title='Freeciv 2.1.6'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-6341407993994582367</id><published>2008-08-22T10:57:00.000-07:00</published><updated>2008-08-22T20:34:23.971-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="prototype"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Tidy Javascripts</title><content type='html'>So I have been reading the &lt;a href=&quot;http://pragprog.com/titles/fr_arr/advanced-rails-recipes&quot;&gt;Advanced Rails Recipes&lt;/a&gt; book by Mike Clark.  Pretty good book.&lt;br /&gt;&lt;br /&gt;Recipe 19, Decouple JavaScript with Low Pro, uses &lt;a href=&quot;http://www.danwebb.net/&quot;&gt;Dan Webb&lt;/a&gt;&#39;s Low Pro Javascript library to pluck the behavior-oriented Javascripts out of the mark-up code and tuck them away into its own section or file.  We are basically talking about onxxx events.  Neat!&lt;br /&gt;&lt;br /&gt;However, the example in the recipe puts the behavior Javascript code in public/javascripts/application.js.  This is fine for globally applicable stuff.  What about code that is applicable only to views of a specific controller or just a single view?&lt;br /&gt;&lt;br /&gt;Taking a cue for my &lt;a href=&quot;http://the-banana-peel.saltybanana.com/2008/06/tidy-stylesheets-take-two.html&quot;&gt;Tidy Stylesheets&lt;/a&gt; post, I came up with the following:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;application_helper.rb&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;  def tidy_javascripts&lt;br /&gt;    @javascripts ||= []&lt;br /&gt;    [&quot;application&quot;, &quot;#{controller.controller_path}/_controller&quot;, &quot;#{controller.controller_path}/#{controller.action_name}&quot;].each do |javascript|&lt;br /&gt;      @javascripts &lt;&lt; javascript if File.exists? &quot;#{Dir.pwd}/public/javascripts/#{javascript}.js&quot;&lt;br /&gt;    end&lt;br /&gt;    @javascripts&lt;br /&gt;  end&lt;/pre&gt;Then, in my layouts, I just do this:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;some_layout.html.erb&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;%= javascript_include_tag &quot;prototype&quot; %&amp;gt;&lt;br /&gt;&amp;lt;%= javascript_include_tag &quot;effects&quot; %&amp;gt;&lt;br /&gt;&amp;lt;%= javascript_include_tag &quot;lowpro&quot; %&amp;gt;&lt;br /&gt;&amp;lt;%= javascript_include_tag tidy_javascripts %&amp;gt;&lt;/pre&gt;If you are interested in Low Pro, you can download it from Dan&#39;s web site.  It&#39;s a bit hard to get to, but I think the latest is &lt;a href=&quot;http://svn.danwebb.net/external/lowpro/tags/rel_0.5/dist/&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Oh, and for &lt;a href=&quot;http://jquery.com&quot;&gt;jQuery&lt;/a&gt; fans (I am torn between it and &lt;a href=&quot;http://prototypejs.org&quot;&gt;Prototype&lt;/a&gt;), there is a &lt;a href=&quot;http://github.com/danwrong/low-pro-for-jquery/tree/master&quot;&gt;port&lt;/a&gt; of Low Pro for jQuery.  You can read about &lt;a href=&quot;http://www.danwebb.net/2008/2/3/how-to-use-low-pro-for-jquery&quot;&gt;how to use it&lt;/a&gt;, too.&lt;br /&gt;&lt;br /&gt;What do you think?</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/6341407993994582367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=6341407993994582367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/6341407993994582367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/6341407993994582367'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2008/08/tidy-javascripts.html' title='Tidy Javascripts'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4172981932098931033.post-3720959902090020922</id><published>2008-08-22T10:52:00.000-07:00</published><updated>2008-08-22T10:57:24.428-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="miscellaneous"/><title type='text'>Busy, Busy, Busy...</title><content type='html'>Haven&#39;t added an entry in ... wow, over two months.&lt;br /&gt;&lt;br /&gt;What happened, you might ask.  Well, among others, I have been busying myself with two things:  Ruby on Rails (of course) and &lt;a href=&quot;http://oberin.com&quot;&gt;Oberin&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://the-banana-peel.saltybanana.com/feeds/3720959902090020922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4172981932098931033&amp;postID=3720959902090020922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/3720959902090020922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4172981932098931033/posts/default/3720959902090020922'/><link rel='alternate' type='text/html' href='http://the-banana-peel.saltybanana.com/2008/08/busy-busy-busy.html' title='Busy, Busy, Busy...'/><author><name>saltybanana</name><uri>http://www.blogger.com/profile/02266260856342765794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>