<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 <title>The Grand Adventure of Clinton R. Nixon</title>
 <link href="http://crnixon.org/atom.xml" rel="self"/>
 <link href="http://crnixon.org/"/>
 <updated>2010-01-21T12:39:47-08:00</updated>
 <id>http://crnixon.github.com/</id>
 <author>
   <name>Clinton R. Nixon</name>
   <email>crnixon@gmail.com</email>
 </author>

 
 <entry>
   <title>What I Learned Today - 2009-12-14</title>
   <link href="http://crnixon.github.com/log/2009/12/14/today.html"/>
   <updated>2009-12-14T00:00:00-08:00</updated>
   <id>http://crnixon.github.com/log/2009/12/14/today</id>
   <content type="html">&lt;p&gt;The most important thing I learned today wasn't about programming: &lt;a href=&quot;http://www.onlineeducation.net/bottled_water/&quot;&gt;it was about bottled water&lt;/a&gt;. Kind of terrifying from a waste level and a health level.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>What I Learned Today - 2009-12-11</title>
   <link href="http://crnixon.github.com/log/2009/12/11/today.html"/>
   <updated>2009-12-11T00:00:00-08:00</updated>
   <id>http://crnixon.github.com/log/2009/12/11/today</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.engineyard.com/blog/2009/ready-set-go/&quot;&gt;This post from EngineYard on Google Go&lt;/a&gt; makes me want to learn it something fierce. I'm planning on curling up with it and &lt;a href=&quot;http://rubyconf2009.confreaks.com/19-nov-2009-10-25-just-for-fun-rediscovering-coding-as-a-hobby-adam-keys.html&quot;&gt;Adam Keys' &lt;em&gt;Just For Fun&lt;/em&gt; video&lt;/a&gt; this cold weekend by a warm fire.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>What I Learned Today - 2009-12-10</title>
   <link href="http://crnixon.github.com/log/2009/12/10/today.html"/>
   <updated>2009-12-10T00:00:00-08:00</updated>
   <id>http://crnixon.github.com/log/2009/12/10/today</id>
   <content type="html">&lt;p&gt;I needed to introspect on a Ruby method and find out the names of its arguments for a project I'm working on, and realized Ruby's own introspection wouldn't let me get this info. After some Googling, I found that &lt;a href=&quot;http://github.com/merb/merb/tree/07da12e62f5be186758fb322e7e28e6eda600a40/merb-action-args/lib/merb-action-args&quot;&gt;Merb has this functionality&lt;/a&gt;. I didn't want to include all of Merb in my project, so &lt;a href=&quot;http://github.com/crnixon/get_args&quot;&gt;I've extracted it&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Dummy&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;one_arg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;multiple_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;baz&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;optional_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;star_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Dummy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instance_method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:one_arg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_args&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# =&amp;gt; [[[:foo]], []]&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Dummy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instance_method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:multiple_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_args&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# =&amp;gt; [[[:foo], [:bar], [:baz]], []]&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Dummy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instance_method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:optional_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_args&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# =&amp;gt; [[[:foo], [:bar, 1]], [:bar]]&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Dummy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;instance_method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:star_args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_args&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# =&amp;gt; [[[%s[*foo]]], []]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;You can &lt;a href=&quot;http://gemcutter.org/gems/get_args&quot;&gt;get the gem from Gemcutter&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>What I Learned Today - 2009-12-09</title>
   <link href="http://crnixon.github.com/log/2009/12/09/today.html"/>
   <updated>2009-12-09T00:00:00-08:00</updated>
   <id>http://crnixon.github.com/log/2009/12/09/today</id>
   <content type="html">&lt;p&gt;I love &lt;code&gt;emacsclient&lt;/code&gt; for opening files in Emacs from the command line, but closing those windows drives me nuts. I expect it just to work like killing any other buffer. With the help of some Googling, I put together this code today to close client buffers by using &lt;code&gt;C-x k&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;defun&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;close-client-window&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;interactive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;y-or-n-p&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Close client window? &amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;server-edit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add-hook&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;server-switch-hook&lt;/span&gt; 
          &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;lambda &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;current-local-map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;use-local-map&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;copy-keymap&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;current-local-map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))))&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;local-set-key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;kbd&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;C-x k&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;close-client-window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>What I Learned Today - 2009-12-08</title>
   <link href="http://crnixon.github.com/log/2009/12/08/today.html"/>
   <updated>2009-12-08T00:00:00-08:00</updated>
   <id>http://crnixon.github.com/log/2009/12/08/today</id>
   <content type="html">&lt;p&gt;I've been away from this too long, so I've picked a project to give me something to learn each day. I'm building a web-based &lt;a href=&quot;http://en.wikipedia.org/wiki/Roguelike&quot;&gt;Roguelike&lt;/a&gt; game. I've never built a computer game before, and I've got a lot to learn about sprites, collision detection, map generation, and other stuff.&lt;/p&gt;

&lt;p&gt;For today, I managed to build &lt;a href=&quot;/code/roguish-2009-12-08/&quot;&gt;a play area that you can move a character around in&lt;/a&gt;. Not impressive, but it's a solid first step. The cool thing I learned about is &lt;a href=&quot;http://gamequery.onaluf.org/&quot;&gt;gameQuery&lt;/a&gt;, a jQuery plug-in for developing games.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>What I Learned Today about Monit on a Laptop - 2009-09-17</title>
   <link href="http://crnixon.github.com/log/2009/09/17/today2.html"/>
   <updated>2009-09-17T00:00:00-07:00</updated>
   <id>http://crnixon.github.com/log/2009/09/17/today2</id>
   <content type="html">&lt;p&gt;I am not sure what has gotten into me, but I decided to set up &lt;a href=&quot;http://mmonit.com/monit/&quot;&gt;monit&lt;/a&gt; on my MacBook Pro. Monit's used for monitoring Unix systems, especially servers and the processes on those servers. I read &lt;a href=&quot;http://mmonit.com/monit/documentation/monit.pdf&quot;&gt;a presentation on Monit (PDF)&lt;/a&gt; that showed me how to monitor files for changes and then execute commands based off that, like reloading Apache whenever you edit your Apache configuration file. And then I thought, &quot;Why don't I do this on my laptop?&quot;&lt;/p&gt;

&lt;p&gt;There's only a few steps. The first is getting monit installed. It's not hard, and the tarball; ./configure; make; make install biz should work for you. If you like &lt;a href=&quot;http://github.com/mxcl/homebrew&quot;&gt;Homebrew&lt;/a&gt; like I like Homebrew, you can grab a recipe from &lt;a href=&quot;http://github.com/crnixon/homebrew/commit/fe27f730bcc5d29add10eae08b70413d5f5179b7&quot;&gt;this here commit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, configure monit. I put my monit configuration file in &lt;code&gt;/usr/local/etc/monitrc&lt;/code&gt;. I'll show it at the bottom of this post.&lt;/p&gt;

&lt;p&gt;My major issue was with mail delivery. If you have a SMTP server you want to use, you're set. If you want to use your OS X box as a mail server, you've got to reconfigure Postfix. By default, it only runs when files are put in &lt;code&gt;/var/spool/postfix/maildrop&lt;/code&gt;. Here's my configuration from &lt;code&gt;/System/Library/LaunchDaemons/org.postfix.master.plist&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;xml&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;  &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;plist&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;AbandonProcessGroup&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;KeepAlive&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Label&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;org.postfix.master&lt;span class=&quot;nt&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;OnDemand&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;false/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Program&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;/usr/libexec/postfix/master&lt;span class=&quot;nt&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProgramArguments&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;master&lt;span class=&quot;nt&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;QueueDirectories&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;array/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;RunAtLoad&lt;span class=&quot;nt&quot;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/plist&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Launchd&quot;&gt;Learn more about launchd&lt;/a&gt; so I won't have to post a giant slab of XML again.&lt;/p&gt;

&lt;p&gt;Once I got mail delivery going (you might need to edit &lt;code&gt;/etc/aliases&lt;/code&gt; and then run &lt;code&gt;sudo postalias /etc/aliases; sudo postfix reload&lt;/code&gt;) and mutt installed to check my mail, which I leave as an exercise to the reader, I was set. I dropped the following configuration in &lt;code&gt;/usr/local/etc/monitrc&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;set daemon 120
set logfile syslog facility log_daemon
set alert cnixon@localhost
set mail-format { from: monit@moro.local }
set mailserver localhost
set httpd port 2812 and use address localhost
    allow localhost   # Allow localhost to connect

check directory vhosts path /etc/apache2/passenger_pane_vhosts
  if changed timestamp
    then exec &quot;/usr/sbin/apachectl graceful&quot;

check directory apache_conf path /etc/apache2/other
  if changed timestamp
    then exec &quot;/usr/sbin/apachectl graceful&quot;

check file monitrc path /usr/local/etc/monitrc
  if changed timestamp
    then exec &quot;/usr/local/bin/monit reload&quot;

check device MacintoshHD with path /
  if space usage &amp;gt; 90% 
    then exec &quot;/usr/local/bin/growlnotify -m \
      'Your harddrive is getting full' 'MONIT SAY'&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Check out the PDF presentation above, or the Monit documentation if a line doesn't make sense. The summary:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When I add or remove any files from /etc/apache2/passenger_pane_vhosts or /etc/apache2/other, Apache gets reloaded. I'd like it to do this whenever a file is changed in either one, but monit doesn't easily support file globs. Maybe I should write a script to write my monit conf.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When I change &lt;code&gt;monitrc&lt;/code&gt;, monit reloads it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If my hard drive starts to get full, Growl tells me about it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>New Post About MongoDB on Viget Extend - 2009-09-17</title>
   <link href="http://crnixon.github.com/log/2009/09/17/today.html"/>
   <updated>2009-09-17T00:00:00-07:00</updated>
   <id>http://crnixon.github.com/log/2009/09/17/today</id>
   <content type="html">&lt;p&gt;Check out &lt;a href=&quot;http://www.viget.com/extend/getting-started-with-mongodb-mongomapper/&quot;&gt;my post on MongoDB and MongoMapper at Viget Extend&lt;/a&gt; today.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>What I Learned Today - 2009-09-16</title>
   <link href="http://crnixon.github.com/log/2009/09/16/today.html"/>
   <updated>2009-09-16T00:00:00-07:00</updated>
   <id>http://crnixon.github.com/log/2009/09/16/today</id>
   <content type="html">&lt;p&gt;I continued adding stuff to my &lt;a href=&quot;http://github.com/wycats/thor&quot;&gt;thor&lt;/a&gt; bandolier today, including some sweet meta-tasks to help deal with thor. &lt;a href=&quot;http://github.com/crnixon/thor_tasks&quot;&gt;Check them out at my git repo for my thor tasks.&lt;/a&gt; One thing to especially look at is &lt;code&gt;provision.thor&lt;/code&gt;. I had no idea until today that you can make a &lt;code&gt;.thor&lt;/code&gt; directory with a &lt;code&gt;main.thor&lt;/code&gt; file inside to drive it.&lt;/p&gt;

&lt;p&gt;My zsh completion for thor quest continues. It is still breaking me - three hours already, and not satisfied - but I'm making progress. Here's the latest:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;#compdef thor&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# List of commands built into thor.&lt;/span&gt;
_thor_commands&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  _values &lt;span class=&quot;s2&quot;&gt;&amp;quot;Thor&amp;quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;list&amp;quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;install&amp;quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;uninstall&amp;quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;help&amp;quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;installed&amp;quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;update&amp;quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Get list of all thor tasks added.&lt;/span&gt;
_thor_tasks&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  compadd &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;thor list | grep -vP &lt;span class=&quot;s1&quot;&gt;&amp;#39;^[\#\-]|^\s*$&amp;#39;&lt;/span&gt; | 
    sed -e &lt;span class=&quot;s1&quot;&gt;&amp;#39;1d&amp;#39;&lt;/span&gt; -e &lt;span class=&quot;s1&quot;&gt;&amp;#39;s/[^a-zA-Z0-9_\-\:].*$//&amp;#39;&lt;/span&gt; | grep -v &lt;span class=&quot;s1&quot;&gt;&amp;#39;^\n$&amp;#39;&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Normally, show all of the above.&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;((&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;CURRENT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; 2 &lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;  &lt;/span&gt;_thor_commands
  _thor_tasks
&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# If we&amp;#39;ve typed &amp;#39;thor install&amp;#39;, let us look for a normal file.&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$words&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; install &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt; ; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;    &lt;/span&gt;_files
  &lt;span class=&quot;c&quot;&gt;# If we&amp;#39;ve typed &amp;#39;thor help&amp;#39;, just show us the built in thor commands.&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;elif&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$words&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;help&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt; ; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;    &lt;/span&gt;_thor_commands
  &lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>What I Learned Today - 2009-09-15</title>
   <link href="http://crnixon.github.com/log/2009/09/15/today.html"/>
   <updated>2009-09-15T00:00:00-07:00</updated>
   <id>http://crnixon.github.com/log/2009/09/15/today</id>
   <content type="html">&lt;p&gt;I spent some time this afternoon thinking about automation with Ruby. Even though I used to use it a lot, I've fallen off on using &lt;a href=&quot;http://github.com/wycats/thor&quot;&gt;Thor&lt;/a&gt;, mainly because of API changes in Thor, and my move to zsh. I ported my bash completion script for thor to zsh, and it was way easier than bash:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;_thor&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  compadd &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;thor list | grep -vP &lt;span class=&quot;s1&quot;&gt;&amp;#39;^[\#\-]|^\s*$&amp;#39;&lt;/span&gt; | 
    sed -e &lt;span class=&quot;s1&quot;&gt;&amp;#39;1d&amp;#39;&lt;/span&gt; -e &lt;span class=&quot;s1&quot;&gt;&amp;#39;s/[^a-zA-Z0-9_\-\:].*$//&amp;#39;&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

compdef _thor thor
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>What I Learned Today - 2009-09-11</title>
   <link href="http://crnixon.github.com/log/2009/09/11/today.html"/>
   <updated>2009-09-11T00:00:00-07:00</updated>
   <id>http://crnixon.github.com/log/2009/09/11/today</id>
   <content type="html">&lt;p&gt;I've been using Ruby 1.9.1 as my primary Ruby on my box for a week now, and no real problems. The only major issue I've had was that the Mongrel gem wouldn't install. I found &lt;a href=&quot;http://github.com/taf2/mongrel/tree/master&quot;&gt;a patched version of Mongrel for Ruby 1.9&lt;/a&gt; this morning, and am in business now.&lt;/p&gt;
</content>
 </entry>
 
 
</feed>