<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><description>The rants and ravings of Chad Humphries.</description><title>spicycode</title><generator>Tumblr (3.0; @spicycode)</generator><link>http://spicycode.com/</link><item><title>Languages of interest</title><description>&lt;p&gt;I’ve been tinkering with a lot of other languages recently, here are a few of them.  What languages are you looking at?&lt;/p&gt;
&lt;p&gt; &lt;a href="http://www.r-project.org/"&gt;R&lt;/a&gt;, &lt;a href="http://caml.inria.fr/"&gt;OCaml&lt;/a&gt;, &lt;a href="http://lisp.org"&gt;Lisp&lt;/a&gt;, and &lt;a href="http://www.iolanguage.com/"&gt;IO&lt;/a&gt;&lt;/p&gt;</description><link>http://spicycode.com/post/33107345</link><guid>http://spicycode.com/post/33107345</guid><pubDate>Mon, 28 Apr 2008 10:02:04 -0400</pubDate></item><item><title>Standing up: 100% complete</title><description>&lt;p&gt;Recently I decided to try a stand up desk again.  I’ve used one a few jobs previous where I had to assemble all manor of electronic devices and rather liked it.   At home this has the duel benefit of keeping me focused, and keeping my son out of my computer equipment.   &lt;/p&gt;
&lt;p&gt;I’ll keep you up to date with how it goes.  I’m interested to see how standing at home and sitting at work compare with regards to comfort.  &lt;/p&gt;</description><link>http://spicycode.com/post/33107015</link><guid>http://spicycode.com/post/33107015</guid><pubDate>Mon, 28 Apr 2008 09:58:13 -0400</pubDate></item><item><title>Safari 3.1 and Prototype breakage</title><description>&lt;a href="http://blog.caboo.se/articles/2008/3/21/safari-3-1-breaks-your-app"&gt;Safari 3.1 and Prototype breakage&lt;/a&gt;</description><link>http://spicycode.com/post/29553375</link><guid>http://spicycode.com/post/29553375</guid><pubDate>Sat, 22 Mar 2008 10:21:01 -0400</pubDate></item><item><title>Secrets is a very useful pref pane</title><description>&lt;a href="http://secrets.textdriven.com/"&gt;Secrets is a very useful pref pane&lt;/a&gt;: It has definitely kept me from having to store yet one more seldom used defaults write string in my brain.</description><link>http://spicycode.com/post/29077091</link><guid>http://spicycode.com/post/29077091</guid><pubDate>Mon, 17 Mar 2008 07:46:03 -0400</pubDate></item><item><title>"Install this to twitter from quicksilver"</title><description>“Install this to twitter from quicksilver”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://blog.deadbeaf.org/archives/1869"&gt;hogeLog » Quicksilver Twitter Plugin&lt;/a&gt;&lt;/em&gt;</description><link>http://spicycode.com/post/23136424</link><guid>http://spicycode.com/post/23136424</guid><pubDate>Sun, 06 Jan 2008 15:41:04 -0500</pubDate></item><item><title>Leopard and X11</title><description>&lt;a href="http://homepage.mac.com/sao1/X11/index.html"&gt;Leopard and X11&lt;/a&gt;: The ins and outs of leopard and x11.</description><link>http://spicycode.com/post/22860817</link><guid>http://spicycode.com/post/22860817</guid><pubDate>Wed, 02 Jan 2008 17:58:24 -0500</pubDate></item><item><title>No one told me there was a Ninjabread man game!  Too bad...</title><description>&lt;img src="http://media.tumblr.com/AKo9efQG03hnoyihdhTR8ovy_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;No one told me there was a Ninjabread man game!  Too bad it’s apparently one of the worst games of the year.</description><link>http://spicycode.com/post/22509917</link><guid>http://spicycode.com/post/22509917</guid><pubDate>Thu, 27 Dec 2007 20:34:00 -0500</pubDate></item><item><title>Taking Merb to Production</title><description>&lt;a href="http://www.benr75.com/articles/2007/12/24/taking_merb_to_production_nginx_evented_mongrel_capistrano"&gt;Taking Merb to Production&lt;/a&gt;</description><link>http://spicycode.com/post/22506733</link><guid>http://spicycode.com/post/22506733</guid><pubDate>Thu, 27 Dec 2007 19:25:33 -0500</pubDate></item><item><title>Safari 2.0.4 Side By Side With Safari 3 On Leopard</title><description>&lt;a href="http://tripledoubleyou.subtlegradient.com/stuff/Safari2/"&gt;Safari 2.0.4 Side By Side With Safari 3 On Leopard&lt;/a&gt;: Follow the link for steps</description><link>http://spicycode.com/post/20908844</link><guid>http://spicycode.com/post/20908844</guid><pubDate>Wed, 05 Dec 2007 13:34:00 -0500</pubDate></item><item><title>Hiding /Opt From Finder.App In OSX</title><description>&lt;p&gt;Simple way via the command line:  &lt;/p&gt;
&lt;pre&gt;sudo SetFile -a V /opt killall Finder &lt;/pre&gt;</description><link>http://spicycode.com/post/21960733</link><guid>http://spicycode.com/post/21960733</guid><pubDate>Tue, 04 Dec 2007 23:00:00 -0500</pubDate><category>osx</category></item><item><title>Flush your dns cache on leopard</title><description>&lt;a href="http://www.macosxhints.com/article.php?story=20071027100807321"&gt;Flush your dns cache on leopard&lt;/a&gt;: dscacheutil -flushcache.</description><link>http://spicycode.com/post/20816891</link><guid>http://spicycode.com/post/20816891</guid><pubDate>Tue, 04 Dec 2007 11:12:08 -0500</pubDate></item><item><title>Want to get FireFox 3 on OSX working well?</title><description>&lt;p&gt;&lt;b&gt;Step 1&lt;/b&gt;: Get &lt;a href="http://developer.mozilla.org/devnews/index.php/2007/11/19/firefox-3-beta-1-now-available-for-download/"&gt;FireFox 3&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2&lt;/b&gt;: Install the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/6050"&gt;Proto&lt;/a&gt; theme (it’s the soon to be default osx theme) &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3&lt;/b&gt;: Install the &lt;a href="http://fireclipse.xucia.com/"&gt;latest Firebug&lt;/a&gt; that is compatible with Firefox 3 &lt;/p&gt;</description><link>http://spicycode.com/post/20462799</link><guid>http://spicycode.com/post/20462799</guid><pubDate>Thu, 29 Nov 2007 08:22:05 -0500</pubDate></item><item><title>Anyone Get SuperRedCloth To Build On Leopard?</title><description>Two machines here get segfaults from gcc (yes, after port installing ragel). Help?</description><link>http://spicycode.com/post/21960872</link><guid>http://spicycode.com/post/21960872</guid><pubDate>Wed, 07 Nov 2007 23:00:00 -0500</pubDate><category>ruby</category><category>rubygems</category></item><item><title>Enable The New Web Inspector On Leopard</title><description>&lt;p&gt;Just run the following in your terminal &lt;/p&gt;
&lt;pre&gt;defaults write com.apple.Safari WebKitDeveloperExtras -bool true &lt;/pre&gt;  Then right click on anything and click Inspect Element to bring it up</description><link>http://spicycode.com/post/21960940</link><guid>http://spicycode.com/post/21960940</guid><pubDate>Mon, 05 Nov 2007 23:00:00 -0500</pubDate><category>osx</category><category>leopard</category><category>safari</category></item><item><title>A Serialized Mystery</title><description>Author: Nick Ang Ehren and I recently had to spec out a discussion filter to return only items selected by the user. While testing all things were golden. However, when we tried to step through the implementation in the browser we would have issues. After some investigation in script/console we finally found the culprit.  The breakdown of our model  The model we are filtering contains a serialized column of integers to aid with the filtering. This is a low-tech version of a full-blown association. The purpose was to insulate us from yet more expensive sub queries as the full page load can be quite intensive. (I jest not when I say we have a model named “Item” in this project.)  &lt;pre&gt;class Item 	serialize :used_by_filter_ids end &lt;/pre&gt;
&lt;p&gt;&lt;b&gt;  Calling Scotland Yard &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Our investigation had us discover that the serialized column was returning an array of integers as Strings, versus actual Numerics which our callers expected. A simple tweak to the implementation to call to_i prior to handing the results back and all is good.&lt;/p&gt;
&lt;pre&gt;class Item 	serialize :used_by_filter_ids    	def used_by_filter_ids    	read_attribute(:used_by_filter_ids).each(&amp;:to_i)   	end end &lt;/pre&gt;  This discovery and subsequent fix explained why we were getting the errors through the browser but none during the specifications. The browser passes params around as strings, and the tests submit actual integers.  A lesson to learn  Always verify you are not relying on conversion magic at some level when serializing, or testing in general. If it needs to be an integer, use an integer. If rails will pass an integer as a string in params, you should do the same in your tests and specifications.  I estimate the time we spent in proportion to the code of size n was about O(n), but the constant hidden by the big-o notation was rather large.</description><link>http://spicycode.com/post/21961078</link><guid>http://spicycode.com/post/21961078</guid><pubDate>Thu, 31 May 2007 00:00:00 -0400</pubDate><category>rails</category></item><item><title>Make it fast please</title><description>&lt;p&gt;I love OSX. It’s my favorite OS this side of BeOS. However I still get frustrated some times when things move more slowly that I would like. That’s why I was very happy to find this tip at macosxhints  From MacOSX Hints  If you are willing to sacrifice the visual feedback, disabling animation can provide a snappier experience. To disable animation in the Finder, open your favorite Terminal Software and enter this command: &lt;/p&gt;
&lt;p&gt; &lt;code&gt; defaults write com.apple.finder DisableAllAnimations -bool true&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;  killall Finder &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;  I definitely don’t have a slower system, but I still like being able to disable the zooming windows here and there. When I want a folder open, just open the folder please.  If you decided it wasn’t for you, just reissue the command and restart finder again. &lt;/p&gt;
&lt;p&gt; &lt;code&gt; defaults write com.apple.finder DisableAllAnimations -bool false  &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;killall Finder &lt;/code&gt; &lt;/p&gt;</description><link>http://spicycode.com/post/21961312</link><guid>http://spicycode.com/post/21961312</guid><pubDate>Sun, 27 May 2007 00:00:00 -0400</pubDate><category>osx</category></item><item><title>RSpec 1.0 Released!</title><description>&lt;p&gt;RailsConf was quite fun this and I finally got a chance to meet David Chelimsky and Aslak Hellesøy on Saturday. Ken and I sat down with them and coded a patch or two for RSpec 1.0.  We got the “not implemented” spec feature added during this time. It worked like this: &lt;/p&gt;
&lt;p&gt;&lt;code&gt;describe YourClass do &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;	it "should do something awesome later" &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt; end &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;By not giving the example (‘it’) a block you get a Not Implemented spec notice in all the various outputs. This will be yellow in the console output when color is on, and the same in the html output. Having not implemented specs will not break your build, and they do not count as errors or failures.  All in all a very fun time.&lt;/p&gt;</description><link>http://spicycode.com/post/21961425</link><guid>http://spicycode.com/post/21961425</guid><pubDate>Tue, 22 May 2007 00:00:00 -0400</pubDate><category>ruby</category><category>rspec</category></item><item><title>Jim Weirich Joins EdgeCase</title><description>I haven’t had a lot of time to blog recently but I had to get the word out on a few things at my company, &lt;a href="http://theedgecase.com/"&gt;EdgeCase&lt;/a&gt;.&lt;br/&gt;&lt;h4&gt;A wonderful addition:&lt;/h4&gt;
&lt;p&gt;&lt;a href="http://onestepback.org/"&gt;&lt;b&gt;Jim Weirich&lt;/b&gt;&lt;/a&gt; of &lt;b&gt;rake&lt;/b&gt;, &lt;b&gt;rubygems&lt;/b&gt;, &lt;b&gt;flexmock&lt;/b&gt;, and many other ruby projects is joining EdgeCase. I couldn’t be more ecstatic. Jim will bring a great depth of experience to our team and allow us to really tackle the larger projects with ease.&lt;/p&gt;
&lt;h4&gt;A new site&lt;/h4&gt;
&lt;p&gt;&lt;a href="http://theedgecase.com/"&gt;&lt;b&gt;The EdgeCase Website&lt;/b&gt;&lt;/a&gt; has relaunched with a new design and more useful information on our portfolio, services, and who we are. It’s nice to get this up and going prior to RailsConf.&lt;/p&gt;
&lt;h4&gt;Enterprise Ruby Conference: erubycon&lt;/h4&gt;
&lt;p&gt;&lt;a href="http://erubycon.com/"&gt;&lt;b&gt;erubycon&lt;/b&gt;&lt;/a&gt; is coming up sooner than you might think. &lt;a href="http://on-ruby.blogspot.com/2007/05/erubycon-contest.html"&gt;Pat Eyler&lt;/a&gt; has recently announced a contest we are putting on to get free tickets to erubycon.&lt;/p&gt;</description><link>http://spicycode.com/post/21961458</link><guid>http://spicycode.com/post/21961458</guid><pubDate>Mon, 14 May 2007 00:00:00 -0400</pubDate><category>edgecase</category></item><item><title>Bitten By The Hard Breaks Again</title><description>&lt;p&gt;Another turn around the textile wheel of fortune in a rails application today yielded a lesson learned long ago but forgotten.  The textilize helper included with rails enables the hard_breaks mode by default. Hard Breaks converts 1 new line to a br and 2 newlines to a p tag. When you disable hard breaks mode you only get p tags. &lt;/p&gt;
&lt;p&gt; Here’s how the source for that method looks: &lt;/p&gt;
&lt;p&gt;&lt;code&gt;def textilize(text) &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;  if text.blank?     ""   else     textilized = RedCloth.new(text, [ :hard_breaks ]) &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;  textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=")     textilized.to_html &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;  end &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;end &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here’s a simple override of it you can put in your application_helper.rb if you want the no hard breaks behaviour. &lt;/p&gt;
&lt;p&gt;&lt;code&gt;def textilize(text) &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;  if text.blank? &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;    "" &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;  else &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;    RedCloth.new(text).to_html &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;  end &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;end &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Nothing new, just posting it here as a reminder to myself and a hopefully helpful tip to anyone not yet familiar with this difference.&lt;/p&gt;</description><link>http://spicycode.com/post/21961582</link><guid>http://spicycode.com/post/21961582</guid><pubDate>Sun, 13 May 2007 00:00:00 -0400</pubDate><category>redcloth</category><category>ruby</category></item><item><title>Globzilla - Destroyer Of Subversion</title><description>At the office today Nick and I tried an experiment. It was a failed one, but who said all news has to be good news? Here’s how it breaks down.&lt;h4&gt;Step 1: Optimal Optimism&lt;/h4&gt;
&lt;p&gt;Be lazy enough that you don’t want to use one of the plentiful svn add scripts on the net.&lt;/p&gt;
&lt;h4&gt;Step 2: Arbitrary Assumptions&lt;/h4&gt;
&lt;p&gt;Decide, hey, I can make that happen with fewer characters!&lt;/p&gt;
&lt;h4&gt;Step 3: Shiny Shells&lt;/h4&gt;
&lt;p&gt;Try to run the following in your sleek zsh shell:&lt;/p&gt;
&lt;code&gt;svn add **/*&lt;/code&gt;&lt;p&gt;So, this step is awesome! It adds all the &lt;b&gt;new files&lt;/b&gt;, while not re-adding existing files. It also has the added benefit of scrolling so much text in your console you have time to get a refreshing drink.&lt;/p&gt;
&lt;h4&gt;Step 4: Reversion Regret&lt;/h4&gt;
&lt;p&gt;However, the last step has the added benefit of adding &lt;b&gt;svn ignored&lt;/b&gt; files by calling them as explicit targets. This gives us a wonderful experience of learning how to selectly &lt;b&gt;svn revert&lt;/b&gt; everything our nuclear svn add option just did.&lt;/p&gt;
&lt;h4&gt;Step 5: Bowing Back&lt;/h4&gt;
&lt;p&gt;So what have we learned? Sometimes &lt;b&gt;globs&lt;/b&gt; do not solve all problems. Most perhaps, but definitely not all. Also, I’d like to give a shout out to my friend subversion, who enabled me to rollback this mess of a command.&lt;/p&gt;</description><link>http://spicycode.com/post/21961698</link><guid>http://spicycode.com/post/21961698</guid><pubDate>Thu, 03 May 2007 00:00:00 -0400</pubDate><category>zsh</category><category>osx</category></item></channel></rss>
