<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title></title>
    <description></description>
    <link>http://lenni.info/blog</link>
    <atom:link href="http://lenni.info/blog/feed.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>Editing Scala with vim</title>
        <description>&lt;p&gt;Even though it hurts my brain a little bit, learning Scala has been
a pleasurable part of my job lately. It definitely isn&amp;#39;t for the
faint-hearted but it has taught me a lot about thinking precisely about
the topics of immutability and shared state. The functional mindset forces
you to think mainly about input and output of functions and this training,
I feel, makes me a better programmer even when programming in a language other than Scala.&lt;/p&gt;

&lt;h4&gt;Tools&lt;/h4&gt;

&lt;p&gt;I&amp;#39;m not really an IDE lover, quite the opposite, but I have started taking
a shine to the comforts that Intelli-J is offering when writing Java.&lt;/p&gt;

&lt;p&gt;I was happy to see that Intelli-J has a plugin for Scala development and have
been using that for the last couple of months. Sadly, the plugin is really,
really slow which makes it pretty unusable to me.&lt;/p&gt;

&lt;p&gt;There is no question that the languages is beautiful but the tools aren&amp;#39;t.&lt;/p&gt;

&lt;h4&gt;Enter vim&lt;/h4&gt;

&lt;p&gt;I&amp;#39;m already using vim for everything other than Java so I hunted around the
web in order to find plugins. I&amp;#39;ve been quite satisfied with the
following combination.&lt;/p&gt;

&lt;h4&gt;&lt;a href=&quot;vim-scala&quot;&gt;vim-scala&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;Obviously, you will need syntax highlighting and this plugin provides that.&lt;/p&gt;

&lt;h4&gt;&lt;a href=&quot;https://github.com/Shougo/neocomplcache&quot;&gt;neocomplcache&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;The built-in vim autocomplete isn&amp;#39;t great for Scala but the &lt;a href=&quot;https://github.com/Shougo/neocomplcache&quot;&gt;&lt;code&gt;neocomplcache&lt;/code&gt;&lt;/a&gt; plugin
makes typing out long Scala class or package names easier. There is no
semantic analysis behind it so all this plugin does is string matching but
I was very surprised to realise that this takes you a long way. To me at least
it is adequate.&lt;/p&gt;

&lt;h4&gt;ctags&lt;/h4&gt;

&lt;p&gt;In order to enable jump-to-source navigation you need to configure ctags to
index scala files. You can do that by adding the following to your &lt;code&gt;~/.ctags&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;--langdef&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;scala
--langmap&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;scala:.scala
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;private|protected&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;?&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\4&lt;/span&gt;/c,classes/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;private|protected&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;?&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*object&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\4&lt;/span&gt;/c,objects/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;private|protected&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;?&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*case class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\4&lt;/span&gt;/c,case classes/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;private|protected&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;?&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*case object&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\4&lt;/span&gt;/c,case objects/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;private|protected&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;?&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*trait&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\4&lt;/span&gt;/t,traits/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*type&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\1&lt;/span&gt;/T,types/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*def&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\3&lt;/span&gt;/m,methods/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*val&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\3&lt;/span&gt;/l,constants/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;abstract|final|sealed|implicit|lazy&lt;span class=&quot;o&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;*var&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\3&lt;/span&gt;/l,variables/
--regex-scala&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/^&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;*package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;a-zA-Z0-9_.&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;+&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/&lt;span class=&quot;se&quot;&gt;\1&lt;/span&gt;/p,packages/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After having done that you need to run ctags from the root of your project
directory with something like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;ctags -R . --exclude&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;target --exclude&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;vendor
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;By default vim will only look for the tags file in the directory of the file
open in the current buffer. If you want vim do move up the directory hierarchy
until it has found the file add this to your &lt;code&gt;~/.vimrc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;vim&quot;&gt;&lt;span class=&quot;k&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;tags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;tags&lt;/span&gt;;/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now, if you move the cursor over a type name and press &lt;code&gt;Ctrl-]&lt;/code&gt; you will jump
to the definition of the type. That&amp;#39;s pretty nifty!&lt;/p&gt;

&lt;p&gt;If you want to go back to where you were before the jump press &lt;code&gt;Ctrl-T&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;Sorting of imports&lt;/h4&gt;

&lt;p&gt;Based on feedback from a collegue who was complaining that my imports always
look messy I have &lt;a href=&quot;https://github.com/derekwyatt/vim-scala/pull/24&quot;&gt;contributed a command&lt;/a&gt;
 to the &lt;code&gt;vim-scala&lt;/code&gt; plugin which automatically sorts your import statements.&lt;/p&gt;

&lt;p&gt;You can invoke the command with &lt;code&gt;:SortScalaImports&lt;/code&gt; and there are two modes
on how your imports could be sorted. By default the command goes through
the import groups (which are defined as separated by a newline) and orders
them alphabetically. This is useful for when you prefer to sort your import
into groups yourself like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scala&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Utility imports&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;com.me&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;com.them&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Concurrency imports&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;akka....&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;scala...&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java...&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;spray....&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Domain imports&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;com.me.data....&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;com.me.data....&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The second mode can be enabled by setting the following in your &lt;code&gt;.vimrc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;vim&quot;&gt;&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;g&lt;/span&gt;:scala_sort_across_groups&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will take &lt;em&gt;all&lt;/em&gt; of your imports and puts them into 3 different groups:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Java/Scala core libraries&lt;/li&gt;
&lt;li&gt;3rd party libraries&lt;/li&gt;
&lt;li&gt;First party code, a.k.a your own&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What is considered first party code can be configured by setting the a regex.
I have set it to this, which is for a standard Play app:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;vim&quot;&gt;&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;g&lt;/span&gt;:scala_first_party_namespaces&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;\(controllers\|views\|models\|util\|de.\)&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The result of the sort looks like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scala&quot;&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.text.SimpleDateFormat&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.util.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Currency&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Locale&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UUID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Calendar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;scala.collection.JavaConversions._&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;scala.util.Random&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;play.api._&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;play.api.mvc._&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;controllers.Secured._&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;de.mycompany.useful.library.Class&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;util._&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
        <pubDate>Fri, 05 Apr 2013 00:00:00 +0200</pubDate>
        <link>http://lenni.info/blog/2013/04/editing-scala-with-vim</link>
        <guid isPermaLink="true">http://lenni.info/blog/2013/04/editing-scala-with-vim</guid>
      </item>
    
      <item>
        <title>My 2009 dissertation using GATE</title>
        <description>&lt;p&gt;Not quite 4 years ago I left university after having graduated with a degree
in computer science. I did fairly well on my final dissertation and have
been meaning to publish it for quite some time but never actually came round
to it.&lt;/p&gt;

&lt;p&gt;The reason that publishing this popped back into my mind was that last week
a colleague and I got chatting about a friend of his who is also wanting to
write a thesis on natural language processing.&lt;/p&gt;

&lt;p&gt;The dissertation is titled &lt;em&gt;Automatic extraction and categorisation of
bicycle items for sale on an internet bulletin board&lt;/em&gt; and its focus is
on natural language processing using the software &lt;a href=&quot;http://gate.ac.uk/&quot;&gt;GATE&lt;/a&gt;
developed at the University of Sheffield.&lt;/p&gt;

&lt;p&gt;If you want to download the PDF you can also head over to
&lt;a href=&quot;https://docs.google.com/file/d/0B8fpFPFuEud6MExRcGJmVDhBc3M/edit&quot;&gt;the documents&amp;#39;s page&lt;/a&gt;.
From there you can download the original PDF on the top left corner.&lt;/p&gt;
</description>
        <pubDate>Tue, 29 Jan 2013 00:00:00 +0100</pubDate>
        <link>http://lenni.info/blog/2013/01/my-dissertation-using-gate</link>
        <guid isPermaLink="true">http://lenni.info/blog/2013/01/my-dissertation-using-gate</guid>
      </item>
    
      <item>
        <title>Handlebars array access</title>
        <description>&lt;p&gt;I keep forgetting and regoogling this and apparently it isn&amp;#39;t documented anywhere
I could find it, so I&amp;#39;m going to write it down hoping that Google will
help spread the word.&lt;/p&gt;

&lt;h4&gt;So, how do I access an array in a Handlebar template?&lt;/h4&gt;

&lt;p&gt;The syntax is the following: &lt;code&gt;{{ array.[index] }}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;An example from an app I&amp;#39;m building right now&lt;/h4&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;img-container pull-left&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  {{ #if imageURLs.length }}
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{{ imageURLs.[0] }}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  {{ else }}
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://placehold.it/130x130&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;img-polaroid&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  {{ /if }}
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 27 Nov 2012 00:00:00 +0100</pubDate>
        <link>http://lenni.info/blog/2012/11/handlebars-array-access</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/11/handlebars-array-access</guid>
      </item>
    
      <item>
        <title>Tools for the discerning front end developer</title>
        <description>&lt;h3&gt;Pro-forma preamble&lt;/h3&gt;

&lt;p&gt;Working as a web developer and doing a lot of frontend work, over the years I have collected a rather nice tool belt (if I may say so) of things that make me more productive. Today I&amp;#39;d like to share some of these.&lt;/p&gt;

&lt;h3&gt;Javascript&lt;/h3&gt;

&lt;h4&gt;Grunt&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;https://lh6.googleusercontent.com/-rC0dC5mG4Pk/UJgVyx8ORJI/AAAAAAAAIQw/Q4M0-N92Q08/s288/logo.png&quot; alt=&quot;Grunt logo&quot;&gt;&lt;/p&gt;

&lt;p&gt;One of my more recent discoveries is a JavaScript build tool called &lt;a href=&quot;http://gruntjs.com/&quot;&gt;grunt&lt;/a&gt;. Even though I guess you could use it to build node modules, it is really meant for frontend coding tasks. If you&amp;#39;ve ever written your own scripts to glue together &lt;code&gt;jshint&lt;/code&gt;, &lt;code&gt;uglify&lt;/code&gt;, file concatenation and &lt;code&gt;rsync&lt;/code&gt; and wondered if there is a better way, grunt can help you. It is ideal not only for those things but has plugins for virtually everything like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CoffeeScript, including on-the-fly compilation if a file is modified&lt;/li&gt;
&lt;li&gt;CSS Compression&lt;/li&gt;
&lt;li&gt;LessCSS compilation&lt;/li&gt;
&lt;li&gt;Live Reload of a website without browser plugins (more about this in the next section)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yes, there is a bewildering array of JS build tools (Jake, Cake, Yeoman, Buildr, custom ant scripts... the list goes on) but I found grunt so far the most pleasurable to use. Go try it out.&lt;/p&gt;

&lt;h4&gt;&lt;a href=&quot;https://github.com/webxl/grunt-reload&quot;&gt;Grunt Live Reload plugin&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;Frankly, this is like magic. What this enables you to do is to hit save in your favourite text editor and have this automatically trigger a refresh of the page you are working on. And all of that without even installing a browser extension. The way this works is by injecting a little snippet of JavaScript into the page which in turn opens a Websocket connection to the development server which watches for changes on the file system. Here is an example &lt;code&gt;grunt.js&lt;/code&gt; file to achieve this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;grunt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;grunt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;initConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;lint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;js/*.js&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;less&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;style.less&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;style.css&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;watch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;*.less&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;tasks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;less reload&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;reload&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6001&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;proxy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;host&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;8000&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;grunt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;loadNpmTasks&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;grunt-contrib-less&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;grunt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;loadNpmTasks&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;grunt-reload&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;grunt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;registerTask&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;default&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;server reload watch&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Who knew that development could be fun with tools like this?&lt;/p&gt;

&lt;h4&gt;CSS reload bookmarklet&lt;/h4&gt;

&lt;p&gt;If you don&amp;#39;t need the whole live reload setup or are maybe using a web framework which doesn&amp;#39;t play nice with grunt you can use Paul Irish&amp;#39;s &lt;a href=&quot;http://paulirish.com/2008/how-to-iterate-quickly-when-debugging-css/&quot;&gt;CSS reload bookmarklet&lt;/a&gt;. This simply iterates over all the stylesheets in the document and adds a fake parameter with a timestamp value to their URL causing them to be reloaded. The timestamp also takes care of any caching issues.&lt;/p&gt;

&lt;p&gt;Chrome doesn&amp;#39;t allow bookmarklets to be invoked with a keyboard shortcut but I found the following trick to be able to kinda-simulate a shortcut: You need to bind the bookmarklet to a custom search, which in turn can be triggered by a one-letter keyword.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://lh5.googleusercontent.com/-_Whl1sZppio/UJgbghpKQwI/AAAAAAAAIRA/h-aeCDdn3-w/s674/Screen%2520Shot%25202012-11-05%2520at%252021.02.27.png&quot; alt=&quot;Setting a &amp;quot;shortcut&amp;quot; to a bookmarklet in Chrome by abusing a saved search&quot;&gt;&lt;/p&gt;

&lt;p&gt;In order to do this, create a new search, paste the bookmarklet Javascript URL into the URL field, give it a name and a one letter keyword (I have given it the letter &amp;#39;r&amp;#39;). Now you can jump to the URL bar with ⌘ + L, then type R and hit enter and voila, your CSS is reloaded without you having to refresh the entire page.&lt;/p&gt;

&lt;h4&gt;&lt;a href=&quot;http://cdnjs.com/&quot;&gt;cdnjs&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;This free, community-curated CDN hosts Javascript libraries like Backbone, moment.js and various popular jQuery plugins. Using this has the double advantage of not polluting your source tree with third-party libraries as well as speeding up your page load by spreading the load onto multiple servers.&lt;/p&gt;

&lt;p&gt;An added bonus: They support SPDY for extra-parallel download for enabled browsers. You can also add a library you need to the CDN by submitting a pull request. I&amp;#39;ve done that a few times and Ryan and Thomas have always been quick and &lt;em&gt;very&lt;/em&gt; friendly.&lt;/p&gt;

&lt;h3&gt;Twitter Bootstrap related&lt;/h3&gt;

&lt;h4&gt;&lt;a href=&quot;http://bootswatch.com/&quot;&gt;Bootswatch&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;If you can&amp;#39;t stand the default look of Bootstrap anymore go and check out this nice selection of themes for Bootstrap.&lt;/p&gt;

&lt;h4&gt;&lt;a href=&quot;http://bootstrap-forms.heroku.com/&quot;&gt;Bootstrap Form Builder&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;https://lh6.googleusercontent.com/-Od5fO3TehO4/UJgTx4eGJUI/AAAAAAAAIQo/Z4zslSr1aOw/s481/Screen%2520Shot%25202012-11-05%2520at%252020.29.45.png&quot; alt=&quot;Bootstrap Form Builder&quot;&gt;&lt;/p&gt;

&lt;p&gt;If you&amp;#39;re building a lot of forms with Bootstrap, you probably want to check out this little app. It gives you a nice UI for building them.&lt;/p&gt;

&lt;h4&gt;&lt;a href=&quot;http://bootsnipp.com/&quot;&gt;Bootsnipp&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;If it isn&amp;#39;t forms specifically you&amp;#39;re building, Bootsnipp gives you small snippets of readymade Bootstrap components and examples of what you could build with Bootstrap.&lt;/p&gt;

&lt;h4&gt;&lt;a href=&quot;http://www.bootstrapcdn.com/&quot;&gt;BootstrapCDN&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;Are you tired of re-adding Bootstrap&amp;#39;s CSS file to your repositories over and over or using Github as a static asset server? As the name suggests this free CDN hosts Bootstrap for you. My favourite feature are the hosted versions of Bootswatch.&lt;/p&gt;

&lt;h3&gt;Misc.&lt;/h3&gt;

&lt;h4&gt;&lt;a href=&quot;http://fontello.com/&quot;&gt;Fontello&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;Remember the days when you had to pester your designer for small icon PNGs (most likely in plain as well as mouseover/active variations)? Thank God we have icon fonts now! The only downside is that selecting an icon character and inserting it into your HTML is quite a bit of work and may involve special programs for font managements.&lt;/p&gt;

&lt;p&gt;Fontello is a web app that has made it its mission to take away the pain from using icon fonts. They have collected a hand full of very popular icon fonts (&lt;a href=&quot;http://www.entypo.com/&quot;&gt;Entypo&lt;/a&gt;, for example), have given each icon character a simple, descriptive name and make this all available as single webfont file (in all formats you&amp;#39;ll ever need) plus a handy stylesheet. This lets you create icons by simply applying a CSS class to an element, just as it is done in Twitter Bootstrap.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://lh5.googleusercontent.com/-fj4HRCQhhxQ/UJgkMDywG3I/AAAAAAAAIRU/H5NWQF-UcEA/s229/Screen%2520Shot%25202012-11-05%2520at%252021.39.53.png&quot; alt=&quot;Fontello&quot;&gt;&lt;/p&gt;

&lt;p&gt;If you suggest this in your team, your designer will love you as this frees her/him up to do actual design. Other benefits are that you can style your icons with CSS and have a lot less HTTP requests during page load.&lt;/p&gt;

&lt;h4&gt;JSON formatting&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;http://stedolan.github.com/jq/&quot;&gt;jq&lt;/a&gt; is pretty nice tool for querying a JSON document but if all you need is a pretty printer you can pipe your JSON through a built in python module with the following one-liner:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{&amp;quot;foo&amp;quot;: &amp;quot;lorem&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;ipsum&amp;quot;}&amp;#39;&lt;/span&gt; | python -mjson.tool
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I have this aliased in my &lt;code&gt;.profile&lt;/code&gt; to jsonpretty with a&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;jsonpretty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;python -mjson.tool&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;&lt;a href=&quot;http://betterthangrep.com/&quot;&gt;ack&lt;/a&gt; - better than grep&lt;/h4&gt;

&lt;p&gt;If the project-wide full text search of &lt;code&gt;$FAVOURITE_IDE&lt;/code&gt; sucks, and lets be honest they all do, and grep is just a little too awkward to use then take a look at ack. It has changed the way I explore and navigate source trees. Ack is designed to search through large source code trees, searches recursively by default and excludes stuff you definitely don&amp;#39;t want to search like git and temp folders.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://lh3.googleusercontent.com/-R7dPtGgbuvQ/UJlzS4QCrlI/AAAAAAAAIRk/EnSQkgHQPy0/s471/Screen%2520Shot%25202012-11-06%2520at%252021.29.07.png&quot; alt=&quot;Grepping with ack&quot;&gt;&lt;/p&gt;

&lt;p&gt;Even though it is currently still in alpha state, I&amp;#39;m using version 2.0 for a couple of months now without any issues. Ack 2 removes the limitation of having to keep a whitelist of files to be searched and includes all text files by default. Another thing which wasn&amp;#39;t possible in ack 1 but is in 2 is including file names without dots (i.e. &lt;code&gt;Gemfile&lt;/code&gt;). If you want to install ack 2.0 alpha through homebrew, I have prepared a recipe for you. Just do a&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;brew install https://raw.github.com/lenniboy/ack2-compiled/master/ack2.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Testing regular expressions&lt;/h3&gt;

&lt;p&gt;To me it was a real eye opener when I discovered visual regex tools. They
shorten the feedback loop drastically and make reasoning about them a lot
easier (even though it still often takes a few moments to fully wrap your head
around what is happening.)&lt;/p&gt;

&lt;p&gt;My current favourite for doing that using the JS regex syntax is
an obscure tool called &lt;a href=&quot;http://www.gethifi.com/tools/regex&quot;&gt;Hifi Regex Tester&lt;/a&gt;.
Even though its usability isn&amp;#39;t too great (too many colours!) it is the only
one that I have found which displays match groups.&lt;/p&gt;

&lt;p&gt;If you can live without match groups, &lt;a href=&quot;http://refiddle.com/&quot;&gt;refiddle&lt;/a&gt; feels a
lot more modern and tidied up.&lt;/p&gt;

&lt;h3&gt;Your favourites&lt;/h3&gt;

&lt;p&gt;If you liked this little list, how about you letting me know about other
productivity enhancers?&lt;/p&gt;
</description>
        <pubDate>Sun, 25 Nov 2012 00:00:00 +0100</pubDate>
        <link>http://lenni.info/blog/2012/11/tools-for-the-discerning-frontend-developer</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/11/tools-for-the-discerning-frontend-developer</guid>
      </item>
    
      <item>
        <title>Slides for my talk at CocoaHeads Berlin</title>
        <description>&lt;p&gt;Yesterday I gave a talk at Cocoaheads Berlin, which is the iOS/OS X developers user group here. The talk was titled &amp;quot;CocoaPods - Sane library management for Xcode&amp;quot;.&lt;/p&gt;

&lt;p&gt;If you are interested in reading &lt;a href=&quot;http://lenni.info/cocoapods-talk/&quot;&gt;my HTML slide deck&lt;/a&gt;, I&amp;#39;ve made them available online.&lt;/p&gt;

&lt;p&gt;Here is the same thing in a little embedded viewer:&lt;/p&gt;

&lt;iframe src=&quot;http://www.slideshare.net/slideshow/embed_code/14779558&quot; width=&quot;476&quot; height=&quot;400&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;
</description>
        <pubDate>Thu, 18 Oct 2012 00:00:00 +0200</pubDate>
        <link>http://lenni.info/blog/2012/10/slides-for-my-talk-at-cocoaheads-berlin</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/10/slides-for-my-talk-at-cocoaheads-berlin</guid>
      </item>
    
      <item>
        <title>Updating Ubuntu server to the latest beta version (command line edition)</title>
        <description>&lt;p&gt;I keep forgetting this, so I&amp;#39;m going to write it down.&lt;/p&gt;

&lt;p&gt;Ubuntu can pick up the latest development version with a&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;sudo do-release-upgrade -d # -d means development version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But that seems to not pick up any pre-release versions if it isn&amp;#39;t configured correctly. You must change the file &lt;code&gt;/etc/update-manager/release-upgrades&lt;/code&gt; and set&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;Prompt=normal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
        <pubDate>Thu, 11 Oct 2012 00:00:00 +0200</pubDate>
        <link>http://lenni.info/blog/2012/10/updating-ubuntu-server-to-the-latest-beta-version-command-line-edition</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/10/updating-ubuntu-server-to-the-latest-beta-version-command-line-edition</guid>
      </item>
    
      <item>
        <title>List all your Github pull requests with a jQuery widget</title>
        <description>&lt;p&gt;I, like a lot of developers, love Github. I treat my account a bit like a business card for myself and brochure for what I can do. Whenever the time rolls around to look for a new job, having a few interesting project in there helps a lot during and after the interview.&lt;/p&gt;

&lt;p&gt;The problem however is, that some of the work I do is in pull requests to other projects. After my pull request is either accepted or rejected I usually delete my fork of the project because I want my project list to be clean and free of stuff of which I am merely a small time contributor. There is no way on the Github website itself to list a user&amp;#39;s past pull requests.&lt;/p&gt;

&lt;p&gt;So, in order to show off the pull requests I have done, I coded up a little widget (needs jQuery) which pulls the information out of the API and displays it. So, without much further ado, here it is.&lt;/p&gt;

&lt;script src=&quot;http://lenni.info/pull-request-widget/pull-request-widget.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;http://lenni.info/pull-request-widget/pull-request-widget.css&quot;/&gt;&lt;/p&gt;

&lt;div id=&quot;pull-requests&quot; data-github-user=&quot;lenniboy&quot;&gt;&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
jQuery(document).ready(function(){
  jQuery(&quot;#pull-requests&quot;).pullRequests();
});
&lt;/script&gt;

&lt;p&gt;If you want to know how to use it yourself, check out the &amp;quot;&lt;a href=&quot;http://lenni.info/pull-request-widget&quot;&gt;marketing website&lt;/a&gt;&amp;quot;, which has instructions about adding it to your website.&lt;/p&gt;
</description>
        <pubDate>Wed, 12 Sep 2012 00:00:00 +0200</pubDate>
        <link>http://lenni.info/blog/2012/09/list-all-your-github-pull-requests-with-a-jquery-widget</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/09/list-all-your-github-pull-requests-with-a-jquery-widget</guid>
      </item>
    
      <item>
        <title>Using a mocked session when writing tests for Play Framework 1.2</title>
        <description>&lt;p&gt;Today I wanted to write a functional test for a Play 1.2.4 app that required the request to come with a preinitialised Play session. At first I thought that this would be easy, however it turned out that there isn&amp;#39;t a ready-made solution for this built in so I had to cobble together the pieces myself.&lt;/p&gt;

&lt;p&gt;Here is the method which I have put in the base class for all my FunctionalTests:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;java&quot;&gt;&lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sessionedRequest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;throws&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Throwable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// mostly copied from https://github.com/playframework/play/blob/master/framework/src/play/mvc/Scope.java#L255&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;keySet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;\u0000&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;\u0000&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sessionData&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;URLEncoder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;encode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sign&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Crypto&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;sign&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sessionData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Play&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;secretKey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getBytes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Request&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newRequest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Cookie&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cookie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Cookie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cookieName&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;PLAY_SESSION&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cookie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cookieName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cookie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sign&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;-&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sessionData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;cookies&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ImmutableMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cookieName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cookie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
</description>
        <pubDate>Mon, 30 Jul 2012 00:00:00 +0200</pubDate>
        <link>http://lenni.info/blog/2012/07/using-a-mocked-session-when-writing-tests-for-play-framework-1-2</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/07/using-a-mocked-session-when-writing-tests-for-play-framework-1-2</guid>
      </item>
    
      <item>
        <title>Hell has frozen over! Microsoft Azure supports Linux instances</title>
        <description>&lt;p&gt;I didn&amp;#39;t think I would see this day but today I clicked on an ad for Microsoft Azure on Stackoverflow and saw that Azure is offering &lt;a href=&quot;http://www.windowsazure.com/en-us/pricing/calculator/?scenario=virtual-machines&quot;&gt;Ubuntu Linux instances&lt;/a&gt;! After picking up my jaw from the floor, I just had to share this with the world.&lt;/p&gt;

&lt;p&gt;I had never even looked at Azure, as I&amp;#39;m a happy AWS customer, so this could be old news but most articles talking about Ubuntu on Azure are dated 7th of June 2012 so I take it this is pretty new.&lt;/p&gt;

&lt;p&gt;It&amp;#39;s pretty obvious that MS is mightily scared of being left out of the two computing markets that are growing like crazy right now: mobile and cloud computing. Exciting times ahead.&lt;/p&gt;
</description>
        <pubDate>Sat, 16 Jun 2012 00:00:00 +0200</pubDate>
        <link>http://lenni.info/blog/2012/06/hell-has-frozen-over-microsoft-azure-supports-linux-images</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/06/hell-has-frozen-over-microsoft-azure-supports-linux-images</guid>
      </item>
    
      <item>
        <title>Installing Ruby 1.9.3 on Ubuntu 12.04 Precise Pengolin (without RVM)</title>
        <description>&lt;p&gt;The new Ubuntu release has just rolled around and with it a slew of new packages. Personally, I&amp;#39;m tracking the development of Ruby quite closely but the default Ruby on Ubuntu ist still the 1.8 series which I can&amp;#39;t recommend. Ruby 1.9 has some performance improvements and 1.9.3 in particular a lot of them compared to 1.9.2.&lt;/p&gt;

&lt;p&gt;However, as I have elaborated in a &lt;a title=&quot;Installing Ruby 1.9.2 on Ubuntu 11.10 Oneiric Ocelot without using RVM&quot; href=&quot;http://lenni.info/blog/2011/12/installing-ruby-1-9-2-on-ubuntu-11-10-oneric-ocelot-without-using-rvm/&quot;&gt;previous post&lt;/a&gt; getting the Ruby 1.9 series on Ubuntu without using RVM instead of 1.8 isn&amp;#39;t all that easy. Please read the post if you are interested in the details.&lt;/p&gt;

&lt;p&gt;The short version is: You can get Ruby 1.9.3-p0 by installing the &lt;code&gt;ruby-1.9.1&lt;/code&gt; package. (The package is called 1.9.1 because that is the ABI version.)&lt;/p&gt;

&lt;p&gt;If you want to make Ruby 1.9 the default do the following:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;sudo apt-get update

sudo apt-get install ruby1.9.1 ruby1.9.1-dev &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev

sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
         --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
                        /usr/share/man/man1/ruby1.9.1.1.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        --slave   /usr/bin/ri ri /usr/bin/ri1.9.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        --slave   /usr/bin/irb irb /usr/bin/irb1.9.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1

&lt;span class=&quot;c&quot;&gt;# choose your interpreter&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# changes symlinks for /usr/bin/ruby , /usr/bin/gem&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# /usr/bin/irb, /usr/bin/ri and man (1) ruby&lt;/span&gt;
sudo update-alternatives --config ruby
sudo update-alternatives --config gem

&lt;span class=&quot;c&quot;&gt;# now try&lt;/span&gt;
ruby --version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you want to make this your exclusive Ruby and get rid of Ruby 1.8 follow the &lt;a title=&quot;Installing Ruby 1.9.2 on Ubuntu 11.10 Oneiric Ocelot without using RVM&quot; href=&quot;http://lenni.info/blog/2011/12/installing-ruby-1-9-2-on-ubuntu-11-10-oneric-ocelot-without-using-rvm/#uninstall&quot;&gt;uninstallation instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I found out today that there also is a package called &lt;a href=&quot;http://packages.ubuntu.com/precise/ruby1.9.3&quot;&gt;ruby1.9.3&lt;/a&gt; however that is just a proxy package that doesn&amp;#39;t have any files itself and only depends on ruby1.9.1. Aptitude confirms this:
&lt;blockquote&gt;Ruby uses two parallel versioning schemes: the `Ruby library compatibility version&amp;#39; (1.9.1 for this package), which is similar to a library SONAME, and the &amp;#39;Ruby version&amp;#39; (1.9.3 for this package). Ruby packages in Debian are named using the Ruby library compatibility version, which is sometimes confusing for users who do not follow Ruby development closely. This package depends on the ruby1.9.1 package, and provides compatibility symbolic links from 1.9.3 executables and manual pages to their 1.9.1 counterparts.&lt;/blockquote&gt;
There doesn&amp;#39;t seem to be a rubygems1.9.3.&lt;/p&gt;
</description>
        <pubDate>Wed, 02 May 2012 00:00:00 +0200</pubDate>
        <link>http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin</link>
        <guid isPermaLink="true">http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin</guid>
      </item>
    
  </channel>
</rss>
