<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dribblings of a Deranged Hermit</title>
	<atom:link href="http://logaan.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://logaan.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 05 Jan 2012 08:03:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='logaan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Dribblings of a Deranged Hermit</title>
		<link>http://logaan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://logaan.wordpress.com/osd.xml" title="Dribblings of a Deranged Hermit" />
	<atom:link rel='hub' href='http://logaan.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Internet Explorer 7 gets Authenticity Token Invalid from Rails</title>
		<link>http://logaan.wordpress.com/2009/04/20/internet-explorer-7-gets-authenticity-token-invalid-from-rails/</link>
		<comments>http://logaan.wordpress.com/2009/04/20/internet-explorer-7-gets-authenticity-token-invalid-from-rails/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 09:17:51 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/?p=18</guid>
		<description><![CDATA[Recently we had an issue where a client was unable to access his CMS. He was receiving an error &#8217;422 The change you wanted was rejected&#8217;. This was the production pretty message, caused by an InvalidAuthenticityToken error. After much debugging, trying to turn off authenticity token filtering and removing before filters I took a stab in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=18&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently we had an issue where a client was unable to access his CMS. He was receiving an error <strong>&#8217;422 The change you wanted was rejected&#8217;</strong>. This was the production pretty message, caused by an <strong>InvalidAuthenticityToken error</strong>. After much debugging, trying to turn off authenticity token filtering and removing before filters I took a stab in the dark.</p>
<p><strong>The problem was that the site was on a sub-domain with an underscore in the name abcd_efgh.demosite.com</strong>. While all other browsers behaved perfectly, Internet Explorer 7 (and I believe 6 as well) had a tantrum and wouldn&#8217;t accept cookies. <strong>The solution was to change the site&#8217;s underscore to a hypen, making it abcd-efgh.demosite.com</strong>. Hope someone out there saves time time and hair with this one.</p>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=18&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2009/04/20/internet-explorer-7-gets-authenticity-token-invalid-from-rails/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
		<item>
		<title>Vim + Screen + iTerm with 256 colours</title>
		<link>http://logaan.wordpress.com/2009/04/07/vim-screen-iterm-with-256-colours/</link>
		<comments>http://logaan.wordpress.com/2009/04/07/vim-screen-iterm-with-256-colours/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 12:53:04 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/?p=14</guid>
		<description><![CDATA[I&#8217;ve recently started using screen and have been thoroughly liking it. One issue I had was getting my full colourscheme with vim to work properly. In the end I did get it working and here I&#8217;ll outline the combination of apps and configuration that did the trick. Install iTerm Build 0.9.6.1201 from the iterm page [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=14&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started using screen and have been thoroughly liking it. One issue I had was getting my full colourscheme with vim to work properly. In the end I did get it working and here I&#8217;ll outline the combination of apps and configuration that did the trick.</p>
<ol>
<li>Install iTerm Build 0.9.6.1201 from the <a href="http://iterm.sourceforge.net/download.shtml" target="_blank">iterm page on sourceforge</a>. At the time of writing Build 0.9.6.20090328 was available but it cut the bottom off my letters.</li>
<li>Open up &#8216;Manage Profiles&#8217; in the bookmarks menu (or alt-cmd-b), expand the &#8216;Terminal Profiles&#8217; menu and select &#8216;Default&#8217;. Now set &#8216;type&#8217; to xterm-256color. It should be in the drop down.</li>
<li>Download screen from <a href="http://pjkh.com/assets/12/screen-4.0.3.tgz" target="_blank">Philip Halstrom&#8217;s site</a> and extract the files.</li>
<li>Open terminal cd into the directory with the screen files and run:
<pre>  $ ./configure --enable-locale \
     --enable-telnet \
     --enable-colors256 \
     --enable-rxvt_osc \
     --prefix=/usr/local
  $ make
  $ make install</pre>
</li>
<li>Now edit your screen config file &#8216;~/.screenrc&#8217; and add the following lines:
<pre>  startup_message off

  #terminfo and termcap for nice 256 color terminal
  # allow bold colors - necessary for some reason
  attrcolor b ".I"
  # erase background with current bg color
  defbce "on"</pre>
</li>
<li>Now add the following lines to your vim config &#8216;~/.vimrc&#8217;, in this example I&#8217;ve included my colourscheme; railscasts. Make sure the first line in this example comes before any color configuration in your vimrc file.
<pre>  set t_Co=256
  colorscheme railscasts</pre>
</li>
</ol>
<p>A good deal of the information in this post came from <a href="http://pjkh.com/articles/2008/07/09/osx-iterm-screen-vim-256-colors" target="_blank">Philip Halstrom&#8217;s post</a>. He includes a few more lines in his screenrc, these caused jumbled letters to appear in my terminal. I&#8217;m guessing they addressed an issue with an older version of iterm that has since been resolved.</p>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=14&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2009/04/07/vim-screen-iterm-with-256-colours/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating Vim on OS X Leopard</title>
		<link>http://logaan.wordpress.com/2008/09/07/updating-vim-on-os-x-leopard/</link>
		<comments>http://logaan.wordpress.com/2008/09/07/updating-vim-on-os-x-leopard/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 13:46:59 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/?p=11</guid>
		<description><![CDATA[I recently tried to get vim up to version 7.2 on leopard (so that i could get vimball working and install plugins). In the end I settled for using the copy of vim that comes with MacVim and setting up an alias: alias vim='/Users/logaan/Downloads/MacVim-7_2-stable-1_2\ 2/MacVim.app/Contents/MacOS/Vim' But before I went to this extreme I tried: Port: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=11&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently tried to get vim up to version 7.2 on leopard (so that i could get vimball working and install plugins). In the end I settled for using the copy of vim that comes with MacVim and setting up an alias:</p>
<p><code>alias vim='/Users/logaan/Downloads/MacVim-7_2-stable-1_2\ 2/MacVim.app/Contents/MacOS/Vim'</code></p>
<p>But before I went to this extreme I tried:</p>
<ul>
<li>Port: The files downloaded didn&#8217;t match the checksum.</li>
<li>Fink: The version was old but installed properly. Then didn&#8217;t work.</li>
<li>Manual Compile: Didn&#8217;t setup the right paths for plugins, etc.</li>
</ul>
<p>If you want to do it my way grab the latest version of MacVim from http://code.google.com/p/macvim/ install, then right click on MacVim.app and show contents. Navigate into the MacOS folder and you should see &#8216;Vim&#8217;. Open up <code>~/.bash_profile</code> in your favorite text editor and type <code>alias vim=''</code> then drag the &#8216;Vim&#8217; application between the quotes. It should insert the full path to the app.</p>
<p>It&#8217;s not pretty, but it works.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/logaan.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/logaan.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=11&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2008/09/07/updating-vim-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
		<item>
		<title>Eager to please annonymous objects</title>
		<link>http://logaan.wordpress.com/2008/09/06/eager-to-please-annonymous-objects/</link>
		<comments>http://logaan.wordpress.com/2008/09/06/eager-to-please-annonymous-objects/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 16:46:07 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[metaprogramming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/?p=9</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of unit testing recently, and often find myself wishing that my mock objects actually had a state. So I could push a dumb object into the system and have a look at it when it comes out, without needing to tightly couple the stubbed methods on it to the implimentation. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=9&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of unit testing recently, and often find myself wishing that my mock objects actually had a state. So I could push a dumb object into the system and have a look at it when it comes out, without needing to tightly couple the stubbed methods on it to the implimentation. So I&#8217;ve written up a little method that&#8217;ll help you do exactly that. It allows for javascript style annonymous objects. As soon as you try to write to an attribute or read from one the getters and setters for that attribute are created.</p>
<pre>
def annon
  # Create a new blank, basic object
  annonymous_object = Object.new

  # If a attribute is called on this object that doesn't exist
  # we want to fake it
  def annonymous_object.method_missing name, *args
    # Figure out the base name of the attribute
    method_name = name.to_s[/[^=]*/]

    # Define the getter and setter
    self.instance_eval &lt;&lt;-METHODS
      def #{method_name}= value
        @#{method_name} = value
      end
      def #{method_name}
        @#{method_name}
      end
    METHODS

    # Call the attribute again
    send name, *args
  end

  # Now that we've created our annonymous object
  # we'll pass it to the block. Here attributes and
  # default values to be added to the object.
  yield annonymous_object if block_given?

  # Finally return the object we've built
  annonymous_object
end
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/logaan.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/logaan.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=9&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2008/09/06/eager-to-please-annonymous-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamically Loaded Classes</title>
		<link>http://logaan.wordpress.com/2008/02/20/dynamically-loaded-classes/</link>
		<comments>http://logaan.wordpress.com/2008/02/20/dynamically-loaded-classes/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 13:43:45 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[metaprogramming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/?p=8</guid>
		<description><![CDATA[Defining the class name of rails models when we&#8217;ve already named the file didn&#8217;t seem very DRY to me. So I wanted to find out if I could load files into a class named after the file (ie. Products.rb gets loaded in to Product class) #!/usr/bin/env ruby # Loop over all ruby files in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=8&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Defining the class name of rails models when we&#8217;ve already named the file didn&#8217;t seem very DRY to me. So I wanted to find out if I could load files into a class named after the file (ie. Products.rb gets loaded in to Product class)</p>
<pre>
#!/usr/bin/env ruby

# Loop over all ruby files in the classes directory
Dir["classes/*.rb"].map do |file_name|
  # Save file name without extention or directories
  class_name = file_name[/[^\/]*(?=\.)/].to_sym

  # Execute the contents of the file inside a blank object
  class_object = Class.new
  class_object.instance_eval(File::read(file_name))

  # Bind the class to the name at the highest level
  Kernel.const_set(class_name, class_object)
end
</pre>
<p>This assumes that you have a bunch of ruby files inside a sub directory called &#8216;classes&#8217; and all your ruby files have &#8216;.rb&#8217; extension.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/logaan.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/logaan.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=8&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2008/02/20/dynamically-loaded-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
		<item>
		<title>Quicksilver rails project opener (revisited)</title>
		<link>http://logaan.wordpress.com/2008/01/16/quicksilver-rails-project-opener-revisited/</link>
		<comments>http://logaan.wordpress.com/2008/01/16/quicksilver-rails-project-opener-revisited/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 09:26:46 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iterm]]></category>
		<category><![CDATA[quicksilver]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[textmate]]></category>
		<category><![CDATA[zigversion]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/2008/01/16/quicksilver-rails-project-opener-revisited/</guid>
		<description><![CDATA[I&#8217;ve switched my terminal over from Terminal to iTerm and my subversion client from SVNX to ZigVersion. So I re-wrote my opener for these new apps. Installation and such should be the same as the original. #!/usr/bin/env ruby ##################################################################### # This script will load all the common applications used for # developing rails. It may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=7&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve switched my terminal over from Terminal to iTerm and my subversion client from SVNX to ZigVersion. So I re-wrote my opener for these new apps. Installation and such should be the same as the original.</p>
<pre>#!/usr/bin/env ruby

#####################################################################
# This script will load all the common applications used for
# developing rails. It may be triggered by quicksilver or console.
# The full path of the project to open should be the first argument.
#
# FixMe: If iTerm is not open an unwanted window is created
#
# Applications that will be loaded:
#   Textmate at project
#   Projects mongrel server
#   Projects rails console
#   Blank console in project dir
#   Firefox at project
#   ZigVersion
#####################################################################

# Load files required for appscrpt
require "rubygems"
require "appscript"
include Appscript

# Define arrays and grab project path
tabs    = []
threads = []
project = ARGV[0]
# project = "~/Programming/rails/code_library"

# Do iterm stuff in one thread
threads &lt;&lt; Thread.new do
  # Make a new iTerm window
  window = Appscript::app('iTerm').end.make(:new=&gt;:terminal)

  # Create three new tabs and store in sessions array
  3.times do
    window.launch_(:session =&gt; 'default')
    tabs &lt;&lt; window.sessions.last.get
  end

  # Change each tab to project path
  tabs.each { |tab| tab.write(:text =&gt; "cd #{project}") }

  # Start textmate, server and console from tabs
  tabs[0].write(:text =&gt; "mate ."         )
  tabs[1].write(:text =&gt; "script/server"  )
  tabs[2].write(:text =&gt; "script/console" )
end

# Open ZigVersion and Firefox, each in their own thread
threads &lt;&lt; Thread.new { Appscript::app("Firefox").OpenURL("http://localhost:3000") }
threads &lt;&lt; Thread.new { Appscript::app('ZigVersion').activate                      }

# Join threads together to stop premature termination
threads.each { |thread| thread.join }</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/logaan.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/logaan.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=7&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2008/01/16/quicksilver-rails-project-opener-revisited/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP style boolean expressions with Ruby</title>
		<link>http://logaan.wordpress.com/2008/01/08/php-style-boolean-expressions-with-ruby/</link>
		<comments>http://logaan.wordpress.com/2008/01/08/php-style-boolean-expressions-with-ruby/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 22:37:40 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/2008/01/08/php-style-boolean-expressions-with-ruby/</guid>
		<description><![CDATA[I&#8217;ve come to ruby and rails from php. By and large I&#8217;m loving the switch but a few things I miss. One of the big ones is that ruby evaluates an empty string and the number 0 to be true in boolean expressions. So I wrote a quick way around it. class String   def [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=6&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come to ruby and rails from php. By and large I&#8217;m loving the switch but a few things I miss. One of the big ones is that ruby evaluates an empty string and the number 0 to be true in boolean expressions.</p>
<p>So I wrote a quick way around it.</p>
<pre>class String

  def to_b

    self.length &gt; 0

  end

endclass Integer

  def to_b

    self != 0

  end

end</pre>
<p>Now if you want to check if a string or integer would be considered false by PHP just call to_b on it. Example:</p>
<pre>"Desu".to_b #true

"".to_b #false

10.to_b #true

0.to_b #false</pre>
<p>Simple but it does the job .</p>
<p><b>Update: </b>You can just use  <code>empty?</code> for strings</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/logaan.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/logaan.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=6&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2008/01/08/php-style-boolean-expressions-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
		<item>
		<title>Quicksilver Action : Open Rails Project</title>
		<link>http://logaan.wordpress.com/2008/01/06/quicksilver-action-open-rails-project/</link>
		<comments>http://logaan.wordpress.com/2008/01/06/quicksilver-action-open-rails-project/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 12:00:09 +0000</pubDate>
		<dc:creator>logaan</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[apple script]]></category>
		<category><![CDATA[quicksilver]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://logaan.wordpress.com/2008/01/06/quicksilver-action-open-rails-project/</guid>
		<description><![CDATA[I&#8217;ve been doing tonnes of rails coding lately and absolutely loving it! I noticed that my work flow wasn&#8217;t all that DRY though; Every time I start working on an app I open up the same stuff: The app as a project in Textmate (mate .) The app server (script/server) The app console (script/console) A [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=4&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing tonnes of rails coding lately and absolutely loving it! I noticed that my work flow wasn&#8217;t all that DRY though; Every time I start working on an app I open up the same stuff:</p>
<ul>
<li>The app as a project in Textmate (mate .)</li>
<li>The app server (script/server)</li>
<li>The app console (script/console)</li>
<li>A blank terminal (sc&#8230; wait.. no)</li>
<li>Firefox (http://localhost:3000/)</li>
</ul>
<p>So I wrote a quicksilver action that does it all for me!</p>
<pre>
#!/usr/bin/env ruby

require "rubygems"
require "appscript"
include Appscript

# Grab the project location from the command line / quicksilver
project = ARGV[0]

# Initialize variables
term = app("Terminal")
ff   = app("Firefox")
threads = []

# Activate terminal and firefox
# This will open a new window if the app was not already
# open, which can result in one too many windows
term1 = term.activate

# So we'll close the first window if there is one
term.windows[0].close unless term.windows.get.to_s == ""

# Open up a terminal window at the project.
# Then open the project in textmate from
# the terminal, all in it's own thread
threads &lt;&lt; Thread.new do
  term3 = term.do_script("cd " + project)
  term.do_script("mate .", :in =&gt; term3)
end

threads &lt;&lt; Thread.new do
  term1 = term.do_script("cd " + project)
  term.do_script("script/server", :in =&gt; term1)
end

threads &lt;&lt; Thread.new do
  term2 = term.do_script("cd " + project)
  term.do_script("script/console", :in =&gt; term2)
end

threads &lt;&lt; Thread.new do
  ff.OpenURL("http://localhost:3000")
end

# Join all of the threads to the main one
# This stops the script exiting before all
# threads have finished
threads.each do |thread|
  thread.join
end</pre>
<p>To Install:</p>
<ul>
<li>Install the appscript gem with &#8220;gem install rb-appscript&#8221;</li>
<li>Copy script to &#8220;~/Library/Application Support/Quicksilver/Actions/Open Rails Project.rb&#8221; (you&#8217;ll need to create the file)</li>
<li>Restart quicksilver</li>
</ul>
<p>To Use:</p>
<ul>
<li>Use Quicksilver to navigate to your project folder</li>
<li>Select &#8220;Open Rails Project&#8221; as the action.</li>
</ul>
<p>Enjoy!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/logaan.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/logaan.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/logaan.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/logaan.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/logaan.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/logaan.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/logaan.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/logaan.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/logaan.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/logaan.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/logaan.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/logaan.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/logaan.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/logaan.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/logaan.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/logaan.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=logaan.wordpress.com&amp;blog=2458333&amp;post=4&amp;subd=logaan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://logaan.wordpress.com/2008/01/06/quicksilver-action-open-rails-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34a447a65dedcf57a31abb53f9aac115?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">logaan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
