<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The Sweet Spot</title>
	
	<link>http://www.g9labs.com</link>
	<description>Andrew Hao’s thoughts on design, Web development, and anything shiny.</description>
	<lastBuildDate>Wed, 26 Dec 2012 19:46:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/g9labs/VpWG" /><feedburner:info uri="g9labs/vpwg" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Decomposing Fat Models</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/7hx85bg4ubs/</link>
		<comments>http://www.g9labs.com/2012/12/26/decomposing-fat-models/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 19:46:09 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1171</guid>
		<description><![CDATA[Heard an awesome Ruby Rogues podcast recently: &#8220;Decomposing Fat&#160;Models&#8221;. Essentially, they&#8217;re talking through Bryan Helmkamp&#8217;s Code Climate blog entry &#8220;7 ways to decompose fat ActiveRecord models&#8221;, which sums up a few strategies that mainly involve extracting objects from your existing code, value, service, policy, decorator objects and the like. Give the entry a read-through, it&#8217;s [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Heard an awesome Ruby Rogues podcast recently: <a href="http://rubyrogues.com/083-rr-decomposing-fat-models-with-bryan-helmkamp/">&#8220;Decomposing Fat&nbsp;Models&#8221;</a>.</p>
<p>Essentially, they&#8217;re talking through Bryan Helmkamp&#8217;s <a href="http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/">Code Climate blog entry &#8220;7 ways to decompose fat ActiveRecord models&#8221;</a>, which sums up a few strategies that mainly involve extracting objects from your existing code, value, service, policy, decorator objects and the like. Give the entry a read-through, it&#8217;s opened my eyes a lot to rethinking my architecture of my Rails&nbsp;models.</p>
<p>A few interesting thoughts that came up in the&nbsp;podcast:</p>
<ul>
<li>The &#8220;Skinny Controller, Fat Model&#8221; mantra has hurt the Rails community because we start getting these bloated <span class="caps">AR</span> classes. &#8220;&#8216;fat-&#8217; anything is bad&#8221; one of the hosts mentions in the blog. The smaller your models, the more manageable, readable and testable they&nbsp;become.</li>
<li>Rubyists don&#8217;t like the term &#8220;Factory&#8221;, even though in Helmkamp&#8217;s opinion, Ruby classes <em>are</em> factories. &#8220;We call them &#8220;builders&#8221;&#8221; one of the hosts&nbsp;jokes.</li>
<li>The Open/Closed Principle as applied to Ruby: using delegators,&nbsp;decorators.</li>
</ul>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/7hx85bg4ubs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/12/26/decomposing-fat-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/12/26/decomposing-fat-models/</feedburner:origLink></item>
		<item>
		<title>Deploying Janky on Ubuntu</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/4unufIV1SQA/</link>
		<comments>http://www.g9labs.com/2012/10/04/deploying-janky-on-ubuntu/#comments</comments>
		<pubDate>Thu, 04 Oct 2012 17:29:58 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Andrew 2.0]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1164</guid>
		<description><![CDATA[Janky is a Github-developed Hubot + Jenkins control interface. It&#8217;s developed to be deployed on Heroku. However, what if you need it to live on an internal VM? Here&#8217;s how I got it running on a Ubuntu (12.04 Precise)&#160;VM. Make sure you have the correct MySQL libs&#160;installed: sudo apt-get install mysql-server libmysqlclient-dev Clone janky from [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p><a href="https://github.com/blog/1013-janky">Janky</a> is a Github-developed <a href="https://github.com/github/hubot">Hubot</a> + Jenkins control interface. It&#8217;s developed to be deployed on Heroku. However, what if you need it to live on an internal <span class="caps">VM</span>? Here&#8217;s how I got it running on a Ubuntu (12.04 Precise)&nbsp;<span class="caps">VM</span>.</p>
<h2>Make sure you have the correct MySQL libs&nbsp;installed:</h2>
<pre><code>sudo apt-get install mysql-server libmysqlclient-dev
</code></pre>
<h2>Clone janky from the <a href="https://github.com/github/janky">Github&nbsp;repository</a></h2>
<pre><code>git clone https://github.com/github/janky.git
cd janky
</code></pre>
<h2>Bootstrap your&nbsp;environment</h2>
<p>The following steps are taken nearly verbatim from the &#8220;Hacking&#8221; section on the Janky&nbsp;<span class="caps">README</span>:</p>
<pre><code>script/bootstrap

mysqladmin -uroot create janky_development
mysqladmin -uroot create janky_test

RACK_ENV=development bin/rake db:migrate
RACK_ENV=test bin/rake db:migrate

RACK_ENV=development bundle exec rake db:seed
</code></pre>
<h2>Configure&nbsp;Thin</h2>
<p>Open <code>Gemfile</code> in your text editor and&nbsp;add:</p>
<pre><code>gem "foreman"
</code></pre>
<p>Then install&nbsp;it:</p>
<pre><code>bundle install
</code></pre>
<p>Then create a&nbsp;Procfile:</p>
<pre><code>touch Procfile
</code></pre>
<p>Open the Procfile in your text editor and add the following&nbsp;line:</p>
<pre><code>web: bundle exec thin start -p $PORT
</code></pre>
<p>Add the JANKY_* variables to your environment according to the janky <span class="caps">README</span>. I use zsh, so I added these as export statements in my&nbsp;~/.zshenv</p>
<h2>Start your&nbsp;server</h2>
<pre><code>bundle exec foreman start
</code></pre>
<p>Note that the server starts on port 5000 by default, and you can override it like&nbsp;so:</p>
<pre><code>PORT=8080 bundle exec foreman start
</code></pre>
<h2>That&#8217;s&nbsp;it!</h2>
<p>Let me know how that works for&nbsp;you!</p>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/4unufIV1SQA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/10/04/deploying-janky-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/10/04/deploying-janky-on-ubuntu/</feedburner:origLink></item>
		<item>
		<title>Updating max file limit on OSX Lion</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/5VufQO2fuvw/</link>
		<comments>http://www.g9labs.com/2012/06/20/updating-max-file-limit-on-osx-lion/#comments</comments>
		<pubDate>Wed, 20 Jun 2012 16:28:13 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Andrew 2.0]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[launchctl]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ulimit]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1159</guid>
		<description><![CDATA[I&#8217;ve been hitting a lot of &#8220;Maximum file limit exceeded&#8221; dialogs after a long day at work&#8201;&#8212;&#8201;at any point in time I&#8217;ve got a kajillion Chrome tabs open, five or six Rails envs running (for dev and test) + Guard/Spork actively watching tests, and Sublime with another kajillion tabs&#160;open. Turns out that OSX limits the [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been hitting a lot of &#8220;Maximum file limit exceeded&#8221; dialogs after a long day at work&thinsp;&#8212;&thinsp;at any point in time I&#8217;ve got a kajillion Chrome tabs open, five or six Rails envs running (for dev and test) + Guard/Spork actively watching tests, and Sublime with another kajillion tabs&nbsp;open.</p>
<p>Turns out that <span class="caps">OSX</span> limits the number of open file descriptors per process to 256. Time to bump up the&nbsp;limit:</p>
<p>First, check out your current file&nbsp;limit:</p>
<p><code>$ launchctl&nbsp;limit</code></p>
<pre>    cpu         unlimited      unlimited      
    filesize    unlimited      unlimited      
    data        unlimited      unlimited      
    stack       8388608        67104768       
    core        0              unlimited      
    rss         unlimited      unlimited      
    memlock     unlimited      unlimited      
    maxproc     709            1064           
    maxfiles    256            unlimited</pre>
<p>Okay, let&#8217;s crank &#8216;er up. First let&#8217;s create&nbsp;<code>/etc/launchctl.conf</code></p>
<p><code>$ sudo touch&nbsp;/etc/launchctl.conf</code></p>
<p>And let&#8217;s open it with your editor of choice. Add the following line to the new&nbsp;file:</p>
<p><code>limit maxfiles 16384&nbsp;32768</code></p>
<p>Restart your computer. Boom.&nbsp;Easy.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/5VufQO2fuvw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/06/20/updating-max-file-limit-on-osx-lion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/06/20/updating-max-file-limit-on-osx-lion/</feedburner:origLink></item>
		<item>
		<title>Speeding up Rspec/Cucumber feedback times without sacrificing coverage</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/XJXTc0z1eDw/</link>
		<comments>http://www.g9labs.com/2012/04/27/speeding-up-rspeccucumber-feedback-times-without-sacrificing-coverage/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 00:27:17 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1155</guid>
		<description><![CDATA[Rocket Fuelled Cucumbers View more presentations from Joseph Wilk One thing the Blurb devs have been discussing is how we can speed up our test feedback cycles without sacrificing coverage. There&#8217;s some good tips (mainly Rails+Rspec/Cucumber) in the presentation such as: Don&#8217;t run all the tests when developing (tag your tests by&#160;function) Parallelize, chunk tests [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<div style="width:510px" id="__ss_4479466"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/josephwilk/rocket-fuelled-cucumbers" title="Rocket Fuelled Cucumbers" target="_blank">Rocket Fuelled Cucumbers</a></strong> <object id="__sse4479466" width="510" height="426"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rc2010-100611192022-phpapp02&#038;stripped_title=rocket-fuelled-cucumbers&#038;userName=josephwilk" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"/><embed name="__sse4479466" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rc2010-100611192022-phpapp02&#038;stripped_title=rocket-fuelled-cucumbers&#038;userName=josephwilk" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="510" height="426"></embed></object>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/josephwilk" target="_blank">Joseph Wilk</a> </div>
</p></div>
<div>One thing the Blurb devs have been discussing is how we can speed up our test feedback cycles without sacrificing coverage. There&#8217;s some good tips (mainly Rails+Rspec/Cucumber) in the presentation such as:</div>
<div>
<ul>
<li>Don&#8217;t run all the tests when developing (tag your tests by&nbsp;function)</li>
<li>Parallelize, chunk tests over machines/cores using Testjour/<a href="https://github.com/sandro/specjour" target="_blank">Specjour</a>, <a href="https://github.com/ngauthier/hydra" target="_blank">Hydra</a></li>
<li>Don&#8217;t run all the tests at once. Tests that never fail should&nbsp;nightly.</li>
<li>Instead of spinning up a browser for acceptance tests, can you use a js/<span class="caps">DOM</span> simulator (e.g. <a href="https://github.com/thatcher/env-js" target="_blank">envjs</a> via <a href="https://github.com/smparkes/capybara-envjs" target="_blank">capybara-envjs</a>, or <a href="https://github.com/jarib/celerity" target="_blank">celerity</a>)</li>
</ul>
</div>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/XJXTc0z1eDw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/04/27/speeding-up-rspeccucumber-feedback-times-without-sacrificing-coverage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/04/27/speeding-up-rspeccucumber-feedback-times-without-sacrificing-coverage/</feedburner:origLink></item>
		<item>
		<title>Backup, backup, backup</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/owbAmk_bMuw/</link>
		<comments>http://www.g9labs.com/2012/04/23/backup-backup-backup/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 15:02:05 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Andrew 2.0]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[adobe lightroom]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dng]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[lightroom]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1142</guid>
		<description><![CDATA[Well, the inevitable happened: I finally experienced a hard drive failure. It&#8217;s pretty incredible that in the twenty-odd years I&#8217;ve been around computers I&#8217;ve never had the horror of losing a&#160;drive. Friday rolls around and my Macbook Pro decides to freeze up on me. Strange, I think to myself. It&#8217;s making a clicking noise.&#160;Crap. Luckily, [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Well, the inevitable happened: I finally experienced a hard drive failure. It&#8217;s pretty incredible that in the twenty-odd years I&#8217;ve been around computers I&#8217;ve never had the horror of losing a&nbsp;drive.</p>
<p>Friday rolls around and my Macbook Pro decides to freeze up on me. <em>Strange, </em>I think to myself. It&#8217;s making a clicking noise.&nbsp;Crap.</p>
<p>Luckily, I&#8217;ve been fairly good about making backups and copies of my work. Here&#8217;s my general&nbsp;strategy:</p>
<ul>
<li>Work/code: keeping local changes on a separate branch and pushing it to a remote Git branch every so&nbsp;often.</li>
<li>Everything else: I keep one local copy here with me in Oakland, and have another copy offsite. I rsync my files out to my server at home, which has a cronjob set up to sync with the offsite copy at my parents&#8217; home (I run a <a href="http://pogoplug.com/">Pogoplug</a> with <a href="http://archlinuxarm.org/platforms/armv6/pogoplug-provideov3">Archlinux</a> and a couple of external drives connected to it&thinsp;&#8212;&thinsp;fantastic and totally recommended for a cheap and low-power server&nbsp;setup).</li>
</ul>
<p>There was a minor scare this time around though&thinsp;&#8212;&thinsp;I had some photography work (and an engagement photoshoot!) lying around that almost didn&#8217;t make it to the first stage rsync with my local server. Fortunately, I had the foresight to keep my photos backed up to a random local hard disk, and the rest remained on the memory cards (and some even on a shared Dropbox folder that saved my butt!). Most frustrating thing was learning that I had forgotten to back up my Lightroom catalog, so all my edits were lost. At least I have the original&nbsp;shots.</p>
<p>One thing I think I&#8217;ll try doing from here on out&thinsp;&#8212;&thinsp;saving my Develop settings/presets directly to the DNGs themselves before backing up. That way if I ever lose my <span class="caps">LR</span> catalog, the edit settings are still embedded in the original&nbsp;files.</p>
<p>Jeff Atwood reminds us to <a href="http://www.codinghorror.com/blog/2008/01/whats-your-backup-strategy.html">keep backups around on multiple disks</a>. With the price of storage so low, what&#8217;s your data worth to you? How are you keeping your&nbsp;backups?</p>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/owbAmk_bMuw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/04/23/backup-backup-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/04/23/backup-backup-backup/</feedburner:origLink></item>
		<item>
		<title>HAML object references</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/FGLRYg1ajiQ/</link>
		<comments>http://www.g9labs.com/2012/04/12/haml-object-references/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 21:40:09 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[HAML]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1143</guid>
		<description><![CDATA[Did you guys know that you can use the &#8216;[ ]&#8217; brackets in HAML to automatically set the id and class on a tag, kind of like Rails&#8217; tag helper? # file: app/controllers/users_controller.rb def show @user = CrazyUser.find(15) end -# file: app/views/users/show.haml %div[@user, :greeting] %bar[290]/ Hello! is compiled&#160;to: &#60;div class='greeting_crazy_user' id='greeting_crazy_user_15'&#62; &#60;bar class='fixnum' id='fixnum_581' /&#62; Hello! &#60;/div&#62; [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Did you guys know that you can use the &#8216;[ ]&#8217; brackets in <span class="caps">HAML</span> to automatically set the id and class on a tag, kind of like Rails&#8217; <span style="font-family: 'courier new', monospace;"><a href="http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-tag">tag</a></span> helper?</p>
<div>
<pre># file: app/controllers/users_controller.rb

def show
  @user = CrazyUser.find(15)
end

-# file: app/views/users/show.haml

%div[@user, :greeting]
  %bar[290]/
  Hello!</pre>
<p>is compiled&nbsp;to:</p>
<pre>&lt;div class='greeting_crazy_user' id='greeting_crazy_user_15'&gt;
  &lt;bar class='fixnum' id='fixnum_581' /&gt;
  Hello!
&lt;/div&gt;</pre>
<div>
<p>Keeps things nice, concise and <span class="caps">DRY</span>. See the <a href="http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#object_reference_  "><span class="caps">HAML</span>&nbsp;documentation</a>.</p>
</div>
</div>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/FGLRYg1ajiQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/04/12/haml-object-references/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/04/12/haml-object-references/</feedburner:origLink></item>
		<item>
		<title>RSpec order-agnostic array matching</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/QRNBa4Ejncc/</link>
		<comments>http://www.g9labs.com/2012/03/23/rspec-order-agnostic-array-matching/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 01:09:40 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Andrew 2.0]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[matcher]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1140</guid>
		<description><![CDATA[What&#8217;s that? You want to write an expectation for an array but your method returns the Array in a nondeterministic&#160;ordering? Simple.&#160;Write: my_method.should =~ &#60;my_expectation&#62; See the&#160;source.<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>What&#8217;s that? <a href="http://stackoverflow.com/questions/2978922/rspec-array-should-another-array-but-without-concern-for-order">You want to write an expectation for an array but your method returns the Array in a nondeterministic&nbsp;ordering</a>?</p>
<p>Simple.&nbsp;Write:</p>
<pre>my_method.should =~ &lt;my_expectation&gt;</pre>
<p>See the&nbsp;<a href="https://github.com/dchelimsky/rspec/blob/master/lib/spec/matchers/match_array.rb">source</a>.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/QRNBa4Ejncc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/03/23/rspec-order-agnostic-array-matching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/03/23/rspec-order-agnostic-array-matching/</feedburner:origLink></item>
		<item>
		<title>Ohm gotchas</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/5R0kBzt2ITU/</link>
		<comments>http://www.g9labs.com/2012/01/20/ohm-gotchas/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 01:19:50 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Andrew 2.0]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[blurb]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1119</guid>
		<description><![CDATA[Here&#8217;s a list of things that have been annoying, or at least a bit frustrating using Ohm, the Redis ORM, in a Rails app. Beware to those who assume Ohm is ActiveRecord in new clothes. It is, but it&#8217;s&#160;not: CRUD Don&#8217;t make the mistake of treating your Ohm objects like&#160;AR: ActiveRecord Ohm destroy delete self.find(id) self[id] [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a list of things that have been annoying, or at least a bit frustrating using <a href="http://ohm.keyvalue.org">Ohm</a>, the Redis <span class="caps">ORM</span>, in a Rails app. Beware to those who assume Ohm is ActiveRecord in new clothes. It is, but it&#8217;s&nbsp;not:</p>
<h2><span class="caps">CRUD</span></h2>
<p>Don&#8217;t make the mistake of treating your Ohm objects like&nbsp;<span class="caps">AR</span>:</p>
<table>
<thead>
<tr>
<th>ActiveRecord</th>
<th>Ohm</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>destroy</code></td>
<td><code>delete</code></td>
</tr>
<tr>
<td><code>self.find(id)</code></td>
<td><code>self[id]</code></td>
</tr>
<tr>
<td><code>update_attributes</code></td>
<td><code>update</code></td>
</tr>
<tr>
<td><code>create</code></td>
<td><code>create</code></td>
</tr>
</tbody>
</table>
<p>Also note that Ohm&#8217;s <code>update_attributes</code> behaves differently from Rails`&thinsp;&#8212;&thinsp;it doesn&#8217;t persist the updates to DB. That owned me for the good part of the&nbsp;day.</p>
<h2>Callbacks</h2>
<p>Thankfully, these are ActiveRecord-like with the addition of&nbsp;<a href="http://cyx.github.com/ohm-contrib/doc/"><code>ohm/contrib</code></a>.</p>
<h2>Associations</h2>
<table>
<thead>
<tr>
<th>ActiveRecord</th>
<th>Ohm</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>has_a</code> or <code>belongs_to</code></td>
<td><code>reference</code></td>
</tr>
<tr>
<td><code>has_many</code></td>
<td><code>collection</code></td>
</tr>
</tbody>
</table>
<p>Read <a href="http://blog.citrusbyte.com/2010/04/12/mixing-ohm-with-activerecord-datamapper-and-sequel/">this article</a> if you&#8217;re considering creating associations from <span class="caps">AR</span> objects to Ohm objects and the other way&nbsp;&#8216;round.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/5R0kBzt2ITU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2012/01/20/ohm-gotchas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2012/01/20/ohm-gotchas/</feedburner:origLink></item>
		<item>
		<title>Now at Blurb</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/6BpJZHW9hJ4/</link>
		<comments>http://www.g9labs.com/2011/11/21/now-at-blurb/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 19:12:53 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1117</guid>
		<description><![CDATA[I should have mentioned this long ago, but I started work at Blurb in early August. It&#8217;s been a quick ramp-up and I&#8217;m loving it there, surrounded by smart engineers and great designers. I do Rails/JS work there, and I&#8217;m building a lot of chops around Agile/TDD&#160;methodologies. Anyways, they had me do a Camera Thursdays [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I should have mentioned this long ago, but I started work at Blurb in early August. It&#8217;s been a quick ramp-up and I&#8217;m loving it there, surrounded by smart engineers and great designers. I do Rails/<span class="caps">JS</span> work there, and I&#8217;m building a lot of chops around Agile/<span class="caps">TDD</span>&nbsp;methodologies.</p>
<p>Anyways, they had me do a Camera Thursdays blog post, which I <a href="http://blog.blurb.com/index.php/2011/11/17/blurberati-with-cameras-nikon-d80-with-f1-8-50mm-prime/">wrote about my Nikon/1.8 camera&nbsp;combo</a>:</p>
<p><a href="http://blog.blurb.com/index.php/2011/11/17/blurberati-with-cameras-nikon-d80-with-f1-8-50mm-prime/"><img class="alignnone" title="Me on Blurb" src="http://blog.blurb.com/wp-content/uploads/2011/11/andrew.jpg" alt="" width="306" height="306" /></a></p>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/6BpJZHW9hJ4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2011/11/21/now-at-blurb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2011/11/21/now-at-blurb/</feedburner:origLink></item>
		<item>
		<title>mmtss, a collaborative loop station</title>
		<link>http://feedproxy.google.com/~r/g9labs/VpWG/~3/vkCc8huUslM/</link>
		<comments>http://www.g9labs.com/2011/10/02/mmtss-a-collaborative-loop-station/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 17:53:45 +0000</pubDate>
		<dc:creator>andrewhao</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.g9labs.com/?p=1113</guid>
		<description><![CDATA[mmtss is a loop station built for live&#160;performances. Let&#8217;s make music together! This project simplifies a traditional loop tracking station and is designed for interactive collaborative music&#160;performances. The idea: Everybody adds or modifies one &#8220;part&#8221; of a 32-bar loop. The user gets to play an instrument over the existing mix and record the 32-bar phrase [...]<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>mmtss is a loop station built for live&nbsp;performances.</h2>
<p>Let&#8217;s make music together! This project simplifies a traditional loop tracking station and is designed for interactive collaborative music&nbsp;performances.</p>
<p>The idea: Everybody adds or modifies one &#8220;part&#8221; of a 32-bar loop. The user gets to play an instrument over the existing mix and record the 32-bar phrase when she or he is ready. Once the person is finished, the project selects another instrument at random for the next viewer to&nbsp;record.</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/a2c-rCfR5XU" frameborder="0" allowfullscreen></iframe></p>
<p>It&#8217;s an Ableton Live controller serving a Webkit view, backed by node.js on the backend and socket.io + RaphaelJS on the front. Communication is done through a LiveOSC Live plugin via&nbsp;sockets.</p>
<p>Displayed at the Regeneration &#8220;We Collaborate&#8221; art show in Oakland, <span class="caps">CA</span>.&nbsp;9/24/2011.</p>
<h3>Screenshots</h3>
<p><img src="https://a248.e.akamai.net/assets.github.com/img/64abaefb0d10744dda42f362b6cd991522a88da4/687474703a2f2f6661726d372e7374617469632e666c69636b722e636f6d2f363136392f363138383336363537375f376261343864333864315f7a2e6a7067" alt="Practice mode" /></p>
<p>mmtss in practice/playback mode. Here the user is able to practice/mess around with the current instrument to prepare to record the next&nbsp;track.</p>
<p><img src="https://a248.e.akamai.net/assets.github.com/img/3f0c633b9b8d9d35970efe73f84c0f67bf68c6a8/687474703a2f2f6661726d372e7374617469632e666c69636b722e636f6d2f363132312f363138383838363131345f396436643531393937325f7a2e6a7067" alt="Cued mode" /></p>
<p>Pressing &#8220;record&#8221; puts the user in a wait state. They are prompted to begin recording when all the black boxes count down and&nbsp;disappear.</p>
<p><img src="https://a248.e.akamai.net/assets.github.com/img/650dc62a52d8ca6441eff57e697307325390caaa/687474703a2f2f6661726d372e7374617469632e666c69636b722e636f6d2f363137372f363138383336373135315f636135623738323733355f7a2e6a7067" alt="Record mode" /></p>
<p>mmtss in record&nbsp;mode.</p>
<p>More&nbsp;screenshots: http://www.flickr.com/photos/andrewhao/sets/72157627640840853/</p>
<h3>Source&nbsp;code</h3>
<p>Github:&nbsp;http://www.github.com/andrewhao/mmtss.</p>
<p><span class="caps">MIT</span>/<span class="caps">GPL</span>-sourced for your coding&nbsp;pleasure.</p>
<h3>Installation</h3>
<ul>
<li>Make sure you have npm installed: <a href="http://www.npmjs.org/">http://www.npmjs.org</a></li>
<li>Copy <code>lib/LiveOSC</code> into <code>/Applications/Live x.y.z OS X/Live.app/Contents/App-Resources/MIDI\ Remote\&nbsp;Scripts/</code> folder</li>
<li>Set it as your <span class="caps">MIDI</span> remote in the Ableton Live Preferences pane, in the &#8220;<span class="caps">MIDI</span> Remote&#8221;&nbsp;tab.</li>
</ul>
<h3>Running&nbsp;it</h3>
<ul>
<li>Open <code>Mmtss_0.als</code> as a sample Live&nbsp;project.</li>
<li>Install all project dependencies with <code>npm install</code> from the project&nbsp;root.</li>
<li>Start the Node server with <code>node app.js</code> from the root&nbsp;directory.</li>
<li>Open a Web browser and visit <code>localhost:3000</code></li>
</ul>
<h3>Modifying the sample&nbsp;project</h3>
<p>You can modify this project to suit your own needs. Note that there are two sets of tracks; instrument (<span class="caps">MIDI</span> input) tracks and loop tracks that actually store&nbsp;clips.</p>
<p>For <code>n</code> tracks, you can add or remove your own instruments. Just make sure that instrument at track <code>x</code> corresponds to track <code>x</code> + <code>n</code>.</p>
<h3>Credits</h3>
<ul>
<li>Design and architectural inspiration taken from <a href="http://github.com/vnoise/vtouch">vtouch</a>, a <span class="caps">HTML5</span>/Node/Canvas Ableton&nbsp;controller.</li>
<li>Original LiveOSC source is found at: <a href="http://monome.q3f.org/browser/trunk/LiveOSC">http://monome.q3f.org/browser/trunk/LiveOSC</a>. We use a different fork of the project at:<a href="http://github.com/vnoise/vtouch">http://github.com/vnoise/vtouch</a>.</li>
<li>Super sweet <span class="caps">CSS3</span> rocker widgets courtesy of <a href="http://www.simurai.com/">Simurai</a>: <a href="http://lab.simurai.com/css/umbrui/">UmbrUI</a></li>
</ul>
<h3>License</h3>
<p><a href="http://www.opensource.org/licenses/mit-license.php"><span class="caps">MIT</span></a> and <a href="http://www.gnu.org/copyleft/gpl.html">GPLv3</a> licensed. Go for&nbsp;it.</p>
<p>You will, however, need to get a license for <a href="http://www.ableton.com/live">Ableton Live</a>&nbsp;yourself.</p>
<h3>The handsome&nbsp;collaborators</h3>
<ul>
<li>Andrew Hao: <a href="http://www.g9labs.com/">http://www.g9labs.com</a></li>
<li>David Luoh: <a href="http://www.inkproj.com/">http://www.inkproj.com</a></li>
</ul>
<h3></h3>
<div class='yarpp-related-rss yarpp-related-none'>
<img src='http://yarpp.org/pixels/84daa86e75f24990662df54d31ccb5b0'/>
</div>
<img src="http://feeds.feedburner.com/~r/g9labs/VpWG/~4/vkCc8huUslM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.g9labs.com/2011/10/02/mmtss-a-collaborative-loop-station/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.g9labs.com/2011/10/02/mmtss-a-collaborative-loop-station/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 1371670956.090 seconds -->
