<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
 
 <title>Jack Dempsey</title>
 
 <link href="http://jackdempsey.me/" />
 <updated>2011-07-30T16:26:08-07:00</updated>
 <id>http://jackdempsey.me/</id>
 <author>
   <name>Jack Dempsey</name>
   <email>jack.dempsey@gmail.com</email>
 </author>

 
 <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/jack-dempsey" /><feedburner:info uri="jack-dempsey" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><entry>
   <title>Hosting a Static Site with Pow</title>
   <link href="http://jackdempsey.me/2011/04/22/serving-static-sites-with-pow.html" />
   <updated>2011-04-22T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2011/04/22/serving-static-sites-with-pow</id>
   <content type="html">&lt;h1 id='hosting_a_static_site_with_pow'&gt;Hosting a Static Site with Pow&lt;/h1&gt;

&lt;p&gt;I&amp;#8217;m a big fan of &lt;a href='http://pow.cx'&gt;pow&lt;/a&gt; and &lt;a href='http://jekyllrb.com/'&gt;jekyll&lt;/a&gt; and thought it&amp;#8217;d be interesting to host the local copy of my blog with pow. Here&amp;#8217;s a simple way to do it.&lt;/p&gt;
&lt;strike&gt;Pow deals exclusively with rack apps. So, create a config.ru in the directory for your blog that looks like this:&lt;/strike&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Sam just let me know that rackup file isn&amp;#8217;t needed: &lt;em&gt;&amp;#8220;Pow automatically serves static files in the public directory of your application. It&amp;#8217;s possible to serve a completely static site without a config.ru file as long as it has a public directory.&amp;#8221;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Create a public dir which contains your blogs content. In my case this meant symlinking _site to public:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ln -s _site public&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Make sure you ignore the public dir if using jekyll:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ cat _config.yml 
pygments: true
exclude:
- Rakefile
- README.textile
- public&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Add the directory to pow. Either symlink it into .pow or use the powder gem inside the directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ gem install powder
$ powder &lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;At this point you should be good to visit http://blogdirectoryname.dev and see your site, properly making use of css etc as well (the html I generate for the actual site never used to look right locally given absolute paths).&lt;/p&gt;

&lt;p&gt;HTH&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Rails 3.1: Understanding Sprockets and CoffeeScript</title>
   <link href="http://jackdempsey.me/2011/04/22/rails-3-1-sprockets-and-coffeescript.html" />
   <updated>2011-04-22T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2011/04/22/rails-3-1-sprockets-and-coffeescript</id>
   <content type="html">&lt;h1 id='rails_31_understanding_sprockets_and_coffeescript'&gt;Rails 3.1: Understanding Sprockets and CoffeeScript&lt;/h1&gt;

&lt;p&gt;&lt;a href='http://www.petercooper.co.uk/'&gt;Peter Cooper&lt;/a&gt; recently posted a great intro &lt;a href='http://www.rubyinside.com/how-to-rails-3-1-coffeescript-howto-4695.html'&gt;How to Play with Rails 3.1, CoffeeScript and All That Jazz Right Now&lt;/a&gt;. I&amp;#8217;d like to follow on from his post with some more examples and specific challenges I faced last night as I hacked an existing rails 3 app into the structure of 3.1.&lt;/p&gt;

&lt;h2 id='stylesheets'&gt;Stylesheets&lt;/h2&gt;

&lt;p&gt;Let&amp;#8217;s start with some simple changes. We now have two locations for our stylesheets: &lt;code&gt;vendor/assets/stylesheets&lt;/code&gt; and &lt;code&gt;app/assets/stylesheets&lt;/code&gt;. The same way you used to put external lib code into &lt;code&gt;vendor/plugins&lt;/code&gt; you can now put those externally required css files into &lt;code&gt;vendor/assets/stylesheets&lt;/code&gt;. For example, I&amp;#8217;m using the &lt;a href='http://loopj.com/jquery-tokeninput'&gt;jquery-tokeninput&lt;/a&gt; project, and have put the tokeninput css files into the vendor dir:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;example_app rails31 &amp;gt; ls -l vendor/assets/stylesheets/token-input
total 32
-rw-r--r--  1 jack  staff   2.5K Apr 21 23:46 token-input-facebook.css
-rw-r--r--  1 jack  staff   4.6K Apr 21 23:46 token-input-mac.css
-rw-r--r--  1 jack  staff   2.0K Apr 21 23:46 token-input.css&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You then tell sprockets to require these files in your main application.css:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='css'&gt;&lt;span class='nt'&gt;example_app&lt;/span&gt; &lt;span class='nt'&gt;rails31&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='nt'&gt;cat&lt;/span&gt; &lt;span class='nt'&gt;app&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nt'&gt;assets&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nt'&gt;stylesheets&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nt'&gt;application&lt;/span&gt;&lt;span class='nc'&gt;.css&lt;/span&gt; 
&lt;span class='c'&gt;/*&lt;/span&gt;
&lt;span class='c'&gt; * FIXME: Introduce SCSS &amp;amp; Sprockets&lt;/span&gt;
&lt;span class='c'&gt; *= require &amp;quot;style&amp;quot; &lt;/span&gt;
&lt;span class='c'&gt; *= require_tree ../../../vendor/assets/stylesheets/token-input&lt;/span&gt;
&lt;span class='c'&gt; */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The require_tree bit seems ugly. Hopefully I&amp;#8217;ve done something stupid and there&amp;#8217;s a cleaner way to bring in those stylesheets.&lt;/p&gt;

&lt;p&gt;You&amp;#8217;ll also see &lt;code&gt;require &amp;quot;style&amp;quot;&lt;/code&gt; in that file as well. That file exists in the main &lt;code&gt;app/assets/stylesheets&lt;/code&gt; directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;example_app rails31 &amp;gt; ls -l app/assets/stylesheets
total 16
-rw-r--r--   1 jack  staff   128B Apr 22 10:20 application.css
-rw-r--r--   1 jack  staff   1.8K Apr 21 23:46 style.css.scss&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Sprockets will load that file and convert it into css and package it up, so when your browser requests &lt;code&gt;/assets/application.css&lt;/code&gt;, you&amp;#8217;ll get one file which contains the style.css content, as well as token-input.&lt;/p&gt;

&lt;p&gt;To include the stylesheet in your app, you can use the stylesheet_link_tag helper, which is now sprocket aware:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='haml'&gt;example_app rails31 &amp;gt; cat app/views/layouts/application.html.haml 
&lt;span class='nn'&gt;!!! 5&lt;/span&gt;
&lt;span class='nt'&gt;%html&lt;/span&gt;
  &lt;span class='nt'&gt;%head&lt;/span&gt;
    &lt;span class='nt'&gt;%title&lt;/span&gt; Example App
    &lt;span class='p'&gt;=&lt;/span&gt; &lt;span class='n'&gt;stylesheet_link_tag&lt;/span&gt; &lt;span class='ss'&gt;:application&lt;/span&gt;
    &lt;span class='p'&gt;=&lt;/span&gt; &lt;span class='n'&gt;javascript_include_tag&lt;/span&gt; &lt;span class='ss'&gt;:application&lt;/span&gt;
    &lt;span class='p'&gt;=&lt;/span&gt; &lt;span class='n'&gt;csrf_meta_tag&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;To enable sprockets, make sure you have this at the bottom of your &lt;code&gt;config/application.rb&lt;/code&gt;:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='c1'&gt;# Enable the asset pipeline&lt;/span&gt;
    &lt;span class='c1'&gt;#...&lt;/span&gt;
    &lt;span class='n'&gt;config&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;assets&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;enabled&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='kp'&gt;true&lt;/span&gt;
  &lt;span class='k'&gt;end&lt;/span&gt;
&lt;span class='k'&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;When you have sprockets enabled, then that &lt;code&gt;stylesheet_link_tag :filename&lt;/code&gt; will look in &lt;code&gt;/assets&lt;/code&gt; for filename.css in the &lt;code&gt;app/assets/stylesheets&lt;/code&gt; folder, and then munge things together as explained.&lt;/p&gt;

&lt;p&gt;I actually spent some time trying to pass stylesheet_link_tag :defaults, :all, etc. until I realized that what you specify there will be looked for in the assets folder, and then read by Sprockets to actually build the content for that resource.&lt;/p&gt;

&lt;h2 id='javascripts'&gt;Javascripts&lt;/h2&gt;

&lt;p&gt;The same ideas hold true for the javascript side. When you generate a new Rails 3.1 app, jquery is a default, and you&amp;#8217;ll see it in the &lt;code&gt;vendor/assets/javascripts&lt;/code&gt; directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;example_app rails31 &amp;gt; ls -l vendor/assets/javascripts
total 480
-rw-r--r--  1 jack  staff   207K Apr 21 21:31 jquery.js
-rw-r--r--  1 jack  staff    22K Apr 21 23:46 jquery.tokeninput.js
-rw-r--r--  1 jack  staff   4.4K Apr 21 21:31 jquery_ujs.js&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You get jquery 1.5 at this point, though I imagine that will change soon as 1.6 is right around the corner.&lt;/p&gt;

&lt;p&gt;You&amp;#8217;ll also see jquery_ujs. This file is the new rails.js. Finally, you&amp;#8217;ll see my jquery.tokeninput.js as well.&lt;/p&gt;

&lt;h3 id='update'&gt;Update&lt;/h3&gt;

&lt;p&gt;This has changed with new versions of Rails. The javascript files are no longer copied into your application, but served out of the &lt;code&gt;vendor/assets/javascripts&lt;/code&gt; directory in the jquery-rails gem. See https://github.com/rails/jquery-rails/tree/master/vendor/assets/javascripts for info.&lt;/p&gt;

&lt;p&gt;To use these files, setup a &lt;code&gt;app/assets/javascripts/application.js&lt;/code&gt; like so:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='nx'&gt;example_app&lt;/span&gt; &lt;span class='nx'&gt;rails31&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='nx'&gt;cat&lt;/span&gt; &lt;span class='nx'&gt;app&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nx'&gt;assets&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nx'&gt;javascripts&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nx'&gt;application&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;js&lt;/span&gt; 
&lt;span class='c1'&gt;// FIXME: Tell people that this is a manifest file, &lt;/span&gt;
&lt;span class='c1'&gt;// real code should go into discrete files&lt;/span&gt;
&lt;span class='c1'&gt;// FIXME: Tell people how Sprockets and CoffeeScript works&lt;/span&gt;
&lt;span class='c1'&gt;//&lt;/span&gt;
&lt;span class='c1'&gt;//= require jquery&lt;/span&gt;
&lt;span class='c1'&gt;//= require jquery_ujs&lt;/span&gt;
&lt;span class='c1'&gt;//= require jquery.tokeninput&lt;/span&gt;
&lt;span class='c1'&gt;//= require_tree .&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Side note: the FIXME bits are from the Rails team. This stuff is brand new, and will likely get better explanations over time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The first three requires bring in the files in &lt;code&gt;vendor/assets/javascripts&lt;/code&gt;, while the last &lt;code&gt;require_tree .&lt;/code&gt; tells sprockets to require everything in the same directory. The require order is alphabetical, so you may have to move things around or be more specific to correctly get your dependencies in order.&lt;/p&gt;

&lt;p&gt;It looks like the requires know about the &lt;code&gt;vendor/assets/javascripts&lt;/code&gt; directory, and yet it didn&amp;#8217;t seem to work for the stylesheet tokeninput case. Will have to dig into it more.&lt;/p&gt;

&lt;h2 id='coffeescript__scss'&gt;CoffeeScript &amp;amp; SCSS&lt;/h2&gt;

&lt;p&gt;Using these techs is as easy as naming your files appropriately. One file I didn&amp;#8217;t expressly call out in my application.js file is the initializing file for the token input code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;example_app rails31 &amp;gt; ls -l app/assets/javascripts 
total 24
-rw-r--r--  1 jack  staff   245B Apr 21 23:46 application.js
-rw-r--r--  1 jack  staff    66B Apr 21 23:46 initialize.token-input.js.coffee&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The leading initialize. is just my own convention to clarify what the file is doing. It&amp;#8217;s quite simple:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='nx'&gt;example_app&lt;/span&gt; &lt;span class='nx'&gt;rails31&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='nx'&gt;cat&lt;/span&gt; &lt;span class='nx'&gt;app&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nx'&gt;assets&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nx'&gt;javascripts&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='nx'&gt;initialize&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;token&lt;/span&gt;&lt;span class='o'&gt;-&lt;/span&gt;&lt;span class='nx'&gt;input&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;js&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='nx'&gt;coffee&lt;/span&gt; 
&lt;span class='nx'&gt;$&lt;/span&gt; &lt;span class='o'&gt;-&amp;gt;&lt;/span&gt; &lt;span class='nx'&gt;$&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;#friends&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;).&lt;/span&gt;&lt;span class='nx'&gt;tokenInput&lt;/span&gt; &lt;span class='s1'&gt;&amp;#39;/friends.json&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nx'&gt;crossDomain&lt;/span&gt;&lt;span class='o'&gt;:&lt;/span&gt; &lt;span class='kc'&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;At first I forgot the leading &lt;code&gt;$ -&amp;gt;&lt;/code&gt; and was surprised when the token input code wasn&amp;#8217;t initialized. The JS was generated correctly, but of course it wasn&amp;#8217;t wrapped in a document ready bit, so remember to keep that piece in there.&lt;/p&gt;

&lt;p&gt;The same sort of thing works for SCSS files: the standard rails naming convention of name.generated_mime_type.type_of_file is in play here as well, so just create a foo.css.scss file and let sprockets do the rest.&lt;/p&gt;

&lt;h2 id='wrap_up'&gt;Wrap Up&lt;/h2&gt;

&lt;p&gt;I like these new changes. You don&amp;#8217;t have to use them, but for those that have been clamoring to make JS more of a respected citizen in a rails app, your day has come.&lt;/p&gt;

&lt;p&gt;I always find it hard to learn a topic, then forget that knowledge when writing up a how-to, so if I&amp;#8217;ve glossed over something here or there are other bits that confuse you, please drop a comment. One thing I didn&amp;#8217;t go into here was the new app/assets/images directory. Maybe in a future post.&lt;/p&gt;

&lt;h2 id='update'&gt;Update&lt;/h2&gt;

&lt;p&gt;Hopefully the above was helpful. If you&amp;#8217;re looking for a &amp;#8220;real&amp;#8221; app to take a try at, check out this example I made with Rails 3.1, Node.js, CoffeeScript, and Socket.IO: &lt;a href='https://github.com/jackdempsey/edgeside_chat'&gt;Edgeside Chat&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Slow Rails Bootups and Fixing RVM REE SSL Install Bug</title>
   <link href="http://jackdempsey.me/2011/04/15/fixing-rvm-ree-install-ssl.html" />
   <updated>2011-04-15T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2011/04/15/fixing-rvm-ree-install-ssl</id>
   <content type="html">&lt;h1&gt;Slow Rails Bootups and Fixing &lt;span class="caps"&gt;RVM&lt;/span&gt; &lt;span class="caps"&gt;REE&lt;/span&gt; &lt;span class="caps"&gt;SSL&lt;/span&gt; Install Bug&lt;/h1&gt;
&lt;h2&gt;Not Going Anywhere for a While?&lt;/h2&gt;
&lt;p&gt;&amp;#8220;15&amp;#8230;16&amp;#8230;17&amp;#8230;there we go.&amp;#8221;&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;ve found yourself counting the boot time for your fresh new Rails 3 / 1.9 app, and have approached the &lt;br /&gt;
&amp;#8220;&lt;span class="caps"&gt;OMFG&lt;/span&gt; really&amp;#8221; point of 17 seconds or so, take heart, you are not alone. Alastair Brunton wrote up a nice piece &lt;br /&gt;
&lt;a href="http://scoop.simplyexcited.co.uk/2011/03/14/rails-3-benchmarks-startup-time/"&gt;Rails 3 Benchmarks Startup Time&lt;/a&gt; which delves into the main issues here.&lt;/p&gt;
&lt;p&gt;If you just want the fix, the answer for now is &lt;span class="caps"&gt;REE&lt;/span&gt;, which brought my boot time from 17 seconds to about 4 or so. Much more reasonaable.&lt;/p&gt;
&lt;h2&gt;&lt;span class="caps"&gt;RVM&lt;/span&gt; &lt;span class="caps"&gt;REE&lt;/span&gt; Install Problems with Certs&lt;/h2&gt;
&lt;p&gt;Only problem is that I couldn&amp;#8217;t get &lt;span class="caps"&gt;RVM&lt;/span&gt; to install ree correctly. I was running &lt;span class="caps"&gt;RVM&lt;/span&gt; 1.5.3 and thought &amp;#8220;upgrading to the latest&lt;br /&gt;
usually fixes it&amp;#8221; but this sadly didn&amp;#8217;t work either, as a result of an MD5 checksum error.&lt;/p&gt;
&lt;p&gt;Yay. Off to shave some Yaks.&lt;/p&gt;
&lt;p&gt;So, I downloaded the &lt;a href="https://rvm.beginrescueend.com/install/rvm"&gt;&lt;span class="caps"&gt;RVM&lt;/span&gt; install script&lt;/a&gt; (which didn&amp;#8217;t work when accessed via curl),&lt;br /&gt;
manually ran it with &amp;#8216;bash &amp;lt; rvm&amp;#8217;, and finally had &lt;span class="caps"&gt;RVM&lt;/span&gt; 1.6.2 installed.&lt;/p&gt;
&lt;p&gt;Pop back to &lt;span class="caps"&gt;REE&lt;/span&gt;. I tried a bunch of Cert related Curl fixes and finally said &lt;a href="http://www.youtube.com/watch?v=2tJjNVVwRCY"&gt;fuck it, I&amp;#8217;ll do it live!!&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Doing it live&lt;/h2&gt;
&lt;p&gt;Take a look at your ~/.rvm/scripts/fetch file. Add &amp;#8212;insecure to the two fetch commands like so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; ! -z &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;rvm_proxy&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;

&lt;span class="k"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;fetch_command&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;curl --insecure -x${rvm_proxy} -L --create-dirs -C - &amp;quot;&lt;/span&gt; &lt;span class="c"&gt;# -s for silent&lt;/span&gt;

&lt;span class="k"&gt;else&lt;/span&gt;

&lt;span class="k"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;fetch_command&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;curl --insecure -L --create-dirs -C - &amp;quot;&lt;/span&gt; &lt;span class="c"&gt;# -s for silent&lt;/span&gt;

&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The usual comments of knowing what you&amp;#8217;re doing by adding &amp;#8212;insecure apply here. This is just a dirty way of getting shit done.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Getting Tir Working via Vagrant</title>
   <link href="http://jackdempsey.me/2010/12/08/getting-tir-working-via-vagrant.html" />
   <updated>2010-12-08T00:00:00-08:00</updated>
   <id>http://jackdempsey.me/2010/12/08/getting-tir-working-via-vagrant</id>
   <content type="html">&lt;h1&gt;Getting Tir Working via Vagrant&lt;/h1&gt;
&lt;p&gt;I&amp;#8217;ve been peeking at &lt;a href="http://mongrel2.org"&gt;Mongrel 2&lt;/a&gt; for some time now, and just haven&amp;#8217;t had a chance to do much with it. Recently &lt;a href="http://zedshaw.com/"&gt;Zed Shaw&lt;/a&gt; released &lt;a href="http://tir.mongrel2.org"&gt;Tir&lt;/a&gt;, a state agnostic web microframework. I decided today would be the day I kick this damn cold and finally tinker with it.&lt;/p&gt;
&lt;p&gt;As &lt;a href="http://twitter.com/zedshaw/status/12599187937955840"&gt;Zed replied&lt;/a&gt; to a gist of my aborted install attempt, there are some luaposix issues on OS X, so I decided to use this as an excuse to try out &lt;a href="http://www.engineyard.com/blog/2010/virtualize-this-instant-rails-in-a-virtual-box/"&gt;Vagrant&lt;/a&gt;. The process was straightforward and within a few minutes I was staring at a rails app in Ubuntu while using Chrome in OS X. Very cool.&lt;/p&gt;
&lt;p&gt;Back to Tir: installation on the Ubuntu VM was pretty straightforward, but there are a couple tips that might save you some time:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Install a few tools ahead of time: sudo apt-get install curl unzip git-core uuid-dev sqlite3&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://mongrel2.org/wiki?name=GettingStarted"&gt;Install Mongrel 2&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;if you see this &amp;#8220;error while loading shared libraries: libzmq.so.0: cannot open shared object file: No such file or directory&amp;#8221; run &amp;#8220;ldconfig -v&amp;#8221; as root&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
	&lt;li&gt;Install Lua 5.1 &amp;amp;&amp;amp; headers
	&lt;ul&gt;
		&lt;li&gt;sudo apt-get install lua5.1 liblua5.1-0-dev&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://luarocks.org/en/Installation_instructions_for_Unix"&gt;Install Luarocks&lt;/a&gt; from &lt;a href="http://luarocks.org/releases/luarocks-2.0.tar.gz"&gt;here&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;specify the location of lua.h: ./configure &amp;#8212;with-lua-include=/usr/include/lua5.1&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After that the rest of the &lt;a href="http://tir.mongrel2.org/wiki?name=Install"&gt;Tir installation&lt;/a&gt; went through perfectly and I was left with a working installation of Tir, using Mongrel 2, on a Ubuntu box inside a VM managed by Vagrant. Thoughts of Inception float through my head.&lt;/p&gt;
&lt;p&gt;If you haven&amp;#8217;t checked it out, it&amp;#8217;s definitely worth doing so for both the experience with Lua as well as to take a peek at what could very well become the next movement in web framework design. The various experimentations (many small processes, natural, stateless, and evented handlers, backend agnostic app connections) are all interesting and in my opinion, very forward thinking. I believe some of the ideas have already inspired changes in other frameworks like &lt;a href="http://nodejs.org/"&gt;Node.js&lt;/a&gt;, and I&amp;#8217;d guess that&amp;#8217;s only the beginning.&lt;/p&gt;
&lt;h3&gt;Update&lt;/h3&gt;
&lt;p&gt;Zed&amp;#8217;s updated Tir to now work out of the box with OS X. Follow the normal instructions directly on your own command line and you should be good to go!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Contributing to Open Source</title>
   <link href="http://jackdempsey.me/2010/09/20/contributing-to-open-source.html" />
   <updated>2010-09-20T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/09/20/contributing-to-open-source</id>
   <content type="html">&lt;h1&gt;Contributing to Open Source&lt;/h1&gt;
&lt;p&gt;I recently fixed a small bug in Thor as a result of &lt;a href="http://github.com/wycats/thor/issues/issue/67"&gt;this question from Ajsie.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After I pushed the fix Asjie sent me this (included with permission):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;Hi Jack!

I am the one that issued the &amp;quot;true/false yes?&amp;quot; bug that you fixed.
I am new to ruby. Worked with it for 3 months.
I have a question about how to fix a bug.
I have installed the Thor gem with &amp;quot;gem install thor&amp;quot;.
So when I find a bug and want to look at the source code and fix it in place 
then push it up to GitHub, how do I do that?
Should I run:
    git clone http://github.com/wycats/thor.git
then fix the bug in that one? But isn&amp;#39;t my system using the gem Thor? And what 
are the commands that I should use for Git and how do I tell the author to do 
a pull request? Could you tell me how/which one you patch and how to push it 
and make a pull request?
I would really love to contribute myself instead of 
asking for bug fixes in the future.
Thanks.

/Ajsie
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I realized that this would be a perfect opportunity to take Matt Might&amp;#8217;s second tip and &lt;a href="http://matt.might.net/articles/how-to-blog-as-an-academic/"&gt;Reply To Public&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been involved with Open Source Software for about as long as I&amp;#8217;ve been in tech. My first steps into the world of the web were through &lt;span class="caps"&gt;HTML&lt;/span&gt; and Javascript. I progressed towards a &lt;span class="caps"&gt;LAMP&lt;/span&gt; stack that serviced me well for years, to finally end up in the world of Ruby &amp;amp; Rails.&lt;/p&gt;
&lt;p&gt;Anyway, my point is that it&amp;#8217;s been a long 15 years or so, and I&amp;#8217;ve sort of forgotten some things along the way. I guess it&amp;#8217;s probably more that they&amp;#8217;ve become so engrained that they&amp;#8217;re not forgotten, just a part of me that I don&amp;#8217;t think of at all&amp;#8212;my third arm, Open Source. In many ways it&amp;#8217;s more important than the other two, and yet couldn&amp;#8217;t exist without them.&lt;/p&gt;
&lt;p&gt;I realized though with Ajsie&amp;#8217;s email that there are others on the same sort of journey, but further on up the road. So I&amp;#8217;m taking some time to write out a couple of thoughts on the topic, and will intersperse them with real world examples where helpful.&lt;/p&gt;
&lt;p&gt;To keep my already rambling style bearable, I&amp;#8217;m breaking them up into several posts as follows:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Welcome to Open Source. Now what?&lt;/li&gt;
	&lt;li&gt;How to get involved&lt;/li&gt;
	&lt;li&gt;Contributing via GitHub&lt;/li&gt;
	&lt;li&gt;Tip &amp;amp; Suggestions&lt;/li&gt;
	&lt;li&gt;Final thoughts&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I hope this will be helpful to others just starting their journey, as well as those who&amp;#8217;ve been around a bit, but still have something to learn. I&amp;#8217;ve seen some negative behavior over the last couple weeks by people who should know better, so hopefully those of you will stay tuned as well.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Git tips: add content intelligently</title>
   <link href="http://jackdempsey.me/2010/07/29/git-tips-add-content-intelligently.html" />
   <updated>2010-07-29T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/07/29/git-tips-add-content-intelligently</id>
   <content type="html">&lt;h1&gt;Git tips: add content intelligently&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;This is one of several posts designed for those of you who&amp;#8217;ve migrated from svn to git, but find your workflow and patterns to be very &amp;#8216;svn like&amp;#8217;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This borders a bit more on the &amp;#8220;being a good programmer&amp;#8221; side of things, than something you have to do for technological reasons, but I believe in it and think you should too.&lt;/p&gt;
&lt;p&gt;Back in &lt;span class="caps"&gt;SVN&lt;/span&gt; land, what did you do when you&amp;#8217;ve got a bunch of uncommitted files littering your project and you remember something random that also needs fixing.&lt;/p&gt;
&lt;p&gt;You open up that file and make the change.&lt;/p&gt;
&lt;p&gt;Then you sit there. You realize can&amp;#8217;t commit that file because it has a change that shouldn&amp;#8217;t go out just yet. What do you do?&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve seen (and done) any of the following:&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
	&lt;li&gt;commit it anyway. Everything will be ok (except when it&amp;#8217;s not)&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;keep it around until the feature you&amp;#8217;re working on is ready. You commit only to find someone else fixed it in a worse way, or maybe better way and got credit for it. But you thought of it first! Oh well, next time Gadget.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;copy that file to your desktop. Undo the changes and make just the change you care about and commit. Copy the file from the desktop back into place. This should feel embarassing. If this is how you need to get around this situation with your &lt;span class="caps"&gt;VCS&lt;/span&gt;, it should be a sign that maybe you need something more powerful&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;
&lt;p&gt;For this situation the git answer is: git add -p&lt;/p&gt;
&lt;p&gt;From the man pages:&lt;br /&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;-i, --interactive
Add modified contents in the working tree interactively to the
index. Optional path arguments may be supplied to limit operation
to a subset of the working tree. See &lt;span class="s2"&gt;&amp;quot;Interactive mode&amp;quot;&lt;/span&gt; &lt;span class="k"&gt;for&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;-i, --interactive
Add modified contents in the working tree interactively to the
index. Optional path arguments may be supplied to limit operation
to a subset of the working tree. See &amp;lt;span class="s2"&amp;gt;&amp;amp;quot;Interactive mode&amp;amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class="k"&amp;gt;for&amp;lt;/span&amp;gt;
details.&lt;/p&gt;
&lt;p&gt;-p, &amp;#8212;patch&lt;br /&gt;
Interactively choose hunks of patch between the index and the work&lt;br /&gt;
tree and add them to the index. This gives the user a chance to&lt;br /&gt;
review the difference before adding modified contents to the index.&lt;/p&gt;
&lt;p&gt;This effectively runs add &amp;#8212;interactive, but bypasses the initial&lt;br /&gt;
&lt;span class="nb"&gt;command &lt;/span&gt;menu and directly jumps to the patch subcommand. See&lt;br /&gt;
&lt;span class="s2"&gt;&amp;quot;Interactive mode&amp;quot;&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;details.&lt;br /&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;I had used git for a many months before I heard about interactive add. It&amp;#8217;s really a wonderful option for those who care about keeping their commits to logical groupings of related content. What it means in practice is this: let&amp;#8217;s say you have a situation like so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;diff --git a/file1 b/file1
index 8124a24..467954e 100644
--- a/file1
+++ b/file1
@@ -1,3 +1,4 @@
+a new first line
some lines of content here

and some here
@@ -6,3 +7,4 @@ and some here
more again here

and here
+and a new last line
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;One file, two changes. The first really needs to be added along with some other changes, while that last line change is something you need for the future, but have already done now so you don&amp;#8217;t forget. What do you do?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/git_svn_post new_feature &amp;gt; gap
diff --git a/file1 b/file1
index 8124a24..467954e 100644
--- a/file1
+++ b/file1
@@ -1,3 +1,4 @@
+a new first line
some lines of content here

and some here
Stage this hunk &lt;span class="o"&gt;[&lt;/span&gt;y,n,q,a,d,/,j,J,g,e,?&lt;span class="o"&gt;]&lt;/span&gt;?
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;gap, as you could probably guess, is my alias for git add -p.&lt;/p&gt;
&lt;p&gt;So, you&amp;#8217;ll see some options &amp;#8220;Stage this hunk&amp;#8230;&amp;#8221;&lt;/p&gt;
&lt;p&gt;You can now say &amp;#8220;yes, I would like to add this to the staging area&amp;#8221; by hitting y.&lt;br /&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;Stage this hunk &lt;span class="o"&gt;[&lt;/span&gt;y,n,q,a,d,/,j,J,g,e,?&lt;span class="o"&gt;]&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;Stage this hunk &amp;lt;span class="o"&amp;gt;[&amp;lt;/span&amp;gt;y,n,q,a,d,/,j,J,g,e,?&amp;lt;span class="o"&amp;gt;]&amp;lt;/span&amp;gt;? y
@@ -6,3 +7,4 @@ and some here
more again here&lt;/p&gt;
&lt;p&gt;and here&lt;br /&gt;
+and a new last line&lt;br /&gt;
Stage this hunk &lt;span class="o"&gt;[&lt;/span&gt;y,n,q,a,d,/,K,g,e,?&lt;span class="o"&gt;]&lt;/span&gt;?&lt;br /&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;br /&gt;
and now you can say &amp;#8220;nope, not at this time&amp;#8221; by hitting n for this change. Take a look at your status now:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/git_svn_post new_feature &amp;gt; gst
&lt;span class="c"&gt;# On branch new_feature&lt;/span&gt;
&lt;span class="c"&gt;# Changes to be committed:&lt;/span&gt;
&lt;span class="c"&gt;#   (use &amp;quot;git reset HEAD ...&amp;quot; to unstage)&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;#	modified:   file1&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# Changed but not updated:&lt;/span&gt;
&lt;span class="c"&gt;#   (use &amp;quot;git add ...&amp;quot; to update what will be committed)&lt;/span&gt;
&lt;span class="c"&gt;#   (use &amp;quot;git checkout -- ...&amp;quot; to discard changes in working directory)&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;#	modified:   file1&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
~/git_svn_post new_feature &amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The first time you see the above you might be a bit confused, but it&amp;#8217;s straightforward: there are some changes in file1 that are to be committed (they&amp;#8217;re in the index) and there are some changes that are just local (remember, the last line fix).&lt;/p&gt;
&lt;p&gt;This is how you add just a few pieces of a file and not others.&lt;/p&gt;
&lt;p&gt;What if the changes are close to each other in the file? Then use s for split:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/git_svn_post new_feature &amp;gt; gap
diff --git a/file1 b/file1
index 6360209..ec68580 100644
--- a/file1
+++ b/file1
@@ -7,8 +7,15 @@ some changes here
and some here

-and more here
+more changes here
+
+and here
+

+and here
+
+and more here
+and here
more again here

and here
Stage this hunk &lt;span class="o"&gt;[&lt;/span&gt;y,n,q,a,d,/,s,e,?&lt;span class="o"&gt;]&lt;/span&gt;? s
Split into 2 hunks.
@@ -7,5 +7,8 @@
and some here

-and more here
+more changes here
+
+and here
+

Stage this hunk &lt;span class="o"&gt;[&lt;/span&gt;y,n,q,a,d,/,j,J,g,e,?&lt;span class="o"&gt;]&lt;/span&gt;?
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Sometimes you won&amp;#8217;t see the s when the change is several contiguous lines. In this case you can actually edit the diff to directly say what you want to get added. Bad ass. I&amp;#8217;ll go over this in a future post.&lt;/p&gt;
&lt;h3&gt;Why you should add things in small increments&lt;/h3&gt;
&lt;p&gt;There are several reasons:&lt;br /&gt;
&lt;ol&gt;&lt;br /&gt;
	&lt;li&gt;Code of a feather belongs together: if you always keep code that is part of the same feature together in the same commit, this will save you (and others) so much time after the fact. No more hunting across mulitple commits to truly understand a change. One patch file is enough to try out a new feature. A caveat applies here in that, if you have a large feature, it can make sense to have multiple commits. But often, in developing that feature, certain subcomponents come to mind: I might commit all the model related changes, and then controller updates, and then views. Or maybe I&amp;#8217;ll do them all at once. The point is to think intelligently about what you are doing.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Having smaller more thought out commits also makes things like &lt;code&gt;git bisect&lt;/code&gt; much easier to use. Think of this as continuous deployment except for your commit files. When changes are small, incremental, and all go together, your life as a debugger later on is that much better.&lt;/li&gt;&lt;/p&gt;
&lt;/ol&gt;
&lt;p&gt;So, next time you have a bunch of changes spanning several features and you reach for &lt;code&gt;git commit -a&lt;/code&gt; take a second to think if they truly belong in the same commit.&lt;/p&gt;
&lt;script type='text/javascript'&gt;
  var disqus_url = "http://jackdempsey.me/git/git-tips-add-content-intelligently/";
&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Reading email from Gmail with ruby</title>
   <link href="http://jackdempsey.me/2010/07/17/reading-email-from-gmail-with-ruby.html" />
   <updated>2010-07-17T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/07/17/reading-email-from-gmail-with-ruby</id>
   <content type="html">&lt;h1&gt;Reading email from Gmail with ruby&lt;/h1&gt;
&lt;p&gt;I&amp;#8217;m working on a bit of code that needs to read emails from Gmail. So far I&amp;#8217;ve made use of the fetcher library:&lt;/p&gt;
&lt;p&gt;http://github.com/look/fetcher&lt;/p&gt;
&lt;p&gt;and have it configured to have an ActionMailer subclass receive the email for processing.&lt;/p&gt;
&lt;p&gt;One thing I&amp;#8217;ve found useful so far, and that wasn&amp;#8217;t obvious at first, is a way to stop the emails from being marked as read. Take a look at the gist below&lt;/p&gt;
&lt;script src="http://gist.github.com/479836.js"&gt; &lt;/script&gt;&lt;p&gt;Now, instead of going back to the account, marking the emails as unread and moving them back to the inbox, I get the info and the email stays right where it is.&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;HTH&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In doing a bit more searching I&amp;#8217;ve come across the incredibly useful ruby-gmail library: &lt;a href="http://github.com/dcparker/ruby-gmail"&gt;http://github.com/dcparker/ruby-gmail&lt;/a&gt; If you&amp;#8217;re doing anything with ruby and Gmail, you have to look up this plugin.&lt;/p&gt;
&lt;script type='text/javascript'&gt;
  var disqus_url = "http://jackdempsey.me/ruby/reading-email-from-gmail-with-ruby/";
&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Git tips: when branches diverge</title>
   <link href="http://jackdempsey.me/2010/07/01/git-when-branches-diverge.html" />
   <updated>2010-07-01T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/07/01/git-when-branches-diverge</id>
   <content type="html">&lt;h1&gt;Git tips: when branches diverge&lt;/h1&gt;
&lt;p&gt;While committing to an app from a couple different computers, my repos got out of sync:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app ads &amp;gt; gco master
Switched to branch &lt;span class="s1"&gt;&amp;#39;master&amp;#39;&lt;/span&gt;
Your branch and &lt;span class="s1"&gt;&amp;#39;origin/master&amp;#39;&lt;/span&gt; have diverged,
and have 2 and 7 different commit&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; each, respectively.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;So, to figure out what this means, here are a couple tips. First, you can use the cherry command to &lt;br /&gt;
see what commits differ between branches, and in what ways. So in this case, running &amp;#8216;g cherry origin/master&amp;#8217; shows us the status of commits on the &lt;br /&gt;
current branch and how they stack up against origin/master. So:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app master &amp;gt; g cherry origin/master
+ 7584c09a5c0ea68c29f4724788e9f38b119cd6ec
+ f3a766e6dd7c08be07c6300b005af2674a96e74c
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;That mean&amp;#8217;s that those two commits don&amp;#8217;t exist on origin/master, they need to be added (hence the +). This explains the &amp;#8220;2&amp;#8221; part of &lt;br /&gt;
the &amp;#8220;2 and 7 different commits&amp;#8221; message we saw.&lt;/p&gt;
&lt;p&gt;Now, let&amp;#8217;s see what&amp;#8217;s going on with origin/master and its commits. For this we can run a log command with a special format:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app master &amp;gt; gl ..origin/master --oneline
7d6b4b8 fix staging db config
4d96719 Adding links to the bottom of all pages and cleaning up active tab text colors &lt;span class="k"&gt;for &lt;/span&gt;all themes except &lt;span class="k"&gt;for &lt;/span&gt;4 and 1
66e69ea Merge branch &lt;span class="s1"&gt;&amp;#39;master&amp;#39;&lt;/span&gt; of github.com:example_appwedding/example_app into themes
ec35a04 Hot fix
95959fb Merge branch &lt;span class="s1"&gt;&amp;#39;master&amp;#39;&lt;/span&gt; of github.com:example_appwedding/example_app into themes
019d5dc committing fixes to haml update
01095dc random
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Here we see 7 commits there that don&amp;#8217;t exist on our current branch.&lt;/p&gt;
&lt;p&gt;So now we have a good idea of what&amp;#8217;s happened. I&amp;#8217;ve made two commits on my local master branch, and it looks like there are 7 commits on origin/master&lt;br /&gt;
I don&amp;#8217;t have merged in yet. So, I could just blindly merge things together and go on my way (if they merge without conflict), but I&amp;#8217;d like to show you&lt;br /&gt;
how to deal with it in a more controlled manner.&lt;/p&gt;
&lt;p&gt;First, create a branch that points to your current &lt;span class="caps"&gt;HEAD&lt;/span&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app master &amp;gt; gco -b local_changes
Switched to a new branch &lt;span class="s1"&gt;&amp;#39;local_changes&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now that we have that to keep track of those changes, we switch back to master:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app local_changes &amp;gt; gco master
Switched to branch &lt;span class="s1"&gt;&amp;#39;master&amp;#39;&lt;/span&gt;
Your branch and &lt;span class="s1"&gt;&amp;#39;origin/master&amp;#39;&lt;/span&gt; have diverged,
and have 2 and 7 different commit&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; each, respectively.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;At this point, reset the master branch to get rid of the 2 commits. To do this you want to go to the third commit back, or &lt;span class="caps"&gt;HEAD&lt;/span&gt;^^&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app master &amp;gt; g reset --hard HEAD^^
HEAD is now at f2fe0d4 get satisfaction js update from alex
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now let&amp;#8217;s see what our status looks like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app master &amp;gt; gst
&lt;span class="c"&gt;# On branch master&lt;/span&gt;
&lt;span class="c"&gt;# Your branch is behind &amp;#39;origin/master&amp;#39; by 7 commits, and can be fast-forwarded.&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
nothing to commit &lt;span class="o"&gt;(&lt;/span&gt;working directory clean&lt;span class="o"&gt;)&lt;/span&gt;
~/example_app master &amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;There we go! We can now easily merge origin/master in and then handle merging in local_changes if it still makes sense.&lt;/p&gt;
&lt;p&gt;This could easily be the end of this post. However, in the actual situation that prompted this point, things weren&amp;#8217;t quite this simple. &lt;br /&gt;
I actually had other branches that had already been rebased against master and it created a situation like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&amp;lt;snip&amp;gt;
 +    &lt;span class="o"&gt;[&lt;/span&gt;delete_account&lt;span class="o"&gt;]&lt;/span&gt; put in beginnings of delete account
++* + &lt;span class="o"&gt;[&lt;/span&gt;local_changes&lt;span class="o"&gt;]&lt;/span&gt; don&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;t show get tab in dev mode
++* + &lt;span class="o"&gt;[&lt;/span&gt;local_changes^&lt;span class="o"&gt;]&lt;/span&gt; slot in same check &lt;span class="k"&gt;for &lt;/span&gt;a blank field to remain blank
++*++ &lt;span class="o"&gt;[&lt;/span&gt;local_changes~2&lt;span class="o"&gt;]&lt;/span&gt; js update 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;So I had removed this changes from my master branch, but they still existed in other branches. Because I know they&amp;#8217;re contained&lt;br /&gt;
in local_changes, I can remove them from the other branches (and those other branches haven&amp;#8217;t been pushed anywhere).&lt;/p&gt;
&lt;p&gt;I dug around a bit more and realized that those sames changes were already in another branch that &lt;span class="caps"&gt;HAD&lt;/span&gt; been pushed to origin. So, I can remove them from other branches that have them and haven&amp;#8217;t been pushed.&lt;/p&gt;
&lt;p&gt;First I delete local_changes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app master&amp;gt; gb -D local_changes
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I have more work to do. Those commits still exist in other branches:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;  *+ &lt;span class="o"&gt;[&lt;/span&gt;master~5&lt;span class="o"&gt;]&lt;/span&gt; random
 +   &lt;span class="o"&gt;[&lt;/span&gt;delete_account&lt;span class="o"&gt;]&lt;/span&gt; put in beginnings of delete account
++ + &lt;span class="o"&gt;[&lt;/span&gt;ads~8&lt;span class="o"&gt;]&lt;/span&gt; don&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;t show get tab in dev mode
++ + &lt;span class="o"&gt;[&lt;/span&gt;ads~9&lt;span class="o"&gt;]&lt;/span&gt; slot in same check &lt;span class="k"&gt;for &lt;/span&gt;a blank field to remain blank
++*+ &lt;span class="o"&gt;[&lt;/span&gt;ads~10&lt;span class="o"&gt;]&lt;/span&gt; js update
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;So I can check out the ads branch and remove those two commits:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app master &amp;gt; gco ads
Switched to branch &lt;span class="s1"&gt;&amp;#39;ads&amp;#39;&lt;/span&gt;
~/example_app ads &amp;gt; gri head~10
Successfully rebased and updated refs/heads/ads.
~/example_app ads &amp;gt; gsb
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Explained:&lt;/p&gt;
&lt;p&gt;1. git checkout the ads branch&lt;br /&gt;
3. git rebase &lt;del&gt;i head~10 -&lt;/del&gt; This lets me interactively rewrite the history. If you delete a line in an interactive rebase, it&amp;#8217;s gone from your history&lt;br /&gt;
(which is why it&amp;#8217;s really important to &lt;span class="caps"&gt;NOT&lt;/span&gt; do this if you&amp;#8217;ve pushed that commit elsewhere). &lt;br /&gt;
At this point I removed those two commits and am good. &lt;br /&gt;
5. I did a quick git show-branch to see how everything looked.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll do the same thing with the delete_account branch, and now let&amp;#8217;s take a look at my repo:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;~/example_app ads &amp;gt; gsb
* &lt;span class="o"&gt;[&lt;/span&gt;ads&lt;span class="o"&gt;]&lt;/span&gt; refactor left rail calls
 ! &lt;span class="o"&gt;[&lt;/span&gt;delete_account&lt;span class="o"&gt;]&lt;/span&gt; put in beginnings of delete account
  ! &lt;span class="o"&gt;[&lt;/span&gt;master&lt;span class="o"&gt;]&lt;/span&gt; fix staging db config
   ! &lt;span class="o"&gt;[&lt;/span&gt;theme_branch&lt;span class="o"&gt;]&lt;/span&gt; add in colors
----
*    &lt;span class="o"&gt;[&lt;/span&gt;ads~7&lt;span class="o"&gt;]&lt;/span&gt; refactor left rail calls 
 +   &lt;span class="o"&gt;[&lt;/span&gt;delete_account&lt;span class="o"&gt;]&lt;/span&gt; put in beginnings of delete account
   + &amp;lt;snip&amp;gt;
*+++ &lt;span class="o"&gt;[&lt;/span&gt;master&lt;span class="o"&gt;]&lt;/span&gt; fix staging db config
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Everything&amp;#8217;s looking good. The various branches have only their important commits to differentiate them, nothing&amp;#8217;s confusing. I&amp;#8217;m ready to go.&lt;/p&gt;
&lt;p&gt;This may seem like a lot of work but in practice it&amp;#8217;s quick and very useful in my experience. I&amp;#8217;m convinced part of the reason people get confused&lt;br /&gt;
with git is that they don&amp;#8217;t take proper care of their repositories and branches.&lt;/p&gt;
&lt;p&gt;Note: often you can just merge things and git will do a lot of the heavy lifting and thinking for you. But if you only ever just merge blindly, you&amp;#8217;re going to confuse yourself, your commit history, and not really know what&amp;#8217;s going on. It&amp;#8217;s often worth spending a little bit of time to think about what you&amp;#8217;re doing. This sort of exercise should also help you deal with situations where a simple merge will not suffice.&lt;/p&gt;
&lt;p&gt;Aliases:&lt;br /&gt;
I like to alias everything. I think it&amp;#8217;s worth seeing how other&amp;#8217;s alias things&amp;#8212;you might pick up a good tip or two. However, I don&amp;#8217;t expect people to know my own aliases, so here&amp;#8217;s a little key.&lt;/p&gt;
&lt;p&gt;If it turns out people would much rather see the full commands typed out, I can do that as well, just let me know.&lt;/p&gt;
&lt;p&gt;g = git&lt;br /&gt;
gco = git checkout&lt;br /&gt;
gl = git log&lt;br /&gt;
gst = git status&lt;br /&gt;
gb = git branch&lt;br /&gt;
gri = git rebase -i&lt;/p&gt;
&lt;script type='text/javascript'&gt;
  var disqus_url = "http://jackdempsey.me/git/git-when-branches-diverge/";
&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Git tips: work on local branches</title>
   <link href="http://jackdempsey.me/2010/07/01/git-tips-work-on-local-branches.html" />
   <updated>2010-07-01T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/07/01/git-tips-work-on-local-branches</id>
   <content type="html">&lt;h1&gt;Git tips: work on local branches&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;This is one of several posts designed for those of you who&amp;#8217;ve migrated from svn to git, but find your workflow and patterns to be very &amp;#8216;svn like&amp;#8217;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#8217;s basically no reason you shouldn&amp;#8217;t do your local work on a branch. If you have a small feature touching a couple files, just create a branch and do your work on it. Remember, this is git, you don&amp;#8217;t have to remember what revision you branched at when you merge back in later (ugh svn), it&amp;#8217;s fast as hell, and no one will ever see that you created it either!&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s why this is important and useful. Let&amp;#8217;s say you&amp;#8217;re working on master. You&amp;#8217;ve made a few commits and you&amp;#8217;re getting ready to finish when someone says &amp;#8220;fix this quick and push it please&amp;#8221;. Ok, so you make that change and you&amp;#8217;re stuck: you&amp;#8217;re not ready to push your other commits, just this recent one. What do you do? (I can go over how to get out of this if anyone&amp;#8217;s curious). This wouldn&amp;#8217;t happen if you had just done your new feature on a local branch and then rebased against master. Easy.&lt;/p&gt;
&lt;p&gt;How about something similar: you&amp;#8217;re doing your work on master, committing as you go, and then hear that an important fix has been pushed to origin and that you should bring it down. Well, you think, I can easily just git pull &amp;#8212;rebase right? Sure&amp;#8230;except what if you had another branch that you &lt;span class="caps"&gt;HAD&lt;/span&gt; rebase against master in trying to keep things clean. Now you&amp;#8217;re in a bind: if you rebase master, the changes you brought into this other branch will mis-match: same content but different sha&amp;#8217;s, and you&amp;#8217;ll be stuck doing some sort of git cherry pick attempt at undoing things. Again, just because you didn&amp;#8217;t work on a local topic branch.&lt;/p&gt;
&lt;p&gt;This is not to say that you can&amp;#8217;t work on master. If it&amp;#8217;s a one file fix, go ahead! But if you think you&amp;#8217;re going to be working on it for even a little, do yourself a favor and type &amp;#8220;git checkout -b practicing_good_habits&amp;#8221; and get to it.&lt;/p&gt;
&lt;script type='text/javascript'&gt;
  var disqus_url = "http://jackdempsey.me/git/git-tips-work-on-local-branches/";
&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Git tips: don't hold commits forever</title>
   <link href="http://jackdempsey.me/2010/07/01/git-tips-dont-hold-commits-forever.html" />
   <updated>2010-07-01T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/07/01/git-tips-dont-hold-commits-forever</id>
   <content type="html">&lt;h1&gt;Git tips: don&amp;#8217;t hold commits forever&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;This is one of several posts designed for those of you who&amp;#8217;ve migrated from svn to git, but find your workflow and patterns to be very &amp;#8216;svn like&amp;#8217;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re coming from an &lt;span class="caps"&gt;SVN&lt;/span&gt; background you&amp;#8217;re used to the &amp;#8216;push&amp;#8217; aspect of transferring your commits being done for you&amp;#8230;not so with git. What this creates sometimes is a situation where you&amp;#8217;ve happily committed again and again, and haven&amp;#8217;t shared this with anyone. So then finally you make a huge push of 2 days of work and shocker, there&amp;#8217;s a conflict. It&amp;#8217;s so much easier to just make sure you&amp;#8217;re keeping other&amp;#8217;s up to date and being a good git citizen by pushing every so often.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll generally push once a feature/topic is complete. Everyone working with me can count on that feature being ready to use, and if they have any issues we can catch it much earlier in the process. If it&amp;#8217;s going to be a branch that exists for a while, then I&amp;#8217;ll push that out when it&amp;#8217;s ready to first be viewed by others. Just be careful this doesn&amp;#8217;t lead to the original situation of you holding on to changes much longer than you should.&lt;/p&gt;
&lt;script type="text/javascript"&gt;
  var disqus_url = "http://jackdempsey.me/git/git-tips-dont-hold-commits-forever/";
&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Easily run the same code across multiple IRB/console sessions</title>
   <link href="http://jackdempsey.me/2010/06/29/easily-run-the-same-code-across-multiple-irbconsole-sessions.html" />
   <updated>2010-06-29T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/06/29/easily-run-the-same-code-across-multiple-irbconsole-sessions</id>
   <content type="html">&lt;h1&gt;Easily run the same code across multiple &lt;span class="caps"&gt;IRB&lt;/span&gt;/console sessions&lt;/h1&gt;
&lt;p&gt;Ever get tired of typing the same commands each time you load up a Rails console? Or, scrolling through your history til you find that one command and then doing it again for the one after it, etc, etc?&lt;/p&gt;
&lt;p&gt;I did. So, I wrote the shortest hack that could work.&lt;/p&gt;
&lt;script src="http://gist.github.com/456688.js"&gt;&lt;/script&gt;&lt;p&gt;Drop that in your .irbrc file and you&amp;#8217;re good to go. Here&amp;#8217;s how to use it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;euraeka&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt;
&lt;span class="no"&gt;Loading&lt;/span&gt; &lt;span class="n"&gt;development&lt;/span&gt; &lt;span class="n"&gt;environment&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Rails&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;beta3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2010&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mo"&gt;01&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;rem&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;a = Article.last&amp;quot;&lt;/span&gt;
 &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt; 
&lt;span class="n"&gt;ree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2010&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mo"&gt;01&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;euraeka&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt;
&lt;span class="no"&gt;Loading&lt;/span&gt; &lt;span class="n"&gt;development&lt;/span&gt; &lt;span class="n"&gt;environment&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Rails&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;beta3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2010&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mo"&gt;01&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="n"&gt;rem&lt;/span&gt;
 &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="c1"&gt;#&amp;lt;Article id: 8999482, title: &amp;quot;Animal ID scheme pushed despite FedFarm scepticism&amp;quot;, url: &amp;quot;http://computerworld.co.nz/news.nsf/news/animal-id-...&amp;quot;&amp;gt; &lt;/span&gt;
&lt;span class="n"&gt;ree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2010&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mo"&gt;01&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;euraeka&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="sr"&gt;/.remembered_commands &lt;/span&gt;
&lt;span class="sr"&gt;a = Article.last&lt;/span&gt;
&lt;span class="sr"&gt;projects/eu&lt;/span&gt;&lt;span class="n"&gt;raeka&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt;
&lt;span class="no"&gt;Loading&lt;/span&gt; &lt;span class="n"&gt;development&lt;/span&gt; &lt;span class="n"&gt;environment&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Rails&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;beta3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2010&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mo"&gt;01&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;rem&lt;/span&gt; &lt;span class="ss"&gt;:clear&lt;/span&gt;
 &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; 
&lt;span class="n"&gt;ree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2010&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mo"&gt;01&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;euraeka&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="sr"&gt;/.remembered_commands&lt;/span&gt;
&lt;span class="sr"&gt;cat: /&lt;/span&gt;&lt;span class="no"&gt;Users&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;jack&lt;/span&gt;&lt;span class="o"&gt;/.&lt;/span&gt;&lt;span class="n"&gt;remembered_commands&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;No&lt;/span&gt; &lt;span class="n"&gt;such&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;directory&lt;/span&gt;
&lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;euraeka&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Notes: &lt;br /&gt;
src == script/rails console. I like to alias everything. &lt;br /&gt;
? == you have some stuff in git you need to push. Really useful. More on git &lt;a href="http://jackdempsey.me/?p=27"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the simplest thing that could work. Feel free to fork it in Gist and improve on it. It&amp;#8217;s ugly as is, but at least it&amp;#8217;s solved an annoyance for me.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update&lt;/b&gt;: I realized after running it a bit that the scoping was incorrect and whatever local vars you might eval inside rem wouldn&amp;#8217;t be accessible to you in &lt;span class="caps"&gt;IRB&lt;/span&gt;. For now just run the &amp;#8216;eval rem&amp;#8217; as I&amp;#8217;ve changed it to be above.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Installing HomeBrew</title>
   <link href="http://jackdempsey.me/2010/06/28/installing-homebrew.html" />
   <updated>2010-06-28T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/06/28/installing-homebrew</id>
   <content type="html">&lt;h1&gt;Installing HomeBrew&lt;/h1&gt;
&lt;p&gt;I&amp;#8217;ve heard many people smarter than I say how amazing HomeBrew is, getting almost religious about it. After seeing more and more &amp;#8220;brew install project-i-want-to-experiment-with&amp;#8221; I decided to give it a try today.&lt;/p&gt;
&lt;p&gt;One problem: the permissions changes it makes seem to be incomplete at this time. Maybe this was a recent change, I&amp;#8217;m not quite sure, but either way I figured out how to get things working. You can look at the report I filed &lt;a href="http://github.com/mxcl/homebrew/issues/issue/1713"&gt;here&lt;/a&gt; or just skip to the fix at the gist &lt;a href="http://gist.github.com/456048"&gt;here&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Some git aliases and tips</title>
   <link href="http://jackdempsey.me/2010/06/23/some-git-aliases-and-tips.html" />
   <updated>2010-06-23T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/06/23/some-git-aliases-and-tips</id>
   <content type="html">&lt;h1&gt;Some git aliases and tips&lt;/h1&gt;
&lt;p&gt;In preparation for a &lt;a href="http://www.meetup.com/dcruby/calendar/13484724/"&gt;talk I gave&lt;/a&gt; at DC &lt;span class="caps"&gt;RUG&lt;/span&gt;, I combed over my various git related customizations and realized a few might be worth mentioning here.&lt;/p&gt;
&lt;p&gt;When I first started with git I was so focused on learning the tech, I didn&amp;#8217;t do much to make my life easier, and I realize now that was a mistake. So without further ado, here are some aliases I use frequently:&lt;/p&gt;
&lt;script src="http://gist.github.com/449478.js"&gt;&lt;/script&gt;&lt;p&gt;I&amp;#8217;ve also included a script that I call out to from one of the aliases, so if you didn&amp;#8217;t know you could do that, check it out, it&amp;#8217;s pretty useful. Plus I just like telling my repo&amp;#8217;s to &lt;strong&gt;git onup&lt;/strong&gt;. I&amp;#8217;ll probably create a &amp;#8220;git toit&amp;#8221; command at some point.&lt;/p&gt;
&lt;p&gt;Anyway, the &lt;strong&gt;onup&lt;/strong&gt; aliases uses the zsh script to take all local branches and rebase them against master. This saves a lot of typing if you have a few ideas floating around and continually make changes to master you need to bring into those branches.&lt;/p&gt;
&lt;p&gt;I also use &lt;strong&gt;squish&lt;/strong&gt; and &lt;strong&gt;squeeze&lt;/strong&gt; a bit. The difference between the two is that &lt;strong&gt;squish&lt;/strong&gt; takes all changes and &amp;#8220;squishes&amp;#8221; them into the last commit with the same commit message. &lt;strong&gt;queeze&lt;/strong&gt; does the same, but only for content currently in the staging area. I find myself often making small/focused commits, and these are easy ways of slowly added related changes to those same commits quickly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;save&lt;/strong&gt; is also useful: did you know that once you &lt;strong&gt;git stash&lt;/strong&gt; content, it&amp;#8217;s saved for you inside git, even if you lose it from your current working directory?&lt;/p&gt;
&lt;p&gt;So, this is useful in this situation: you&amp;#8217;re working on a bunch of files and have to leave for a bit. Rather than making a temporary commit that you have to then reset later, you can just say &lt;strong&gt; git save&lt;/strong&gt; and it will stash then apply your content, leaving your working directory just as you wanted, but with the added protection that if somehow you say checkout a clean copy of the dir later, thereby deleting all of your hard work, you can still get it back. (I definitely did that once or twice, and that was the primary motivation behind this alias).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;pop&lt;/strong&gt; is pretty self explanatory: don&amp;#8217;t like what the top commit does? pop it off and fix it up. Just remember: if you&amp;#8217;ve already pushed that commit and then you try to rewrite your history, you&amp;#8217;re going to create trouble for yourself and others.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;git wu&lt;/strong&gt; or &amp;#8220;git whatup&amp;#8221; as I mentally remember it is an easy way of seeing what changes you have on your master that aren&amp;#8217;t on origin, or in simpler terms, what commits have you not pushed yet.&lt;/p&gt;
&lt;p&gt;I think those are the interesting ones. I&amp;#8217;ve cobbled these together from my own ideas and the ideas of others, so if you have any suggestions or some aliases you like using, please leave a note.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>get rid of those awkward where conditions in Rails</title>
   <link href="http://jackdempsey.me/2010/05/24/get-rid-of-those-awkward-where-conditions-in-rails.html" />
   <updated>2010-05-24T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/05/24/get-rid-of-those-awkward-where-conditions-in-rails</id>
   <content type="html">&lt;h1&gt;get rid of those awkward where conditions in Rails&lt;/h1&gt;
&lt;p&gt;We originally developed &lt;a href="http://euraeka.com"&gt;http://euraeka.com&lt;/a&gt; in &lt;a href="http://merbivore.com/"&gt;Merb&lt;/a&gt;, &lt;a href="http://sequel.rubyforge.org/documentation.html"&gt;Sequel&lt;/a&gt;, and some other great Ruby tech. Recently though with &lt;a href="http://weblog.rubyonrails.org/2010/4/13/rails-3-0-third-beta-release"&gt;Rails 3&lt;/a&gt; on the horizon I&amp;#8217;ve converted the stack and really like the end result. One thing I&amp;#8217;ve missed though is the ease of generating queries with Sequel&amp;#8212;it just felt very &amp;#8216;Rubyish&amp;#8217; and my first guess was often correct: want all items with a price under 50?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:price&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Items created within the last day?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ago&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;There was no :conditions hash to clutter things, no array of clauses and values, and no sql with some question marks interspersed throughout.&lt;/p&gt;
&lt;p&gt;So today I take a look at the latest &lt;a href="http://railscasts.com/"&gt;Railscast&lt;/a&gt; and not only does &lt;a href="http://twitter.com/rbates"&gt;Ryan&lt;/a&gt; do a great job of showing some tips and tricks for queries in Rails 3, but he gives a mention to &lt;a href="http://github.com/ernie/meta_where"&gt;meta_where&lt;/a&gt;. At first I thought &amp;#8220;looks nice but would I use it?&amp;#8221; After looking into it a bit more, the answer is easily &amp;#8220;hell yes&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s look at some code. The old way:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;scope&lt;/span&gt; &lt;span class="ss"&gt;:day_old&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;fetch_date &amp;gt; ?&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;New way:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;scope&lt;/span&gt; &lt;span class="ss"&gt;:day_old&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:fetch_date&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ago&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# or even&lt;/span&gt;
&lt;span class="n"&gt;scope&lt;/span&gt; &lt;span class="ss"&gt;:day_old&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:fetch_date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ago&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s about as clean and easy to write and then read later as you can get.&lt;/p&gt;
&lt;p&gt;More examples:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="c1"&gt;# old&lt;/span&gt;
&lt;span class="n"&gt;articles&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;id not in (?)&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;article_ids&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#new&lt;/span&gt;
&lt;span class="n"&gt;articles&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:id&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;article_ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;For those not wishing to use overloaded operators, you can still get a benefit from meta_where&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;articles&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:id&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;not_in&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;article_ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;You can read more about other options at the &lt;a href="http://metautonomo.us/projects/metawhere/"&gt;project&amp;#8217;s home page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This post barely scratches the surface of what&amp;#8217;s possible, but hopefully it will peak some interest and get more eyeballs on a project that could be of great use to many of us. Also, a big thanks to &lt;a href="http://twitter.com/erniemiller"&gt;@erniemiller&lt;/a&gt; for answering some questions today related to edge changes to meta_where, arel, and rails. Tip: the latest features might need edge versions of all three to work, so you might want to let them progress a bit more before jumping fully in and using everything available.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Rails 3: Generators</title>
   <link href="http://jackdempsey.me/2010/03/31/hello-world.html" />
   <updated>2010-03-31T00:00:00-07:00</updated>
   <id>http://jackdempsey.me/2010/03/31/hello-world</id>
   <content type="html">&lt;h1&gt;Rails 3: Generators&lt;/h1&gt;
&lt;p&gt;I&amp;#8217;ve been working on a variety of new ideas and projects recently, and find myself doing a lot of generating: models, scaffolds, migrations, and so on. After about the 10th &amp;#8220;generate a scaffold and delete all of the dirs/files I don&amp;#8217;t want&amp;#8221; I decided there must be a better way.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been a fan of &lt;a href="http://github.com/wycats/thor"&gt;Thor&lt;/a&gt; since the early days, and knew &lt;a href="http://github.com/josevalim"&gt;Jose Valim&lt;/a&gt; had been busy working away on some cool new tech. So, without further ado, here&amp;#8217;s a sneak peek at what&amp;#8217;s in store for you in Rails 3.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Overriding Templates&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I like using scaffolding to get quick ideas up and running. However, I&amp;#8217;ve really grown tired of the xml pieces in the controller scaffold, and wanted an efficient way of not using them. With the generators in Rails 3 it&amp;#8217;s easy!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Creating Your Own &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With the variety of choices we have when creating Rails 3 apps, there will definitely be situations where you&amp;#8217;ll want to automate some of those choices. For me, I want to use Haml for views&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the Application Config&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One new addition to Rails 3 that slipped past me til now is kind of hidden in config/application.rb:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;    &lt;span class="c1"&gt;# Configure generators values. Many other options are available, be sure to check the documentation.&lt;/span&gt;
    &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;generators&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
      &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;template_engine&lt;/span&gt; &lt;span class="ss"&gt;:haml&lt;/span&gt;
      &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;layout&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
      &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test_framework&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;
      &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stylesheets&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content>
 </entry>
 
 
</feed>

