<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>http://wikimatze.de/</id>
  <link rel="self" type="application/atom+xml" href="http://wikimatze.de/atom.xml"/>
  <link rel="alternate" type="text/html" href="http://www.feedio.co/@wikimatze"/>
  <link rel="alternate" type="application/atom+xml" href="http://www.feedio.co/@wikimatze/feed"/>
  <title>Matthias Günther</title>
  <subtitle>Writings, and talks by Matthias Günther. Günther works as a developer and agile coach at MyHammer, loves painting Warhammer figures, writing, giving talks, and enjoys making cakes.</subtitle>
  <updated>2017-03-04T09:10:50+00:00</updated>
  <author>
    <name>Matthias Günther</name>
    <uri>http://wikimatze.de</uri>
    <email>matthias@wikimatze.de</email>
  </author>
  <icon>https://farm3.staticflickr.com/2896/14517064206_8bcd41fb1e_q_d.jpg</icon>
  <logo>https://farm3.staticflickr.com/2896/14517064206_8bcd41fb1e_m_d.jpg</logo>
  <rights>Copyright Matthias Günther</rights>
    <entry>
      <title>Talk about Weechat another IRC client</title>
      <id>http://wikimatze.de/talk-about-weechat-another-irc-client</id>
      <link href="http://wikimatze.de/talk-about-weechat-another-irc-client"/>
      <published>2016-06-09T00:00:00+00:00</published>
      <updated>2016-06-09T00:00:00+00:00</updated>
      <category term="tool"/>
      <content type="html">&lt;p&gt;Follow me through my travel exploring the way to get Vim and Git running in a friendly coexistence.&lt;/p&gt;

&lt;p&gt;Here are the slides of the talk:&lt;/p&gt;

&lt;script async class=&quot;speakerdeck-embed&quot; data-id=&quot;da19b520fde4424c9a24a5f049a69f82&quot; data-ratio=&quot;1.33159947984395&quot; src=&quot;//speakerdeck.com/assets/embed.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;and the videos of the talk:&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://player.vimeo.com/video/167374965&quot; width=&quot;640&quot; height=&quot;360&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt; &lt;p&gt;&lt;a href=&quot;https://vimeo.com/167374965&quot;&gt;Weechat - another IRC client (Part 1)&lt;/a&gt; from &lt;a href=&quot;https://vimeo.com/wikimatze&quot;&gt;wikimatze&lt;/a&gt; on &lt;a href=&quot;https://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://player.vimeo.com/video/168291013&quot; width=&quot;640&quot; height=&quot;360&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt; &lt;p&gt;&lt;a href=&quot;https://vimeo.com/168291013&quot;&gt;Weechat - another IRC client (Part 2)&lt;/a&gt; from &lt;a href=&quot;https://vimeo.com/wikimatze&quot;&gt;wikimatze&lt;/a&gt; on &lt;a href=&quot;https://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;You can find the source under &lt;a href=&quot;https://bitbucket.org/wikimatze/presentations/branch/weechat-another-irc-client&quot; title=&quot;bitbucket&quot;&gt;bitbucket&lt;/a&gt;.
I gave this talk at &lt;a href=&quot;http://vimberlin.de/may-2016-meetup&quot; title=&quot;Vimberlin May 2016 Meetup&quot;&gt;Vimberlin May 2016 Meetup&lt;/a&gt;.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Ranger a terminal browser for Vim</title>
      <id>http://wikimatze.de/ranger-a-terminal-browser-for-vim</id>
      <link href="http://wikimatze.de/ranger-a-terminal-browser-for-vim"/>
      <published>2016-05-30T00:00:00+00:00</published>
      <updated>2016-05-30T00:00:00+00:00</updated>
      <category term="tool"/>
      <content type="html">&lt;p&gt;&lt;a href=&quot;http://ranger.nongnu.org/&quot; title=&quot;Ranger&quot;&gt;Ranger&lt;/a&gt; is a file manager with VI key bindings. It provides a minimalistic and nice curses
interface with a view on the directory hierarchy. I stumbled upon this tool during a
&lt;a href=&quot;http://vimberlin.de/&quot; title=&quot;vimberlin meetup&quot;&gt;vimberlin meetup&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;p&gt;Per package:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install ranger
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or per source:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git clone git://git.savannah.nongnu.org/ranger.git /tmp/ranger &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp/ranger &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git checkout v1.7.2 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo make install &lt;span class=&quot;sb&quot;&gt;```&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;## First start&lt;/span&gt;

&lt;span class=&quot;sb&quot;&gt;```&lt;/span&gt;sh
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ranger
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;TBD: Image&lt;/p&gt;

&lt;p&gt;What you see are &lt;code&gt;Miller columns&lt;/code&gt;, where the middle pane is the current directory, the left pane is the parent
directory, and the right pane displays a preview for the file your are currently browser in the middle column. All in
all it looks like &lt;a href=&quot;https://en.wikipedia.org/wiki/Finder_(software)&quot; title=&quot;Finder&quot;&gt;Finder&lt;/a&gt; tool for Mac.&lt;/p&gt;

&lt;p&gt;Text files are displayed with the &lt;a href=&quot;https://en.wikipedia.org/wiki/Less_(Unix)&quot; title=&quot;less program&quot;&gt;less program&lt;/a&gt;. PDFs are
converted to text for displaying preview and images are shown either with ASCII images or your default image viewer.&lt;/p&gt;

&lt;p&gt;And get out of it via &lt;code&gt;q&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Navigation shortcuts&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;gg&lt;/code&gt; ... Go to the top of the list&lt;/li&gt;
&lt;li&gt;&lt;code&gt;G&lt;/code&gt; ... Go to the bottom of the list&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-f&amp;gt;&lt;/code&gt; ...  Page down&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-b&amp;gt;&lt;/code&gt; ...  Page up&lt;/li&gt;
&lt;li&gt;&lt;code&gt;J&lt;/code&gt; ... Page down 1/2 page&lt;/li&gt;
&lt;li&gt;&lt;code&gt;K&lt;/code&gt; ... Page up 1/2 page&lt;/li&gt;
&lt;li&gt;&lt;code&gt;H&lt;/code&gt; ... Go back through navigation history&lt;/li&gt;
&lt;li&gt;&lt;code&gt;L&lt;/code&gt; ... Go forward through navigation history&lt;/li&gt;
&lt;li&gt;&lt;code&gt;o&lt;/code&gt; ... will open order context and after which filter you want to see the files&lt;/li&gt;
&lt;li&gt;&lt;code&gt;zh&lt;/code&gt; ... toggle show hidden files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Working with Files:&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;i&lt;/code&gt; ... display the file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;E|I&lt;/code&gt; ... edit the file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;r&lt;/code&gt; ... open file with the chosen program&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cw&lt;/code&gt; ... rename file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt; ... search for files (&lt;code&gt;n|p&lt;/code&gt; jump to next/previous match)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dd&lt;/code&gt; .. mark file for cut&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ud&lt;/code&gt; ... uncut&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p&lt;/code&gt; ... paste file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;yy&lt;/code&gt; .. copy/yank file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;zh&lt;/code&gt; ... show hidden files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;General shortcuts&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;R&lt;/code&gt; ... reload current directory&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-n&amp;gt;&lt;/code&gt; ... creates an new tab&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;C-w&amp;gt;&lt;/code&gt; ... close the current tab&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;Tab&amp;gt;&lt;/code&gt; ... jump to the next tab&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;Shift-Tab&amp;gt;&lt;/code&gt; ... jump to the previous tab&lt;/li&gt;
&lt;li&gt;&lt;code&gt;q&lt;/code&gt; ... will quit ranger&lt;/li&gt;
&lt;li&gt;&lt;code&gt;?&lt;/code&gt; ... open the man, keybindings, commands, or settings&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Command interface&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:delete&lt;/code&gt; ... delete the selected file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:mkdir&lt;/code&gt; ... create a directory&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:touch&lt;/code&gt; ... create a file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:rename&lt;/code&gt; ... rename file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:help&lt;/code&gt; ... show help (and then pressing &lt;code&gt;k&lt;/code&gt; will print the shortcuts)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Customizing ranger&lt;/h2&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ranger --copy-config&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will create the &lt;code&gt;rifle.conf&lt;/code&gt;, &lt;code&gt;commands.py&lt;/code&gt;, &lt;code&gt;commands_full.py&lt;/code&gt;, &lt;code&gt;rc.conf&lt;/code&gt;, and &lt;code&gt;scope.sh&lt;/code&gt;
files in your &lt;code&gt;~/.config/ranger&lt;/code&gt; folder. &lt;code&gt;rifle.conf&lt;/code&gt; is rangers file executor/opener.&lt;/p&gt;

&lt;p&gt;E.g.:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;#--------------------------------------------&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Audio without X&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#-------------------------------------------&lt;/span&gt;
mime ^audio|ogg&lt;span class=&quot;nv&quot;&gt;$,&lt;/span&gt; terminal, has mplayer  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; mplayer -- &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
mime ^audio|ogg&lt;span class=&quot;nv&quot;&gt;$,&lt;/span&gt; terminal, has mplayer2 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; mplayer2 -- &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
mime ^audio|ogg&lt;span class=&quot;nv&quot;&gt;$,&lt;/span&gt; terminal, has mpv      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; mpv -- &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
ext midi?,        terminal, has wildmidi &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; wildmidi -- &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;commands_full.py&lt;/code&gt; defines commands for your &lt;code&gt;rc.conf&lt;/code&gt; as well as terminal commands - if you want to create your own
commands put them into &lt;code&gt;commans.py&lt;/code&gt;. The &lt;code&gt;scope.sh&lt;/code&gt; handles previews for ranger so that you can see the results of file
in ranger instead of opening an external command.&lt;/p&gt;

&lt;h3&gt;rc.conf&lt;/h3&gt;

&lt;p&gt;Contains basic configuration like displaying hidden files and shortcuts&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Jumping around&lt;/span&gt;
map J     history_go -2
map K     history_go 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;My file is pretty empty because I want only that.&lt;/p&gt;

&lt;h2&gt;Vim command to start the browser mode&lt;/h2&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;RangerExplorer&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;silent !ranger --choosefile=/tmp/vim_ranger_current_file &quot;&lt;/span&gt; . system&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;echo &quot;&#39;&lt;/span&gt; . expand&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;%:p:h&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; . &lt;span class=&quot;s1&quot;&gt;&#39;&quot; | sed -E &quot;s/\ /\\\ /g&quot;&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;filereadable&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;/tmp/vim_ranger_current_file&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;edit &#39;&lt;/span&gt; . system&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;cat /tmp/vim_ranger_current_file | sed -E &quot;s/\ /\\\ /g&quot;&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      call system&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;rm /tmp/vim_ranger_current_file&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  endif
redraw!
endfun

map &amp;lt;Leader&amp;gt;r :call RangerExplorer&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;&amp;lt;CR&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There are a bunch of plugins out there, which all uses Ranger in different ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Mizuchi/vim-ranger&quot; title=&quot;vim-ranger will open files in tabs instead of buffers&quot;&gt;vim-ranger will open files in tabs instead of buffers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rafaqz/ranger.vim&quot; title=&quot;ranger.vim several commands for splitting selected files&quot;&gt;ranger.vim several commands for splitting selected files&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I prefer &lt;a href=&quot;https://github.com/francoiscabrol/ranger.vim&quot; title=&quot;ranger.vim&quot;&gt;ranger.vim&lt;/a&gt; because it quickly opens a file browser
and open the selected files in a new buffer.&lt;/p&gt;

&lt;h2&gt;VCS awareness&lt;/h2&gt;

&lt;p&gt;Edit &lt;code&gt;rc.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Be aware of version control systems and display information.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;vcs_aware &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# State of the three backends git, hg, bzr. The possible states are&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# disabled, local (only show local info), enabled (show local and remote&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# information).&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;vcs_backend_git enabled
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;vcs_backend_hg disabled
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;vcs_backend_bzr disabled
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;https://github.com/hut/ranger/wiki/VCS-integration&lt;/p&gt;

&lt;p&gt;But then loading a big repo may slow down opening ranger.&lt;/p&gt;

&lt;h2&gt;Links&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.everythingcli.org/use-ranger-as-a-file-explorer-in-vim/&quot; title=&quot;Using Vim as a file explorer&quot;&gt;Using Vim as a file explorer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://illidiumq36.wordpress.com/2012/03/17/ranger-the-best-file-manager-for-mac-if-you-like-vim/&quot; title=&quot;vim-ranger on mac&quot;&gt;vim-ranger on mac&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/hut/ranger/blob/master/examples/vim_file_chooser.vim&quot; title=&quot;Icewind Dale - The Ultimate Collection&quot;&gt;official way to use ranger as vim-file choose&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/vifm/vifm&quot; title=&quot;Vifm - an ncurses based file manager with vi like key bindings, which also borrows some useful ideas from mutt&quot;&gt;Vifm - an ncurses based file manager with vi like key bindings, which also borrows some useful ideas from mutt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.vifm.info/index.php?title=Ideology#Vifm_or_ranger&quot; title=&quot;Differences between vifm and ranger&quot;&gt;Differences between vifm and ranger&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Vimtex the perfect tool for working with tex and Vim and Zathura</title>
      <id>http://wikimatze.de/vimtex-the-perfect-tool-for-working-with-tex-and-vim</id>
      <link href="http://wikimatze.de/vimtex-the-perfect-tool-for-working-with-tex-and-vim"/>
      <published>2016-05-15T00:00:00+00:00</published>
      <updated>2016-05-15T00:00:00+00:00</updated>
      <category term="tools"/>
      <content type="html">&lt;p&gt;In the past I have used first &lt;a href=&quot;https://github.com/jcf/vim-latex&quot; title=&quot;vim-latex&quot;&gt;vim-latex&lt;/a&gt; for compiling my LaTeX projects.
And later on I discoverd &lt;a href=&quot;http://vim-latex.sourceforge.net/&quot; title=&quot;vim-latexsuite&quot;&gt;vim-latexsuite&lt;/a&gt;, wich amazed me because of
&lt;a href=&quot;http://vim-latex.sourceforge.net/documentation/latex-suite/forward-searching.html&quot; title=&quot;forward searching&quot;&gt;forward searching&lt;/a&gt;
and &lt;a href=&quot;http://vim.wikia.com/wiki/Backward_search_for_LaTeX_documents&quot; title=&quot;backward searching&quot;&gt;backward searching&lt;/a&gt; which were
totally new to me. Then the config stopped working for me when I updated vim.&lt;/p&gt;

&lt;p&gt;Searching the famous LaTeX plugins for vim, I&amp;#39;ve discovered &lt;a href=&quot;https://github.com/lervag/vimtex&quot; title=&quot;vimtex&quot;&gt;vimtex&lt;/a&gt; by
&lt;a href=&quot;https://github.com/lervag&quot; title=&quot;Karl Yngve Lervåg&quot;&gt;Karl Yngve Lervåg&lt;/a&gt;. At first I was happy that it easily compiled my
latex documents with &lt;code&gt;\ll&lt;/code&gt; as well as opening the generated pdf with &lt;code&gt;\lv&lt;/code&gt;. I wanted more, I wanted my forward and
backward searching back.&lt;/p&gt;

&lt;p&gt;(Works with &lt;a href=&quot;http://users.phys.psu.edu/%7Ecollins/software/latexmk-jcc/&quot; title=&quot;latexmk 4.45&quot;&gt;latexmk 4.45&lt;/a&gt;,
&lt;a href=&quot;https://pwmt.org/projects/zathura/download/&quot; title=&quot;zathura 0.3.6&quot;&gt;zathura 0.3.6 - requires zathura compiled with linsynctex, otherwise take another version but the forward/backward searching may not work&lt;/a&gt;, &lt;a href=&quot;https://github.com/lervag/vimtex&quot; title=&quot;vimtex&quot;&gt;vimtex&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;Benefits of using this plugin&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;you can chose between different PDF viewer (&lt;a href=&quot;http://mupdf.com/&quot; title=&quot;MuPDF&quot;&gt;MuPDF&lt;/a&gt;, &lt;a href=&quot;https://pwmt.org/projects/zathura/&quot; title=&quot;Zathura&quot;&gt;Zathura&lt;/a&gt;,
&lt;a href=&quot;https://okular.kde.org/&quot; title=&quot;Okular&quot;&gt;Okular&lt;/a&gt;, &lt;a href=&quot;https://launchpad.net/qpdfview&quot; title=&quot;qpdfview&quot;&gt;qpdfview&lt;/a&gt; or &lt;a href=&quot;http://www.sumatrapdfreader.org/free-pdf-reader.html&quot; title=&quot;SumatraPDF&quot;&gt;SumatraPDF&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;continuous compilation if a file has changed&lt;/li&gt;
&lt;li&gt;text-objects:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ae&lt;/code&gt; ... LaTeX environments (e.g. \begin{itemize})&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ac&lt;/code&gt; ... commands&lt;/li&gt;
&lt;li&gt;&lt;code&gt;i$&lt;/code&gt; ... inline math structure&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a$&lt;/code&gt; ... whole math structure&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;motions and mappings:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[[|]]&lt;/code&gt; ... move to next/previous section&lt;/li&gt;
&lt;li&gt;&lt;code&gt;%&lt;/code&gt; ... move between matching delimeters&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dse|cse&lt;/code&gt; ... delete/change the surrounding environment&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dsc|csc&lt;/code&gt; ... delete/change the surrounding command&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;rename environments&lt;/li&gt;
&lt;li&gt;omni completion, improved syntax highlighting and indentation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;latexmk installation and configuration&lt;/h2&gt;

&lt;p&gt;Think of &lt;a href=&quot;http://www.bibtex.org/Using/&quot; title=&quot;bibtex&quot;&gt;bibtex&lt;/a&gt; or your &lt;a href=&quot;&quot; title=&quot;toc&quot;&gt;toc&lt;/a&gt; - everytime you have to run pdflatex several times
to update the entries. Vimtex uses &lt;a href=&quot;http://users.phys.psu.edu/%7Ecollins/software/latexmk-jcc/&quot;&gt;latexmk&lt;/a&gt;
to compile the LaTeX document.
&lt;a href=&quot;http://users.phys.psu.edu/%7Ecollins/software/latexmk-jcc/&quot; title=&quot;latexmk&quot;&gt;latexmk&lt;/a&gt; is a perl script that runs the desired/necessary LaTeX command the correct number of times to resolve cross references.&lt;/p&gt;

&lt;p&gt;The version of &lt;code&gt;latexmk&lt;/code&gt; in the Ubuntu repositories is old (2012). I therefore
suggest to remove it with &lt;code&gt;sudo apt-get remove latexmk&lt;/code&gt; and then instead
grab the &lt;a href=&quot;http://users.phys.psu.edu/%7Ecollins/software/latexmk-jcc/versions.html&quot; title=&quot;latest version&quot;&gt;latest version&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;wget http://users.phys.psu.edu/%7Ecollins/software/latexmk-jcc/latexmk-445.zip
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;unzip latexmk&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.zip
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo cp latexmk/latexmk.pl /usr/local/bin
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo mv /usr/local/bin/latexmk.pl /usr/local/bin/latexmk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Normally, you don&amp;#39;t have to create a custom &lt;code&gt;latexmkrc&lt;/code&gt; because Vimtex does all the magic for your
like adding the &lt;code&gt;synctex&lt;/code&gt; option or specifying the output with &lt;code&gt;-pdf&lt;/code&gt; - all of this is automatically done
by the plugin.&lt;/p&gt;

&lt;p&gt;But if you want to run &lt;code&gt;latexmk&lt;/code&gt; manually, you can create your own &lt;code&gt;~/.latexmkrc&lt;/code&gt;. I have the
following content:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;# how pdflatex will be executed&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$pdflatex&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex --shell-escape %O %S&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A typical &lt;code&gt;latexmk&lt;/code&gt; run looks like the following:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;latexmk
Latexmk: This is Latexmk, John Collins, 22 April 2016, version: 4.45.
Latexmk: All targets &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;kanban.pdf&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; are up-to-date
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;vim kanban.tex &lt;span class=&quot;c&quot;&gt;# make some changes&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;latexmk
Latexmk: This is Latexmk, John Collins, 22 April 2016, version: 4.45.
Latexmk: applying rule &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex&#39;&lt;/span&gt;...
Rule &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex&#39;&lt;/span&gt;: File changes, etc:
   Changed files, or newly &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;use since previous run&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:
      &lt;span class=&quot;s1&quot;&gt;&#39;kanban.tex&#39;&lt;/span&gt;
------------
Run number 1 of rule &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex&#39;&lt;/span&gt;
------------
------------
Running &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex --shell-escape -synctex=1  -recorder  &quot;kanban.tex&quot;&#39;&lt;/span&gt;
------------
This is pdfTeX, Version 3.1415926-2.5-1.40.14 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;TeX Live 2013/Debian&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
 &lt;span class=&quot;se&quot;&gt;\w&lt;/span&gt;rite18 enabled.
entering extended mode
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;./kanban.tex
LaTeX2e &amp;lt;2011/06/27&amp;gt;
Babel &amp;lt;3.9h&amp;gt; and hyphenation patterns &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;7 languages loaded.
...
Output written on kanban.pdf &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;16 pages, 141131 bytes&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;.
SyncTeX written on kanban.synctex.gz.
Transcript written on kanban.log.
Latexmk: References changed.
Latexmk: Log file says output to &lt;span class=&quot;s1&quot;&gt;&#39;kanban.pdf&#39;&lt;/span&gt;
Latexmk: applying rule &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex&#39;&lt;/span&gt;...
Rule &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex&#39;&lt;/span&gt;: File changes, etc:
   Changed files, or newly &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;use since previous run&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:
      &lt;span class=&quot;s1&quot;&gt;&#39;kanban.aux&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;kanban.out&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;kanban.toc&#39;&lt;/span&gt;
------------
Run number 2 of rule &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex&#39;&lt;/span&gt;
------------
Running &lt;span class=&quot;s1&quot;&gt;&#39;pdflatex --shell-escape -synctex=1  -recorder  &quot;kanban.tex&quot;&#39;&lt;/span&gt;
------------
This is pdfTeX, Version 3.1415926-2.5-1.40.14 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;TeX Live 2013/Debian&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
 &lt;span class=&quot;se&quot;&gt;\w&lt;/span&gt;rite18 enabled.
entering extended mode
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;./kanban.tex
LaTeX2e &amp;lt;2011/06/27&amp;gt;
Babel &amp;lt;3.9h&amp;gt; and hyphenation patterns &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;7 languages loaded.
...
Output written on kanban.pdf &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;16 pages, 141117 bytes&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;.
SyncTeX written on kanban.synctex.gz.
Transcript written on kanban.log.
Latexmk: Log file says output to &lt;span class=&quot;s1&quot;&gt;&#39;kanban.pdf&#39;&lt;/span&gt;
Latexmk: All targets &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;kanban.pdf&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; are up-to-date
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;synctex&lt;/code&gt; option is needed for forward/backward search.&lt;/p&gt;

&lt;h2&gt;Ensure that libsynctex is on your system&lt;/h2&gt;

&lt;p&gt;One must also ensure that &lt;code&gt;libsynctex&lt;/code&gt; exists in the system! The normal way to do it, is to:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get update
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install libsynctex-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Since I&amp;#39;m still running Ubuntu 14.04 I needed to install the packages on my own:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;http://packages.ubuntu.com/xenial/libsynctex1&lt;/li&gt;
&lt;li&gt;http://packages.ubuntu.com/xenial/libsynctex-dev&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;linsynctex1 is needed for libsynctex-dev.&lt;/p&gt;

&lt;p&gt;The following script will help you installing it (either on amd64 or ):&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm -rf libsynctex&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;uname -m&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;x86_64&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;then
  &lt;/span&gt;wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex1_2015.20160222.37495-1_amd64.deb
  wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex-dev_2015.20160222.37495-1_amd64.deb
&lt;span class=&quot;k&quot;&gt;else
  &lt;/span&gt;wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex1_2015.20160222.37495-1_i386.deb
  wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex-dev_2015.20160222.37495-1_i386.deb
&lt;span class=&quot;k&quot;&gt;fi

&lt;/span&gt;sudo dpkg -i libsynctex1&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo dpkg -i libsynctex-dev&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;girara and zathura installation&lt;/h2&gt;

&lt;p&gt;I&amp;#39;ve decided to use &lt;a href=&quot;http://jhshi.me/2016/03/09/zathura-pdf-viewer-for-vim-lovers/index.html&quot; title=&quot;zathura&quot;&gt;zathura&lt;/a&gt;
as my default pdfviewer because of it&amp;#39;s vim bindings.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;GIRARA_VERSION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0.2.6
&lt;span class=&quot;nv&quot;&gt;ZATHURA_VERSION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0.3.6

&lt;span class=&quot;c&quot;&gt;# otherwise the own girara compilation will not work&lt;/span&gt;
sudo apt-get remove libgirara-dev

&lt;span class=&quot;c&quot;&gt;# need for zathura compilation&lt;/span&gt;
sudo apt-get install libmagic-dev

rm -rf /tmp/girara /tmp/zathura

&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git clone https://git.pwmt.org/pwmt/girara.git &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;girara &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git checkout &lt;span class=&quot;nv&quot;&gt;$GIRARA_VERSION&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; make &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo make install
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git clone https://git.pwmt.org/pwmt/zathura.git &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;zathura &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git checkout &lt;span class=&quot;nv&quot;&gt;$ZATHURA_VERSION&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; make &lt;span class=&quot;nv&quot;&gt;WITH_SYNCTEX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Look during the compilation on the following line:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;...
zathura build options:
CFLAGS  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; -std&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;c11 -pedantic -Wall -Wno-format-zero-length -Wextra -pthread -I/usr/include/gtk-3.0
-I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/
-I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include
-I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12   -pthread
-I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman-1
-I/usr/include/libpng12   -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include   -pthread
-I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include   -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include      -I/usr/include/synctex
LIBS    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; -lgirara-gtk3   -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject
-lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0   -pthread -lgthread-2.0 -lglib-2.0   -pthread -lgmodule-2.0 -lglib-2.0
-lglib-2.0   -lpthread -lm -lsqlite3   -lmagic -lsynctex
DFLAGS  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; -g
CC      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; cc
make[1]: Entering directory &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;/tmp/zathura/po&lt;span class=&quot;s1&quot;&gt;&#39;
make[1]: Nothing to be done for `all&#39;&lt;/span&gt;.
make[1]: Leaving directory &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;/tmp/zathura/po&lt;span class=&quot;s1&quot;&gt;&#39;
make[1]: Entering directory `/tmp/zathura/doc&#39;&lt;/span&gt;
make[1]: Nothing to be &lt;span class=&quot;k&quot;&gt;done for&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;man&lt;span class=&quot;s1&quot;&gt;&#39;.
make[1]: Leaving directory `/tmp/zathura/doc&#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;INSTALL] header files
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;INSTALL] pkgconfig file
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;INSTALL] man pages
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;INSTALL] D-Bus interface definitions
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;INSTALL] AppData file
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;INSTALL] executeable file
 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;INSTALL] desktop file
 make -C po install
 make[1]: Entering directory &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;/tmp/zathura/po&lt;span class=&quot;s1&quot;&gt;&#39;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And look if you can find &lt;code&gt;-I/usr/include/synctex&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;make WITH_SYNCTEX=1&lt;/code&gt; is the most important thing if you want to have forward/backward integration (&lt;a href=&quot;https://github.com/lervag/vimtex/issues/454&quot; title=&quot;see my issue report GitHub&quot;&gt;see my issue report GitHub&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Please note that girara is needed for the zathura version 0.3.6.&lt;/p&gt;

&lt;h2&gt;vimtex basics&lt;/h2&gt;

&lt;p&gt;Install the plugin in the way you like (either manually or with some plugin manager).  Next, just open your your tex file and press
&lt;code&gt;\ll|:VimtexCompileToggle&lt;/code&gt;.  You will see in your statusline a message like &lt;code&gt;latexmk compile: started continuous mode&lt;/code&gt; and it will open the pdf
in your prefered pdf-viewer. If you don&amp;#39;t configure anything, it will take the default system pdf viewer. In my case, I
want zathura, so I need the following config:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;let &lt;/span&gt;g:vimtex_view_method &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;zathura&#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you just want to see the plain generated pdf, it&amp;#39;s nearly everything you need.&lt;/p&gt;

&lt;h2&gt;vimtex forward and backward search for zathura&lt;/h2&gt;

&lt;p&gt;To get forward/backward searching running, you need to open the file with &lt;a href=&quot;http://vim.wikia.com/wiki/Enable_servername_capability_in_vim/xterm&quot;&gt;vim&amp;#39;s servername feature&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;vim --servername vim test.tex
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If one uses &lt;code&gt;gvim&lt;/code&gt; or similar, then the client-server is automatically enabled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forward search&lt;/strong&gt; is easy: Just place the cursor in your tex-file and press &lt;code&gt;\lv&lt;/code&gt; you will then get the compiled PDF jump
to this point with a green line:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm8.staticflickr.com/7575/26756231470_64ed735892_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Vimtex forward search&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Vimtex forward search&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Backward search&lt;/strong&gt; can be easily triggered if you just press &lt;code&gt;&amp;lt;C-Enter&amp;gt;&lt;/code&gt; on the PDF and you jump right to the place in
the terminal.&lt;/p&gt;

&lt;p&gt;A quote from the author of the plugin:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This should work automatically with zathura, but it is also the only viewer
where this will work automatically. In general, backward search should be
configured on the viewer end. Luckily, vimtex may parse command line arguments
that does this for zathura. Combined with the vi-keys in zathura, this is one
of the main reasons I prefer zathura.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Useful vimtex commands&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:VimtexTocOpen|:VimtexTocToggle&lt;/code&gt;: open a clickable toc in the left pane (&lt;code&gt;q&lt;/code&gt; will close the window)
&lt;img src=&quot;https://farm8.staticflickr.com/7449/27510532801_c1051f0766_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Vimtex view toc&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Vimtex view toc&amp;quot;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;:VimtexInfo&lt;/code&gt;: prints basic information&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;s&quot;&gt;b:vimtex&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;kanban&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;pid&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;root&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/home/wm/ownCloud/latex/projekte/kanban&#39;&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;aux&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/home/wm/ownCloud/latex/projekte/kanban/kanban.aux&#39;&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;log&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/home/wm/ownCloud/latex/projekte/kanban/kanban.log&#39;&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;out&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/home/wm/ownCloud/latex/projekte/kanban/kanban.pdf&#39;&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;tex&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/home/wm/ownCloud/latex/projekte/kanban/kanban.tex&#39;&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;base&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;kanban.tex&#39;&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;viewer&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;xwin_id&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Zathura&#39;&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;182&#39;)&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;183&#39;)&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;184&#39;)&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;forward_search&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;185&#39;)&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;latexmk_callback&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;186&#39;)&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;latexmk_append_argument&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;187&#39;)&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;xwin_exists&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;&amp;lt;SNR&amp;gt;178_xwin_exists&#39;)&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;xwin_get_id&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;function(&#39;&amp;lt;SNR&amp;gt;178_xwin_get_id&#39;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;:VimtexCountWords|:VimtexCountLetters&lt;/code&gt;: count the number of words/letters in the document. It will also show the number of math environments, and similar.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;  &lt;span class=&quot;s&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;kanban.tex&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Encoding&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;utf8&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Sum count&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;3265&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Words in text&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;3156&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Words in headers&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;66&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Words outside text (captions, etc.)&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;7&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Number of headers&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;24&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Number of floats/tables/figures&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Number of math inlines&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;36&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;Number of math displayed&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;0&lt;/span&gt;

  &lt;span class=&quot;s&quot;&gt;(errors:8)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:VimtexLabelsOpen|:VimtexLabelsToggle&lt;/code&gt;: open table of labels.
&lt;img src=&quot;https://farm8.staticflickr.com/7167/26976864533_1185526752_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Vimtex view labels toc&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Vimtex view labels toc&amp;quot;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:VimtexCompileOutput&lt;/code&gt;: show the output form the compilation command (i.e. from &lt;code&gt;latexmk&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:VimtexErrors&lt;/code&gt;:  open quickfix window if there are errors or warnings.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:VimtexClean&lt;/code&gt;: clean auxilliary files like &lt;code&gt;*.aux&lt;/code&gt;, &lt;code&gt;*.out&lt;/code&gt;, and so on files. Use &lt;code&gt;:VimtexClean!&lt;/code&gt; to remove everything, including the generated pfd file.&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Migration RSS from FeedBurner to Feedio</title>
      <id>http://wikimatze.de/migration-rss-from-feedburner-to-feedio</id>
      <link href="http://wikimatze.de/migration-rss-from-feedburner-to-feedio"/>
      <published>2016-04-21T00:00:00+00:00</published>
      <updated>2016-04-21T00:00:00+00:00</updated>
      <category term="rss"/>
      <content type="html">&lt;p&gt;I was wondering: &lt;a href=&quot;https://en.wikipedia.org/wiki/FeedBurner&quot; title=&quot;FeedBurner&quot;&gt;FeedBurner&lt;/a&gt; was acquired around 2011 by Google.
Google &lt;a href=&quot;https://developers.google.com/feedburner/&quot; title=&quot;announced&quot;&gt;announced&lt;/a&gt; that the feedburner API is going to be no
longer available.&lt;/p&gt;

&lt;p&gt;My intent to use this tool was to track how many people sign up and how many people subscribed to it. It surprised my,
that &lt;a href=&quot;http://feeds.feedburner.com/guenther&quot; title=&quot;feed for my blog wikimatze&quot;&gt;feed for my blog wikimatze&lt;/a&gt; was still working.
Time to look for alternatives and see how technology has changed.&lt;/p&gt;

&lt;h2&gt;RSS in the wild&lt;/h2&gt;

&lt;p&gt;Pages like &lt;a href=&quot;http://blog.crazyegg.com/2012/10/12/alternatives-to-feedburner/&quot; title=&quot;blog.crazyegg.com&quot;&gt;blog.crazyegg.com&lt;/a&gt;
mentioned 13 alternatives - but for most of them you have to pay money.&lt;/p&gt;

&lt;p&gt;There are &lt;a href=&quot;https://premium.wpmudev.org/blog/5-best-feedburner-alternatives-for-your-wordpress-blog/&quot; title=&quot;many wordpress plugins out there&quot;&gt;many wordpress plugins out there&lt;/a&gt; but since I&amp;#39;m using &lt;a href=&quot;http://jekyllrb.com/&quot; title=&quot;jekyll&quot;&gt;jekyll&lt;/a&gt; to build my site as a static HTML page, that is not even an alternative.&lt;/p&gt;

&lt;p&gt;The site &lt;a href=&quot;http://www.feedburner-alternatives.com/&quot; title=&quot;feedburner-alternatives.com&quot;&gt;feedburner-alternatives.com&lt;/a&gt; mentions tools like
&lt;a href=&quot;http://www.feedblitz.com/&quot; title=&quot;feedblitz&quot;&gt;feedblitz&lt;/a&gt; and &lt;a href=&quot;http://www.feedburner-alternatives.com/img/Picture1.png&quot; title=&quot;specificfeeds.com&quot;&gt;specificfeeds.com&lt;/a&gt;. I tried feedblitz and created an &lt;a href=&quot;https://www.specificfeeds.com/wikimatze&quot; title=&quot;RSS-feed of wikimatze.de&quot;&gt;RSS-feed of wikimatze.de&lt;/a&gt; but wasn&amp;#39;t satisfied with the statistics and handling.&lt;/p&gt;

&lt;p&gt;Than I stumbled across &lt;a href=&quot;http://dannybrown.me&quot; title=&quot;Danny Browns&amp;#39;&quot;&gt;Danny Browns&amp;#39;&lt;/a&gt; post about
&lt;a href=&quot;http://dannybrown.me/2015/03/12/does-your-blog-really-need-to-provide-an-rss-feed-anymore/&quot; title=&quot;if you blog really needs RSS&quot;&gt;if you blog really needs RSS&lt;/a&gt;. The author may be right that E-Mail subscribers are more open to change and that you can inform then more easier with new information (like changing the URL of your RSS feed).&lt;/p&gt;

&lt;p&gt;I still like using RSS feed and using &lt;a href=&quot;https://tt-rss.org/gitlab/fox/tt-rss/wikis/home&quot; title=&quot;Tiny Tiny RSS&quot;&gt;Tiny Tiny RSS&lt;/a&gt;
to manage my feeds - there is even an app from which I can read new on the road. But I have also gathered positive
experience with building up a &lt;a href=&quot;http://padrinobook.com/&quot; title=&quot;Mailing List for my PadrinoBook&quot;&gt;mailing List for my PadrinoBook&lt;/a&gt; with &lt;a href=&quot;http://mailchimp.com/&quot; title=&quot;mailchimp.com&quot;&gt;mailchimp.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Why not taking both? This is what Danny Brown talks about in his post &lt;a href=&quot;Changed%20My%20Mind%20About%20RSS&quot; title=&quot;Danny Browns post how he changed his mind about RSS&quot;&gt;how he changed his mind about RSS&lt;/a&gt;. He mentioned a tool called &lt;a href=&quot;http://www.feedio.co&quot; title=&quot;feedio.co&quot;&gt;feedio.co&lt;/a&gt; which should take care of this issues. I will show you some features of the tool in the last section of this article with some images.&lt;/p&gt;

&lt;h2&gt;Get your feedburner users&lt;/h2&gt;

&lt;p&gt;I made the error to link my &lt;a href=&quot;http://feeds.feedburner.com/guenther&quot; title=&quot;RSS feed direct to feedburner&quot;&gt;RSS feed direct to feedburner&lt;/a&gt;. That means, that first all the traffic goes to the external service and second when I change the URL, my readers will not be informed about this.&lt;/p&gt;

&lt;p&gt;First of all login to your feedburner account and follow the tab with &lt;code&gt;Analyze&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1573/24503236302_fe7c30ee44_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Get an overview of your feedburner RSS feed&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Get an overview of your feedburner RSS feed&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Next step would be to get an E-Mail to all of your subscribers you need to click on &lt;code&gt;FeedBurner Email Subscriptions&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1645/23983433284_5168160522_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Manager your feedburner RSS subscribers&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Manager your feedburner RSS subscribers&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;The good part is: I had no subscribers so I don&amp;#39;t need to contact anyone. The bad part: I will probably lose my 19
subscribers of my old feed. Before I go on, I&amp;#39;ll shortly explain the ways you
can use to link your RSS feed.&lt;/p&gt;

&lt;h2&gt;Ways to link your RSS feed&lt;/h2&gt;

&lt;p&gt;You have several possibilities to link your RSS-feed. The classical way is to put a link in the &lt;code&gt;head&lt;/code&gt; and/or link it in
the navigation:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;no-js&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    ...
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/atom.xml&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;alternate&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;application/rss+xml&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;title=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;RSS feed of Matthias Günther&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;dropdown menu large-8 medium-8 columns&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;data-dropdown-menu&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
            ...
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/atom.xml&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fa fa-rss&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            ...
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
    ...
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
  ...
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1682/24593272036_10a605f80e_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Make a RSS link in the head and in the navigation&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Make a RSS link in the head and in the navigation&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Browser like Firefox will then detect, that there is an RSS feed and will make highlight the RSS icon:&lt;/p&gt;

&lt;p&gt;There is even a &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/rss-feed-icon-in-navbar&quot; title=&quot;RSS icon plugin for the address bar&quot;&gt;RSS icon plugin for the address bar&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1530/24251677829_fb80fefc9d_o_d.png&quot; class=&quot;big center&quot; alt=&quot;Firefox plugin to detect RSS feeds in the address bar&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Firefox plugin to detect RSS feeds in the address bar&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;h2&gt;Create a apache redirect for your atom&lt;/h2&gt;

&lt;p&gt;Let&amp;#39;s say, that people should always signup under &lt;a href=&quot;http://yourdomain/atom.xml&quot;&gt;http://yourdomain/atom.xml&lt;/a&gt; and you need to track those things. A
possible way would be to create a &lt;code&gt;htaccess&lt;/code&gt; redirect and point the user to the location you like:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;RewriteEngine On
RewriteCond %&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;HTTP_USER_AGENT&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; !feedio &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;NC]
RewriteRule ^atom.xml/?&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;http://www.feedio.co/@wikimatze/feed &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;302,L]
RewriteEngine Off
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Decide if you want tracking or be lord over your domain. A mix between the two is also possible, let&amp;#39;s say you offer
visible RSS on your site which points to some third-party tool (like feedburner) and keep the &lt;code&gt;&amp;lt;link href=&amp;quot;/atom.xml&amp;quot; ...&lt;/code&gt; on your site.&lt;/p&gt;

&lt;p&gt;But you need to be careful with your redirect: Ask the service you want to use, if a redirect is okay - not that their
crawlers have problems with the loop.&lt;/p&gt;

&lt;h2&gt;Feedio&lt;/h2&gt;

&lt;p&gt;It&amp;#39;s very easy to setup. All you have to do is to sign up with your twitter account. Your picture and bio will be
taken automatically and you have to submit a link of your feed.&lt;/p&gt;

&lt;p&gt;If there are some issues with your feed, one of their founders will help you setup your account. I had some issues
with my feed, as &lt;a href=&quot;https://twitter.com/justin_butlion&quot; title=&quot;Justin Butlion&quot;&gt;Justin Butlion&lt;/a&gt; contacted my directly via mail:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-&quot; data-lang=&quot;&quot;&gt;Hey Matthias,

I was able to find and access your feed at http://wikimatze.de/atom.xml. There doesn&#39;t seem to be a redirect on this
feed which is ideal for us. The issue is that this actual feed has issues which you can see listed here -
http://www.rssboard.org/rss-validator/check.cgi?url=http%3A%2F%2Fwikimatze.de%2Fatom.xml. Only after the feed is valid
will we be able to crawl it.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I checked my RSS feed under &lt;a href=&quot;http://www.rssboard.org/rss-validator&quot; title=&quot;rssboard.org&quot;&gt;rssboard.org&lt;/a&gt; and could see that my
feed was not ready. This was also a good point to watch what formats are possible. You can get a nice overview
&lt;a href=&quot;http://www.atomenabled.org/developers/syndication&quot; title=&quot;atomenabled.org&quot;&gt;atomenabled.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feedio offers a very clean and easy subscription mechanism for your updates: It offers RSS, &lt;a href=&quot;http://feedly.com&quot; title=&quot;feedly&quot;&gt;feedly&lt;/a&gt; or email:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1600/24523636912_f53ed4e82e_b_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Nice sign up interface for email and RSS&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Nice sign up interface for email and RSS&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;The dashboard gives you a high-level overview of your subscribers and how many people you reach with your
entries:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1566/24523637342_e4437bc933_h_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Nice analytics and dashboard&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Nice analytics and dashboard&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;You can use a more detailed view of your articles to and see social share buttons for them:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1451/24523637662_60a450c505_h_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Detail view of your articles and social share buttons&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Detail view of your articles and social share buttons&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Not so many options are editable on the profile page:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1602/24336449850_358b4f330f_b_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Profile page&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;&amp;quot;Profile page&amp;quot;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;If you want become my first RSS subscribe, you can do that &lt;a href=&quot;http://www.feedio.co/@wikimatze&quot; title=&quot;RSS subscribe wikimatze&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feedio is still in development and not everything is working - but they are planning to release new features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;customizable email templates - I&amp;#39;m still using &lt;a href=&quot;http://mailchimp.com/&quot; title=&quot;mailchimp.com&quot;&gt;mailchimp.com&lt;/a&gt; but maybe I&amp;#39;ll
switch&lt;/li&gt;
&lt;li&gt;google analytics integration - I&amp;#39;m not using it but why not&lt;/li&gt;
&lt;li&gt;Advanced reporting&lt;/li&gt;
&lt;li&gt;multiple users&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They have many things on their agenda - let&amp;#39;s see where the voyage will go.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Better zsh with Prezto</title>
      <id>http://wikimatze.de/better-zsh-with-prezto</id>
      <link href="http://wikimatze.de/better-zsh-with-prezto"/>
      <published>2016-01-21T00:00:00+00:00</published>
      <updated>2016-01-21T00:00:00+00:00</updated>
      <category term="prezto"/>
      <content type="html">&lt;p&gt;I haven&amp;#39;t been a user of the &lt;a href=&quot;https://github.com/robbyrussell/oh-my-zsh&quot; title=&quot;oh-my-zsh&quot;&gt;oh-my-zsh&lt;/a&gt; because I found it too
complicated. I was only interested in it&amp;#39;s completion features. Therefore I ripped out this component, copied the completions from it and did the
configuration on my own.&lt;/p&gt;

&lt;p&gt;Then I tried &lt;a href=&quot;https://github.com/sorin-ionescu/prezto&quot; title=&quot;fish-shell&quot;&gt;fish-shell&lt;/a&gt; but wasn&amp;#39;t satisfied.
It lacks completion but has very good autosuggestions and amazing VGA terminal colors for certain types of
commands.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto&quot; title=&quot;prezto&quot;&gt;prezto&lt;/a&gt; jumps in here - it&amp;#39;s an
&lt;a href=&quot;https://github.com/robbyrussell/oh-my-zsh/issues/377&quot;&gt;optimized version of oh-my-zsh&lt;/a&gt;. It is fast,
has completions out of the box, and the nice autosuggestions feature of the fish-shell.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1580/23781327554_29a734ccbd_o_d.png&quot; class=&quot;big center&quot; alt=&quot;Here is what you get in the end&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;Here is what you get in the end&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(This article has been written with &lt;code&gt;zsh 5.0.2 (i686-pc-linux-gnu)&lt;/code&gt;, &lt;code&gt;xfce4-terminal 0.6.3git-f7c72e5&lt;/code&gt;,
&lt;code&gt;tmux 2.2&lt;/code&gt;, and &lt;code&gt;prezto 31 Jul 2015&lt;/code&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;p&gt;Grab the code:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git clone --recursive https://github.com/sorin-ionescu/prezto.git &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ZDOTDIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.zprezto&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Setup the configs:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;setopt EXTENDED_GLOB
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;rcfile &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ZDOTDIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;/.zprezto/runcoms/^README.md&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;.N&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;; &lt;span class=&quot;k&quot;&gt;do
&lt;/span&gt;ln -s &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$rcfile&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ZDOTDIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;rcfile&lt;/span&gt;:t&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you do the steps above, you will get the following files on your system:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;lrwxrwxrwx   1 wm   wm       32 Jan 20 20:41 .zlogin -&amp;gt; /home/wm/.zprezto/runcoms/zlogin
lrwxrwxrwx   1 wm   wm       33 Jan 20 20:41 .zlogout -&amp;gt; /home/wm/.zprezto/runcoms/zlogout
drwxrwxr-x   5 wm   wm     4096 Jan 20 20:43 .zprezto
lrwxrwxrwx   1 wm   wm       35 Jan 20 20:42 .zpreztorc -&amp;gt; /home/wm/.zprezto/runcoms/zpreztorc
lrwxrwxrwx   1 wm   wm       34 Jan 20 20:42 .zprofile -&amp;gt; /home/wm/.zprezto/runcoms/zprofile
lrwxrwxrwx   1 wm   wm       25 Jan 20 20:33 .zsh -&amp;gt; /home/wm/git/dotfiles/zsh
lrwxrwxrwx   1 wm   wm       32 Jan 20 20:42 .zshenv -&amp;gt; /home/wm/.zprezto/runcoms/zshenv
-rwx------   1 wm   wm   192662 Jan 20 20:48 .zsh_history
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I didn&amp;#39;t need all the files, so I just cloned the repository as described above and put the following line at the
beginning of my &lt;code&gt;.zshrc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Source Prezto.&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; -s &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ZDOTDIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.zprezto/init.zsh&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;; &lt;span class=&quot;k&quot;&gt;then
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ZDOTDIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/.zprezto/init.zsh&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Please note that you will be asked if you wish to overwrite your existing files (like &lt;code&gt;.zshrc&lt;/code&gt;) or skip them, if they
already exists.&lt;/p&gt;

&lt;h2&gt;Configure your .zpreztorc&lt;/h2&gt;

&lt;p&gt;This is the heart of prezto - here you enable modules and configure them.&lt;/p&gt;

&lt;p&gt;The README says that &lt;a href=&quot;https://github.com/sorin-ionescu/prezto/blob/master/runcoms/zpreztorc#L25&quot; title=&quot;the modules order matters&quot;&gt;the order of modules matters&lt;/a&gt; - I didn&amp;#39;t follow them at first and was wondering why nothing changed:&lt;/p&gt;

&lt;p&gt;Here is my &lt;code&gt;.zpreztorc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Set the Prezto modules to load (browse modules).&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# The order matters.&lt;/span&gt;
zstyle &lt;span class=&quot;s1&quot;&gt;&#39;:prezto:load&#39;&lt;/span&gt; pmodule &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;directory&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;utility&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;completion&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;git&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;prompt&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;syntax-highlighting&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;history-substring-search&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto/tree/master/modules/directory&quot; title=&quot;directory&quot;&gt;directory&lt;/a&gt;: sets directory options&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto/tree/master/modules/utility&quot; title=&quot;utility&quot;&gt;utility&lt;/a&gt;: defines aliases and functions (highlight matches when pressing &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto/tree/master/modules/completion&quot; title=&quot;completion&quot;&gt;completion&lt;/a&gt;: offers tab-completion
from the &lt;a href=&quot;https://github.com/zsh-users/zsh-completions&quot; title=&quot;zsh-completions project&quot;&gt;zsh-completions project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto/tree/master/modules/git&quot; title=&quot;git&quot;&gt;git&lt;/a&gt;: displays git repository information in the terminal&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto/tree/master/modules/prompt&quot; title=&quot;prompt&quot;&gt;prompt&lt;/a&gt;: defines a theme for your terminal&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting&quot; title=&quot;syntax-highlighting&quot;&gt;syntax-highlighting&lt;/a&gt;: offers fish-like-highlighting statuslinecolorful executables, underlined folders, ...&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/sorin-ionescu/prezto/tree/master/modules/history-substring-search&quot; title=&quot;history-substring-search&quot;&gt;history-substring-search&lt;/a&gt;: type in a word and press up and down to cycle through matching commands&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Prompt color themes&lt;/h2&gt;

&lt;p&gt;Press &lt;code&gt;prompt -l&lt;/code&gt; to get an overview of the available fonts:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;prompt -l
Currently available prompt themes:
agnoster cloud damoekri giddie kylewest minimal nicoulaj paradox peepcode powerline pure skwp smiley sorin
steeef adam1 adam2 bart bigfade clint elite2 elite fade fire off oliver pws redhat suse walters zefram
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And you can change the theme by typing &lt;code&gt;$ prompt &amp;lt;name-of-the-theme&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;Custom prompt color theme&lt;/h2&gt;

&lt;p&gt;I found the &lt;a href=&quot;https://gist.github.com/Veraticus/1b30a6b6cbe8dae57e9f#file-prompt_josh_setup-zsh&quot; title=&quot;josh&quot;&gt;josh prompt&lt;/a&gt; very handy but changed it with parts from &lt;a href=&quot;http://www.mseri.me/again-on-zsh/&quot; title=&quot;mseri&quot;&gt;mseri prompt&lt;/a&gt; to create my own one, where I can see the full path in colors. You can find the theme I&amp;#39;m using as a &lt;a href=&quot;https://gist.github.com/wikimatze/4c2fbaf8ebe1e8ce0c1f#file-prompt_wikimatze_setup&quot; title=&quot;gist prompt\_wikimatze\_setup&quot;&gt;gist prompt_wikimatze_setup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Place this file in &lt;code&gt;~/.zprezto/modules/prompt/functions/prompt_wikimatze_setup&lt;/code&gt; and set the theme in your &lt;code&gt;.zpreztorc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;zstyle &lt;span class=&quot;s1&quot;&gt;&#39;:prezto:module:prompt&#39;&lt;/span&gt; theme &lt;span class=&quot;s1&quot;&gt;&#39;wikimatze&#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Get rid of options-groups&lt;/h2&gt;

&lt;p&gt;When pressing tab to complete a command and you don&amp;#39;t like the category menus, you need to comment out the following
lines in &lt;code&gt;~/.zprezto/modules/completion/init.zsh&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Group matches and describe.&lt;/span&gt;
zstyle &lt;span class=&quot;s1&quot;&gt;&#39;:completion:*:*:*:*:*&#39;&lt;/span&gt; menu &lt;span class=&quot;k&quot;&gt;select&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:matches&#39; group &#39;yes&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:options&#39; description &#39;yes&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:options&#39; auto-description &#39;%d&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:corrections&#39; format &#39; %F{green}-- %d (errors: %e) --%f&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:descriptions&#39; format &#39; %F{yellow}-- %d --%f&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:messages&#39; format &#39; %F{purple} -- %d --%f&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:warnings&#39; format &#39; %F{red}-- no matches found --%f&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*:default&#39; list-prompt &#39;%S%M matches%s&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*&#39; format &#39; %F{yellow}-- %d --%f&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*&#39; group-name &#39;&#39;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# zstyle &#39;:completion:*&#39; verbose yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;All credit for this tipp goes to &lt;a href=&quot;https://twitter.com/jeromedalbert&quot; title=&quot;jeromedalbert&quot;&gt;@jeromedalbert&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://farm2.staticflickr.com/1578/24113994870_9665eba9cf_o_d.png&quot; class=&quot;big center&quot; alt=&quot;Prezto without options-groups&quot;/&gt;
&lt;div class=&quot;caption&quot;&gt;Prezto without options-groups&lt;/div&gt;&lt;/p&gt;

&lt;h2&gt;Problems with tmux&lt;/h2&gt;

&lt;p&gt;After setting up everything, I started tmux and had a flickering cursor:&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://cloud.githubusercontent.com/assets/264708/12245132/35b399fe-b8a7-11e5-9e57-22c571a5c185.gif&quot; alt=&quot;blinking_tmux&quot;&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;I tried a lot of different options in my &lt;code&gt;.zpretzorc&lt;/code&gt; file but finally found the source of error in my &lt;code&gt;tmux.conf&lt;/code&gt; file. I
had to remove some active-window/active-border settings:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt;-window-option -g window-style &lt;span class=&quot;s1&quot;&gt;&#39;bg=#181818&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt;-window-option -g window-active-style &lt;span class=&quot;s1&quot;&gt;&#39;bg=black&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt;-window-option -g pane-active-border-style &lt;span class=&quot;s1&quot;&gt;&#39;&#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I think the issue is still there but I don&amp;#39;t see it. The issue has something to do with asynchronity, as described in the &lt;a href=&quot;https://github.com/sorin-ionescu/prezto/issues/796&quot; title=&quot;issue on github&quot;&gt;issue on github&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Command-line completion speedup with prezto&lt;/h2&gt;

&lt;p&gt;Measure terminal startup time from a fresh &lt;em&gt;oh-my-zsh&lt;/em&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;time &lt;/span&gt;zsh -i -c &lt;span class=&quot;s2&quot;&gt;&quot;print -n&quot;&lt;/span&gt;
zsh -i -c &lt;span class=&quot;s2&quot;&gt;&quot;print -n&quot;&lt;/span&gt;  0,08s user 0,02s system 89% cpu 0,107 total
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But command-line completions (like &lt;code&gt;rake &amp;lt;tab&amp;gt;&lt;/code&gt;) take 2 seconds until it prints the available commands.&lt;/p&gt;

&lt;p&gt;Measure terminal startup time in &lt;em&gt;prezto&lt;/em&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;time &lt;/span&gt;zsh -i -c &lt;span class=&quot;s2&quot;&gt;&quot;print -n&quot;&lt;/span&gt;
zsh -i -c &lt;span class=&quot;s2&quot;&gt;&quot;print -n&quot;&lt;/span&gt;  0,34s user 0,09s system 87% cpu 0,491 total
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But &lt;code&gt;rake &amp;lt;tab&amp;gt;&lt;/code&gt; takes around 1,2 seconds until it prints the available commands. And I&amp;#39;m doing this a lot more than
opening new tabs, so that&amp;#39;s a real speedup!&lt;/p&gt;

&lt;h2&gt;Links&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://joshsymonds.com/blog/2014/06/12/shell-awesomeness-with-prezto/&quot; title=&quot;Shell Awesomeness With Prezto&quot;&gt;Shell Awesomeness With Prezto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jeromedalbert.com/migrate-from-oh-my-zsh-to-prezto/&quot; title=&quot;Migrate From Oh-my-zsh to Prezto&quot;&gt;Migrate From Oh-my-zsh to Prezto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://mikebuss.com/2014/04/07/customizing-prezto/&quot; title=&quot;theme overview with pictures&quot;&gt;theme overview with pictures&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Scrum Master Certification</title>
      <id>http://wikimatze.de/scrum-master-certification</id>
      <link href="http://wikimatze.de/scrum-master-certification"/>
      <published>2015-07-24T00:00:00+00:00</published>
      <updated>2015-07-24T00:00:00+00:00</updated>
      <category term="it-agile"/>
      <content type="html">&lt;p&gt;&lt;a href=&quot;https://farm1.staticflickr.com/313/19773478339_923e2c8f35_k_d.jpg&quot; title=&quot;Advanced Certified ScrumMaster training at it-agile&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;https://farm1.staticflickr.com/313/19773478339_555c107eed_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Advanced Certified ScrumMaster training at it-agile&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;caption&quot;&gt;Advanced Certified ScrumMaster training at it-agile&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;I had the pleasure to become a &lt;a href=&quot;https://www.scrumalliance.org/community/profile/gmatthias&quot; title=&quot;Certified ScrumMaster&quot;&gt;Certified ScrumMaster&lt;/a&gt; and did an advanced Certified ScrumMaster workshop at &lt;a href=&quot;http://www.it-agile.de/&quot; title=&quot;it-agile&quot;&gt;it-agile&lt;/a&gt; in Hamburg. Before and after the coaching (and even) before, you have to prepare yourself for the exam and learn more Scrum.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read the &lt;a href=&quot;https://www.scrum.org/Scrum-Guide&quot; title=&quot;Scrum Guide&quot;&gt;Scrum Guide&lt;/a&gt; by &lt;a href=&quot;http://en.wikipedia.org/wiki/Ken_Schwaber&quot; title=&quot;Ken Schwaber&quot;&gt;Ken Schwaber&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Jeff_Sutherland&quot; title=&quot;Jeff Sutherland&quot;&gt;Jeff Sutherland&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Run tests from &lt;a href=&quot;https://www.scrum.org/Assessments/Open-Assessments&quot; title=&quot;Scrum Open Assessment&quot;&gt;Scrum Open Assessment&lt;/a&gt; multiple times giving you coincidence in some tricky questions, run it several times to get comfortable with the questions.&lt;/li&gt;
&lt;li&gt;Run the three tests from &lt;a href=&quot;http://scrumsource.com/scrumexams.php&quot; title=&quot;scrumsource&quot;&gt;scrumsource&lt;/a&gt; as a starter to see how far your knowledge is.&lt;/li&gt;
&lt;li&gt;Read &lt;a href=&quot;http://www.scrumstudy.com/download-free-buy-SBOK.asp&quot; title=&quot;A Guide to the SCRUM BODY OF KNOWLEDGE&quot;&gt;A Guide to the SCRUM BODY OF KNOWLEDGE&lt;/a&gt; as an additional book for learning.&lt;/li&gt;
&lt;li&gt;Run another test under &lt;a href=&quot;http://www.proprofs.com/quiz-school/quizshow.php?title=vndirect-scrum-master-test&amp;amp;q=1&quot; title=&quot;proprofs&quot;&gt;proprofs&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Widen your horizon under the &lt;a href=&quot;https://www.scrum.org/Forums&quot; title=&quot;scrum.org forum&quot;&gt;scrum.org forum&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;During the test, don&amp;#39;t try to google questions, because they can differ from the questions you experience, since scrum evolves older questions gets outdated.&lt;/li&gt;
&lt;li&gt;The test is based on &lt;a href=&quot;http://www.scrumalliance.org/scrum/media/ScrumAllianceMedia/Files%20and%20PDFs/Certifications/CSM/CSM-Content-Outline-Learning-Objectives.pdf&quot; title=&quot;CSM Content Outline Learning Objectives&quot;&gt;CSM Content Outline Learning Objectives&lt;/a&gt; make sure to get through these questions and be able to answer them.&lt;/li&gt;
&lt;li&gt;To actually start the test, please go to the &lt;a href=&quot;https://www.scrumalliance.org/certifications/practitioners/certified-scrummaster-csm/becoming-a-certified-scrummaster&quot; title=&quot;scrum alliance page&quot;&gt;scrum alliance page&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since I&amp;#39;m a person who better learns through learning I created my &lt;a href=&quot;/scrum.pdf&quot; title=&quot;scrum notes in German&quot;&gt;scrum notes in German&lt;/a&gt;. If you have additions or notes, you can find the sources on &lt;a href=&quot;https://github.com/wikimatze/scrum&quot; title=&quot;GitHub&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://farm1.staticflickr.com/560/19960394305_62689e4c35_k_d.jpg&quot; title=&quot;Meeting mantra at it-agile&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;https://farm1.staticflickr.com/560/19960394305_a1d2b4d8a3_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;Meeting mantra at it-agile&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;caption&quot;&gt;Meeting mantra at it-agile&lt;/div&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Using Grub Customizer to manage the Bootloader</title>
      <id>http://wikimatze.de/using-grub-customizer-to-manage-the-bootloader</id>
      <link href="http://wikimatze.de/using-grub-customizer-to-manage-the-bootloader"/>
      <published>2015-07-09T00:00:00+00:00</published>
      <updated>2015-07-09T00:00:00+00:00</updated>
      <category term="howto"/>
      <content type="html">&lt;p&gt;I have &lt;a href=&quot;http://xubuntu.org/&quot; title=&quot;Xubuntu&quot;&gt;Xubuntu&lt;/a&gt; and &lt;a href=&quot;http://windows.microsoft.com/en-us/windows/windows-help#windows=windows-8&quot; title=&quot;Windows&quot;&gt;Windows&lt;/a&gt; installed on my machine. When booting my machine I can switch between those two systems. (This article was written for &lt;a href=&quot;http://xubuntu.org/news/14-04-release/&quot; title=&quot;Xubuntu 14.04&quot;&gt;Xubuntu 14.04&lt;/a&gt; and runs &lt;a href=&quot;https://launchpad.net/%7Edanielrichter2007/+archive/ubuntu/grub-customizer&quot; title=&quot;grub-customizer 4.06&quot;&gt;grub-customizer 4.06&lt;/a&gt;.)&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Usage&lt;/h2&gt;

&lt;p&gt;Once you have installed it, you can can start it with &lt;code&gt;grub-customizer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://farm8.staticflickr.com/7779/17189896339_1a0608aee2_o_d.png&quot; title=&quot;grub-customizer main window&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;https://farm8.staticflickr.com/7779/17189896339_e09d4f1f70_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;grub-customizer main window&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that you can click on an entry and change the loading list:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://farm8.staticflickr.com/7666/17350222016_5178693e19_o_d.png&quot; title=&quot;grub-customizer move entries around&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;https://farm8.staticflickr.com/7666/17350222016_e68a690162_z_d.jpg&quot; class=&quot;big center&quot; alt=&quot;grub-customizer move entries around&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The item at the first line will be the operating system which starts first.&lt;/p&gt;

&lt;p&gt;After programming, it&amp;#39;s good to move Windows to the top to enjoy playing for example &lt;a href=&quot;http://eternity.obsidian.net/&quot; title=&quot;Pillars of Eternity&quot;&gt;Pillars of Eternity&lt;/a&gt;.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Encrypt Your External Device</title>
      <id>http://wikimatze.de/encrypt-your-external-device</id>
      <link href="http://wikimatze.de/encrypt-your-external-device"/>
      <published>2015-05-05T00:00:00+00:00</published>
      <updated>2015-01-26T00:00:00+00:00</updated>
      <category term="ops"/>
      <content type="html">&lt;p&gt;I recently bought a new External Hardware with 2 TB space (&lt;a href=&quot;http://www.amazon.com/Transcend-Military-Tested-External-TS2TSJ25M3/dp/B00K087BM2&quot;&gt;Transcend StoreJet 25M3 Anti-Shock 2TB&lt;/a&gt; and I use it as a backup for my music, images, and all other documents.&lt;/p&gt;

&lt;p&gt;I always wanted to encrypt my whole device so here is how I started my journey. First let&amp;#39;s check
where our newly plugged in device can be found:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo fdisk -l

Disk /dev/sda: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors
Units &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; sectors of 1 &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; 512 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 512 bytes
Sector size &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;logical/physical&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: 512 bytes / 512 bytes
I/O size &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;minimum/optimal&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: 512 bytes / 512 bytes
Disk identifier: 0x000a9645

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   295317503   147555328    7  HPFS/NTFS/exFAT
/dev/sda3       491730942   500117503     4193281    5  Extended
/dev/sda4       295317504   491728895    98205696   83  Linux
/dev/sda5       491730944   500117503     4193280   82  Linux swap / Solaris

Partition table entries are not &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;disk order

Disk /dev/sdb1: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; sectors of 1 &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; 512 &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 512 bytes
Sector size &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;logical/physical&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: 512 bytes / 512 bytes
I/O size &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;minimum/optimal&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: 512 bytes / 512 bytes
Disk identifier: 0xa437ef40

  Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63  3907029167  1953514552+   7  HPFS/NTFS/exFAT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now we need to unmount the device:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo umount /dev/sdb1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To encrypt the device we will use a tool called &lt;a href=&quot;https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md&quot; title=&quot;cryptsetup&quot;&gt;cryptsetup&lt;/a&gt;. Once you&amp;#39;ve installed it, please run &lt;code&gt;cryptesetup --help&lt;/code&gt;, to see which cipher format are available for your machine:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;cryptsetup --help

Default compiled-in key and passphrase parameters:
  Maximum keyfile size: 8192kB, Maximum interactive passphrase length 512 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;characters&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  Default PBKDF2 iteration &lt;span class=&quot;nb&quot;&gt;time &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;LUKS: 1000 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;ms&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

Default compiled-in device cipher parameters:
  loop-AES: aes, Key 256 bits
  plain: aes-cbc-essiv:sha256, Key: 256 bits, Password hashing: ripemd160
  LUKS1: aes-xts-plain64, Key: 256 bits, LUKS header hashing: sha1, RNG: /dev/urandom
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cipher&quot; title=&quot;cipher&quot;&gt;cipher&lt;/a&gt;: is an algorithm doing the encryption or decryption&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/PBKDF2&quot; title=&quot;PBKDF2&quot;&gt;PBKDF2&lt;/a&gt;: stands for &lt;em&gt;Password-Based Key Derivation Function 2&lt;/em&gt; and applies various pseudorandom functions, HMAC (Hash Message Authentication Code), and salt over the input password in order to create a derived key for an block cipher&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Advanced_Encryption_Standard&quot; title=&quot;aes&quot;&gt;aes&lt;/a&gt;: stands for &lt;strong&gt;Advanced Encryption Standard&lt;/strong&gt; and is a specification for the encryption of data.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup&quot; title=&quot;LUKS1&quot;&gt;LUKS1&lt;/a&gt;: stands for &lt;strong&gt;Linux Unified Key Setup&lt;/strong&gt; and is disk-encryption specification developed by Clemens Fruhwirth (a Vienna guy) in 2004. The good thing about LUKS is that it is platform-independent for use in various tools, supports multiple passwords, stores all information in the partition header (users can transport or migrate data seamlessly), and it&amp;#39;s free.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So LUKS1 uses aes under the hood for partition encryption, while aes uses PBKDF2 to cipher the key to encrypt your
device.&lt;/p&gt;

&lt;p&gt;In order to check the performance of the different encryption formats, you can use the &lt;code&gt;cryptsetup benchmark&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;cryptsetup benchmark

&lt;span class=&quot;c&quot;&gt;# Tests are approximate using memory only (no storage IO).&lt;/span&gt;
PBKDF2-sha1       254015 iterations per second
PBKDF2-sha256     216647 iterations per second
PBKDF2-sha512     147603 iterations per second
PBKDF2-ripemd160  308767 iterations per second
PBKDF2-whirlpool  149454 iterations per second
&lt;span class=&quot;c&quot;&gt;#  Algorithm | Key |  Encryption |  Decryption&lt;/span&gt;
aes-cbc       128b   177,8 MiB/s   185,4 MiB/s
serpent-cbc   128b    91,7 MiB/s   229,0 MiB/s
twofish-cbc   128b   197,8 MiB/s   247,8 MiB/s
aes-cbc       256b   143,6 MiB/s   148,1 MiB/s
serpent-cbc   256b    94,8 MiB/s   240,0 MiB/s
twofish-cbc   256b   212,7 MiB/s   262,4 MiB/s
aes-xts       256b   201,5 MiB/s   196,0 MiB/s
serpent-xts   256b   214,8 MiB/s   214,0 MiB/s
twofish-xts   256b   194,9 MiB/s   227,0 MiB/s
aes-xts       512b   143,4 MiB/s   148,1 MiB/s
serpent-xts   512b   209,4 MiB/s   212,4 MiB/s
twofish-xts   512b   229,8 MiB/s   225,0 MiB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can above, PBKDF2-sha512 has the lowest number of iteration per second, this maximizes the effort of the
attacker, because he can&amp;#39;t less iteration to get your password. Besides &lt;a href=&quot;http://en.wikipedia.org/wiki/Disk_encryption_theory#Cipher-block_chaining_.28CBC.29&quot; title=&quot;cbc&quot;&gt;cbc (cipher-block chaining)&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Disk_encryption_theory#XEX-based_tweaked-codebook_mode_with_ciphertext_stealing_.28XTS.29&quot; title=&quot;xts&quot;&gt;xts&lt;/a&gt; are possible ciphers. We will use xts because it&amp;#39;s designed to support disk encryption efficiently and cbc is known to have some information leakage attacks. Since I&amp;#39;m having an SSD under the hood and USB 3 I want to have fast access so using 512 bit key with the &lt;a href=&quot;http://en.wikipedia.org/wiki/Twofish&quot; title=&quot;twofish&quot;&gt;twofish&lt;/a&gt; key block cipher is my choice. Normally &lt;a href=&quot;http://security.stackexchange.com/questions/6141/amount-of-simple-operations-that-is-safely-out-of-reach-for-all-humanity/6149#6149&quot; title=&quot;256 bit are good enough&quot;&gt;256 bit are good enough&lt;/a&gt; but I take 512 in favor with the little CPU overhead to be more save for the future.&lt;/p&gt;

&lt;p&gt;Now let&amp;#39;s put all the theory into practise:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo cryptsetup luksFormat -c twofish-xts -s 512 -h sha256 /dev/sdb1

WARNING!
&lt;span class=&quot;o&quot;&gt;========&lt;/span&gt;
This will overwrite data on /dev/sdb1 irrevocably.


Are you sure? &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Type uppercase yes&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: YES
Enter passphrase:
Verify passphrase:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;c ... set the cipher specification link&lt;/li&gt;
&lt;li&gt;s ... set the key size in bits&lt;/li&gt;
&lt;li&gt;h ... specifies the passphrase hash for open (I&amp;#39;m using the deprecated sha256 because sha512 was not working on my
machine)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next we use the &lt;code&gt;luksOpen&lt;/code&gt; to mount the device:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo cryptsetup luksOpen /dev/sdb1 transcend
Enter passphrase &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; /dev/sdb1:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Once it&amp;#39;s mounted you need to create a valid partition:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo mke2fs -j /dev/mapper/transcend -L transcend

mke2fs 1.42.9 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4-Feb-2014&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Filesystem &lt;span class=&quot;nv&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;transcend
OS &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;: Linux
Block &lt;span class=&quot;nv&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4096 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Fragment &lt;span class=&quot;nv&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4096 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;Stride&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0 blocks, Stripe &lt;span class=&quot;nv&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0 blocks
122101760 inodes, 488378126 blocks
24418906 blocks &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;5.00%&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; reserved &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;the super user
First data &lt;span class=&quot;nv&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
Maximum filesystem &lt;span class=&quot;nv&quot;&gt;blocks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4294967296
14905 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
  32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
  4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
  102400000, 214990848

Allocating group tables: &lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;Warning: could not &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;block 0: Attempt to &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;block from filesystem resulted &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;short &lt;span class=&quot;nb&quot;&gt;read
&lt;/span&gt;Writing inode tables: &lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;ext2fs_mkdir: Attempt to &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;block from filesystem resulted &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;short &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;creating root dir
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;-j&lt;/code&gt; options says that the filesystem should be &lt;a href=&quot;http://en.wikipedia.org/wiki/Ext3&quot; title=&quot;ext3 journal&quot;&gt;ext3 journal&lt;/a&gt; and
&lt;code&gt;-L&lt;/code&gt; sets the volume label for the filesystem to new-volume-label.&lt;/p&gt;

&lt;p&gt;I tried &lt;code&gt;mkfs.exfat&lt;/code&gt; to create the filesystem but got later on problems with changing the owner rights.&lt;/p&gt;

&lt;p&gt;It can be helpful to format the device in the exFAT format because it is both readable and writable by Mac, Windows, and
Linux.&lt;/p&gt;

&lt;p&gt;Finally edit &lt;code&gt;fstab&lt;/code&gt; file to automount the plates on your machine. Luckily the &lt;a href=&quot;http://docs.xfce.org/xfce/thunar/start&quot; title=&quot;thunar filesmanager&quot;&gt;thunar filesmanager&lt;/a&gt; does all the &lt;code&gt;luksOpen&lt;/code&gt; thing automatically for me.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://ubuntu-tutorials.com/2007/08/17/7-steps-to-an-encrypted-partition-local-or-removable-disk/&quot;&gt;Inspiration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.axllent.org/docs/security-and-encryption/256bit-aes-encryption/&quot;&gt;Better explanation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.wpkg.org/2009/04/23/cipher-benchmark-for-dm-crypt-luks/&quot;&gt;cipher benchmarks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://security.stackexchange.com/questions/40208/recommended-options-for-luks-cryptsetup&quot;&gt;luks cryptseup options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://docs.xfce.org/xfce/thunar/start&quot; title=&quot;Problems with rsync&quot;&gt;Problems with rsync&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Talk about Git and Vim - maximize the joy and fun</title>
      <id>http://wikimatze.de/talk-about-git-and-vim-maximize-the-joy-and-fun</id>
      <link href="http://wikimatze.de/talk-about-git-and-vim-maximize-the-joy-and-fun"/>
      <published>2015-02-03T00:00:00+00:00</published>
      <updated>2015-02-03T00:00:00+00:00</updated>
      <category term="talk"/>
      <content type="html">&lt;p&gt;Follow me through my travel exploring the way to get Vim and Git running in a friendly coexistence.&lt;/p&gt;

&lt;p&gt;Here are the slides of the talk:&lt;/p&gt;

&lt;script async class=&quot;speakerdeck-embed&quot; data-id=&quot;2e58f59084330132353846ef331f01f2&quot; data-ratio=&quot;1.33159947984395&quot; src=&quot;//speakerdeck.com/assets/embed.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;You can find the source under &lt;a href=&quot;https://bitbucket.org/wikimatze/presentations/branch/vim-and-git&quot; title=&quot;bitbucket&quot;&gt;bitbucket&lt;/a&gt;.
I gave this talk at &lt;a href=&quot;http://vimberlin.de/january-2015-meetup/&quot; title=&quot;Vimberlin January 2015 Meetup&quot;&gt;Vimberlin January 2015 Meetup&lt;/a&gt;.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Show the most common used terminal commands</title>
      <id>http://wikimatze.de/show-the-most-common-used-terminal-commands</id>
      <link href="http://wikimatze.de/show-the-most-common-used-terminal-commands"/>
      <published>2014-11-12T00:00:00+00:00</published>
      <updated>2014-11-12T00:00:00+00:00</updated>
      <category term="zsh"/>
      <content type="html">&lt;p&gt;I watched recently a &lt;a href=&quot;http://www.pluralsight.com/courses/play-by-play-ben-orenstein&quot;&gt;&amp;quot;Play by Play&amp;quot;&lt;/a&gt; video featuring &lt;a href=&quot;https://twitter.com/r00k&quot;&gt;Ben Orenstein&lt;/a&gt;. He is using a ton of command line alias and presented his work flow: He is searching the command line &lt;code&gt;history&lt;/code&gt; file of the most common used terms. After that create some nice alias to save you time.&lt;/p&gt;

&lt;p&gt;I asked Ben for the snippet:&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;&lt;p&gt;&lt;a href=&quot;https://twitter.com/wikimatze&quot;&gt;@wikimatze&lt;/a&gt; history | awk &amp;#39;{a[$2]++}END{for(i in a){print a[i] &amp;quot; &amp;quot; i}}&amp;#39; | sort -rn | head&lt;/p&gt;&amp;mdash; Ben Orenstein (@r00k) &lt;a href=&quot;https://twitter.com/r00k/status/489436243243974656&quot;&gt;July 16, 2014&lt;/a&gt;&lt;/blockquote&gt;

&lt;script async src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;All you have to do is to call:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;wm~  % &lt;span class=&quot;nb&quot;&gt;history&lt;/span&gt; | awk &lt;span class=&quot;s1&quot;&gt;&#39;{a[$2]++}END{for(i in a){print a[i] &quot; &quot; i}}&#39;&lt;/span&gt; | sort -rn | head
  4716 git
  4526 vim
  3567 ls
  2140 &lt;span class=&quot;nb&quot;&gt;cd
  &lt;/span&gt;1269 bundle
  877 sudo
  755 tig
  725 ..
  723 clear
  513 rm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/jayeff&quot;&gt;Johannes Faigle&lt;/a&gt; pinged me on &lt;a href=&quot;https://twitter.com/jayeff/status/489530404589031424&quot;&gt;twitter&lt;/a&gt; a more sophisticated variant of the &lt;a href=&quot;https://github.com/robbyrussell/oh-my-zsh/blob/217d8f0540a41b2927caf986561e45634fa1952a/lib/functions.zsh#L2&quot;&gt;oh-my-zsh&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;zsh-stats&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;fc&lt;/span&gt; -l 1 | awk &lt;span class=&quot;s1&quot;&gt;&#39;{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] &quot; &quot; CMD[a]/count*100 &quot;% &quot; a;}&#39;&lt;/span&gt; | grep -v &lt;span class=&quot;s2&quot;&gt;&quot;./&quot;&lt;/span&gt; | column -c3 -s &lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt; -t | sort -nr | nl | head -n25
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now calling &lt;code&gt;zsh-stats&lt;/code&gt; gives you the following overview:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;wm~  % zsh-stats
     1  4716  18.8746%     git
     2  4526  18.1141%     vim
     3  3567  14.276%      ls
     4  2140  8.5648%      &lt;span class=&quot;nb&quot;&gt;cd
     &lt;/span&gt;5  1269  5.07884%     bundle
     6  877   3.50997%     sudo
     7  755   3.02169%     tig
     8  725   2.90162%     ..
     9  723   2.89362%     clear
    10  513   2.05315%     rm
    11  406   1.62491%     d
    12  267   1.0686%      v
    13  241   0.96454%     rake
    14  238   0.952533%    &lt;span class=&quot;nb&quot;&gt;exec
    &lt;/span&gt;15  222   0.888498%    tmux
    16  216   0.864484%    cf
    17  183   0.73241%     bash
    18  181   0.724406%    tmuxifier
    19  158   0.632354%    gem
    20  152   0.608341%    ruby
    21  146   0.584327%    &lt;span class=&quot;nb&quot;&gt;fg
    &lt;/span&gt;22  145   0.580325%    mv
    23  141   0.564316%    ~
    24  121   0.484271%    padrino
    25  121   0.484271%    ack-grep
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now go out and create your personal aliases!&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Google Chrome Start Problem</title>
      <id>http://wikimatze.de/google-chrome-start-problem</id>
      <link href="http://wikimatze.de/google-chrome-start-problem"/>
      <published>2014-10-21T00:00:00+00:00</published>
      <updated>2014-10-21T00:00:00+00:00</updated>
      <category term="linux"/>
      <content type="html">&lt;p&gt;After updating my system I could not start chrome anymore. When running &lt;code&gt;chromium-browser&lt;/code&gt; or &lt;code&gt;google-chrome&lt;/code&gt; I got the following error message:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;ATTENTION: default value of option force_s3tc_enable overridden by environment.

MESA-LOADER: could not create udev device &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;fd 26
ATTENTION: default value of option force_s3tc_enable overridden by environment.
VMware: vmw_ioctl_command error Das Argument ist ungültig.
VMware: vmw_ioctl_command error Das Argument ist ungültig.
VMware: vmw_ioctl_command error Das Argument ist ungültig.
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;11360:11360:0929/105136:ERROR:gl_renderer.cc&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;445&lt;span class=&quot;o&quot;&gt;)]&lt;/span&gt; Reached limit of pending sync queries.
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;11360:11360:0929/105136:FATAL:gles2_implementation.cc&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;3487&lt;span class=&quot;o&quot;&gt;)]&lt;/span&gt; Check failed: query-&amp;gt;CheckResultsAvailable&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;helper_&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;.
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1]    11360 abort &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;core dumped&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;  chromium-browser
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can use the &lt;code&gt;--disable-gpu&lt;/code&gt; option to start chrome without any gpu for the browser. You can disable this option permanently with in Settings/Show advanced settings and disable the setting for &lt;code&gt;Use hardware acceleration when available&lt;/code&gt; in the System tab.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Installing Printer Driver For Brother HL-2240D Under Xubuntu</title>
      <id>http://wikimatze.de/installing-printer-driver-for-brother-hl-2240d-under-xubuntu</id>
      <link href="http://wikimatze.de/installing-printer-driver-for-brother-hl-2240d-under-xubuntu"/>
      <published>2014-09-30T00:00:00+00:00</published>
      <updated>2014-09-30T00:00:00+00:00</updated>
      <category term="linux"/>
      <content type="html">&lt;p&gt;You can go and install the default printer driver but that will not work for Duplex Printer under Xubuntu. The best choice is to install the official Brother Tools for Linux.&lt;/p&gt;

&lt;h2&gt;Get the sources&lt;/h2&gt;

&lt;p&gt;Since I have HL-2240D I need to grab the following script: &lt;a href=&quot;http://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&amp;amp;lang=en&amp;amp;prod=hl2240d_all&amp;amp;os=128&quot;&gt;http://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&amp;amp;lang=en&amp;amp;prod=hl2240d_all&amp;amp;os=128&lt;/a&gt;. You can get the code
direct from &lt;a href=&quot;http://download.brother.com/welcome/dlf006893/linux-brprinter-installer-2.0.0-1.gz&quot;&gt;http://download.brother.com/welcome/dlf006893/linux-brprinter-installer-2.0.0-1.gz&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;p&gt;Once you get the script, you need to run it &lt;code&gt;./linux-brprinter-installer-2.0.0-1&lt;/code&gt; and follow the following installation dialog:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;Input model name -&amp;gt;HL-2240D

You are going to install following packages.
   hl2240dlpr-2.1.1-1.i386.deb
   cupswrapperHL2240D-2.0.4-2.i386.deb
OK? &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;y/N] -&amp;gt;y

dpkg -x hl2240dlpr-2.1.1-1.i386.deb /
dpkg -x cupswrapperHL2240D-2.0.4-2.i386.deb /
dpkg-deb: building package &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;hl2240dlpr&lt;span class=&quot;s1&quot;&gt;&#39; in `hl2240dlpr-2.1.1-1a.i386.deb&#39;&lt;/span&gt;.
dpkg -b ./brother_driver_packdir hl2240dlpr-2.1.1-1a.i386.deb
dpkg-deb: building package &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;cupswrapperhl2240d&lt;span class=&quot;s1&quot;&gt;&#39; in `cupswrapperHL2240D-2.0.4-2a.i386.deb&#39;&lt;/span&gt;.
dpkg -b ./brother_driver_packdir cupswrapperHL2240D-2.0.4-2a.i386.deb
dpkg -i --force-all hl2240dlpr-2.1.1-1a.i386.deb
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Reading database ... 261952 files and directories currently installed.&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Preparing to unpack hl2240dlpr-2.1.1-1a.i386.deb ...
Unpacking hl2240dlpr &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.1.1-1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; over &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.1.1-1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; ...
Setting up hl2240dlpr &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.1.1-1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; ...
dpkg -i --force-all cupswrapperHL2240D-2.0.4-2a.i386.deb
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Reading database ... 261952 files and directories currently installed.&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Preparing to unpack cupswrapperHL2240D-2.0.4-2a.i386.deb ...
 &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; Restarting Common Unix Printing System cupsd
   ...done.
Unpacking cupswrapperhl2240d &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.0.4-2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; over &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.0.4-2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; ...
Setting up cupswrapperhl2240d &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.0.4-2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; ...
 &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; Restarting Common Unix Printing System cupsd
   ...done.

Will you specify the Device URI? &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Y/n] -&amp;gt;n

Test Print? &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;y/N] -&amp;gt;y

&lt;span class=&quot;nb&quot;&gt;wait &lt;/span&gt;5s.
lpr -P HL2240D /usr/share/cups/data/testprint
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Hope this article helps you a lot and makes you happy using your Brother printer in the right version for your PC.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Code Coverage Tools For Padrino</title>
      <id>http://wikimatze.de/code-coverage-tools-for-padrino</id>
      <link href="http://wikimatze.de/code-coverage-tools-for-padrino"/>
      <published>2014-07-24T00:00:00+00:00</published>
      <updated>2014-07-24T00:00:00+00:00</updated>
      <category term="ruby"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article is part of an ongoing series about my exploration of the Padrino web framework. If you want to read more
about it please check out &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook.com&lt;/a&gt;. You sniff around in the sources of the book under
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;As long as your application exists, some developers leave others will join. It&amp;#39;s good to have some metrics about certain code smells. A code smell is part of your source code which may be the root of a design problem but is not actually a bug. It&amp;#39;s good to have some tools to be &amp;quot;lord of the smells&amp;quot; for &lt;a href=&quot;http://www.padrinorb.com/&quot;&gt;Padrino&lt;/a&gt; - don&amp;#39;t let smells lower the quality of your project.&lt;/p&gt;

&lt;p&gt;(Note: This post is tested with &lt;a href=&quot;http://www.padrinorb.com/blog/padrino-0-12-0-activesupport-4-rewritten-reloader-smarter-rendering-and-loads-more&quot;&gt;padrino 0.12.2&lt;/a&gt;, &lt;a href=&quot;https://github.com/colszowka/simplecov&quot;&gt;simplecov 0.9&lt;/a&gt;, &lt;a href=&quot;https://github.com/metricfu/metric_fu/&quot;&gt;metric_fu 4.11.1&lt;/a&gt;, and &lt;a href=&quot;https://www.ruby-lang.org/en/news/2013/09/23/ruby-2-1-0-preview1-is-released/&quot;&gt;ruby 2.1.2p95&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;Available Tools&lt;/h2&gt;

&lt;p&gt;I will go through the following tools and will explain how you can use them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/colszowka/simplecov&quot;&gt;simplecov&lt;/a&gt;: It will automatically detect the tests you are using Rubies 1.9&amp;#39;s &lt;a href=&quot;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/coverage/rdoc/Coverage.html&quot;&gt;built-in Coverage library&lt;/a&gt; to gather code coverage data.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/metricfu/metric_fu/&quot;&gt;metric_fu&lt;/a&gt;: Creates churn, code smells, and other coverage tools that generate reports about your code.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://codeclimate.com/&quot;&gt;codeclimate.com&lt;/a&gt;: Online tool for measuring quality and security for your application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Simplecov&lt;/h2&gt;

&lt;p&gt;Add the gem to your &lt;code&gt;Gemfile&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;simplecov&#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next, I want to start the code coverage generation every time I run the tests. So we need to add the following line to the &lt;code&gt;spec_helper.rb&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;simplecov&#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;SimpleCov&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;start&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And that&amp;#39;s all. Next time when you run the tests you can detect lines with the following output:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;Coverage report generated &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;RSpec to ~/git/job-vacancy/coverage. 209 / 252 LOC &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;82.94%&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; covered.
/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After all tests have been passed, you can see the output in the &lt;code&gt;coverage/index.html&lt;/code&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm4.staticflickr.com/3754/13240488444_f4a2a02afc_o.png&quot; title=&quot;Simplecover overview without any special configuration&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3754/13240488444_f9a39d216a_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Simplecover overview without any special configuration&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;caption&quot;&gt;Simplecover overview without any special configuration&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7341/13240163115_7acfa5bab0_o.png&quot; title=&quot;Simplecov with an detailed view&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7341/13240163115_6abdb36689_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Simplecov with an detailed view&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;caption&quot;&gt;Clicking on a single class will give you a brief overview which lines are not tested&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;It is also possible to divide parts of your application into several groups. Add options to the &lt;code&gt;Simplecov.start&lt;/code&gt; block:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;SimpleCov&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;add_group&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Models&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;app/models&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;add_group&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Controllers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;app/controllers&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;add_group&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Helpers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;app/helpers&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;add_group&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Mailers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;app/mailers&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7302/13240489074_f8fce593fb_o.png&quot; title=&quot;Simplecov grouped output&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7302/13240489074_d38bff94b8_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Simplecov grouped output&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;caption&quot;&gt; Simplecov - a more structured view of different components&lt;/div&gt;&lt;/p&gt;

&lt;h2&gt;metric_fu&lt;/h2&gt;

&lt;p&gt;Add the following line to your &lt;code&gt;Gemfile&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;metric_fu&#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When this is done you need to start the &lt;code&gt;metric_fu&lt;/code&gt; command from your command line:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;~/git/job-vacancy: metric_fu
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC reek
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC reek
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC flog
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC flog
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC flay
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC flay
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC saikuro
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC saikuro
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC roodi
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC roodi
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC cane
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC cane
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC churn
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC churn
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC stats
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC stats
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; STARTING METRIC hotspots
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; ENDING METRIC hotspots
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; SAVING REPORTS
&lt;span class=&quot;k&quot;&gt;*******&lt;/span&gt; GENERATING GRAPHS
&lt;span class=&quot;k&quot;&gt;*****&lt;/span&gt;Generating graphs
&lt;span class=&quot;k&quot;&gt;*****&lt;/span&gt;Generating graphs &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;tmp/metric_fu/_data/20140318.yml
all &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will generate a &lt;code&gt;tmp/metric_fu&lt;/code&gt; directory with the following contents:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;tmp/metric_fu
├── _data
│   └── 20140318.yml
├── output
│   ├── app_app.rb.html
│   ├── app_controllers_page.rb.html
│   ├── app_controllers_sessions.rb.html
│   ├── app_controllers_users.rb.html
│   ├── app_helpers_page_helper.rb.html
│   ├── app_helpers_sessions_helper.rb.html
│   ├── app_helpers_users_helper.rb.html
│   ├── app_mailers_confirmation.rb.html
│   ├── app_mailers_registration.rb.html
│   ├── app_models_job_offer.rb.html
│   ├── app_models_user_observer.rb.html
│   ├── app_models_user.rb.html
│   ├── app_views_application.erb.html
│   ├── app_views_users_edit.erb.html
│   ├── app_views_users_new.erb.html
│   ├── bluff-min.js
│   ├── cane.html
│   ├── cane.js
│   ├── churn.html
│   ├── excanvas.js
│   ├── flay.html
│   ├── flay.js
│   ├── flog.html
│   ├── flog.js
│   ├── Gemfile.html
│   ├── Gemfile.lock.html
│   ├── hotspots.html
│   ├── index.html
│   ├── js-class.js
│   ├── lib_tasks_auth_token_attribute.rake.html
│   ├── reek.html
│   ├── reek.js
│   ├── roodi.html
│   ├── roodi.js
│   ├── saikuro.html
│   ├── spec_app_controllers_users_controller_spec.rb.html
│   ├── stats.html
│   └── stats.js
├── report.yml
└── scratch
    └── churn
        └── 873660ae5973b77b09c47d1dcf03577222095d6e.json

4 directories, 41 files
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The following metrics are created by &lt;code&gt;cane&lt;/code&gt; can be used if code quality thresholds are met.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm3.staticflickr.com/2828/13240306993_93fe770af0_o.png&quot; title=&quot;Cane metric to measure code quality thresholds.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2828/13240306993_eb90332075_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Cane metric to measure code quality thresholds.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;churn&lt;/code&gt; measures the change ratio of files and you can use this indicator to have more code review, refactoring, more tests for this &lt;strong&gt;beast of a file&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm3.staticflickr.com/2857/13240489654_ed48447f93_o.png&quot; title=&quot;Churn measures the change ratio of files&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2857/13240489654_8ffbb16bae_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Churn measures the change ratio of files&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;flog&lt;/code&gt; a high flog score is an indicator for code complexity.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7036/13240164005_baca449841_o.png&quot; title=&quot;Flog measures the complexity of a file by giving several flaws in the code a certain ranking.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7036/13240164005_35459cc33c_z.jpg&quot; class=&quot;big center&quot; alt=&quot;Flog measures the complexity of a file by giving several flaws in the code a certain ranking.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;flay&lt;/code&gt; analyzes code similarities in your code base - good way to stay clean with &lt;a href=&quot;http://en.wikipedia.org/wiki/Don%27t_repeat_yourself&quot;&gt;DRY&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm4.staticflickr.com/3715/13240307803_6f636cbb78_o.png&quot; title=&quot;Flay measures code duplication.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3715/13240307803_7f55db88f8_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Flay measures code duplication.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;reek&lt;/code&gt; checks your classes and modules after code smells. Under the &lt;a href=&quot;https://github.com/troessner/reek/wiki/Code-Smells&quot;&gt;reek wiki&lt;/a&gt; you can find all code smells and what they actually mean.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7026/13240165265_9cf883ab3c_o.png&quot; title=&quot;Check your classes, and modules after code smells.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7026/13240165265_dc06f44db4_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Check your classes, and modules after code smells.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;hotspot&lt;/code&gt; a gathering of the flog, flay and reek score of the files in your application.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7444/13240490574_534f559005_o.png&quot; title=&quot;Hotspot measure overview.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7444/13240490574_536339c8df_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Hotspot measure overview.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7430/13240491094_2dce09ded0_o.png&quot; title=&quot;Hotspot measure detailed.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7430/13240491094_1dcb0e3188_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Hotspot measure detailed.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;roodi&lt;/code&gt; scans your code and informs you about design issues you may have.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7202/13240309053_b1e0daae4f_o.png&quot; title=&quot;Roodi detect issues with your design.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7202/13240309053_1686a6705d_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Roodi detect issues with your design.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;saikuro&lt;/code&gt; generates a list of cyclomatic complexity of each method found in your application.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm3.staticflickr.com/2869/13240165955_a94efe5ab2_o.png&quot; title=&quot;Sailuro meases the cyclomatic complexity of all methods in your application.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2869/13240165955_8113b4c859_z.jpg&quot; class=&quot;big center&quot; alt=&quot;Sailuro meases the cyclomatic complexity of all methods in your application.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Code Climate&lt;/h2&gt;

&lt;p&gt;Go to the website &lt;a href=&quot;https://codeclimate.com&quot;&gt;codeclimate.com&lt;/a&gt; and register. Once you are logged, you can add any ruby related open source project for free.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm4.staticflickr.com/3699/13245245445_fd8fbd0efb_o.png&quot; title=&quot;Code Climate - add a repository.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3699/13245245445_50c46c74d2_z.jpg&quot; class=&quot;big center&quot; alt=&quot;Code Climate - add a repository.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will take a while till the metrics are generated for your application:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;&quot; title=&quot;Refreshing the metrics takes a while on Code Climate&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3682/13245246155_8679cb3c79_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Refreshing the metrics takes a while on Code Climate&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But when it&amp;#39;s ready, you get a nice overview:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm4.staticflickr.com/3682/13245246155_8b39d98dc1_o.png&quot; title=&quot;Code Climate overview&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm4.staticflickr.com/3682/13245246155_8679cb3c79_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Code Climate overview&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or a more detailed overview of single classes:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://farm3.staticflickr.com/2900/14748209173_3bae7b4524_o.png&quot; title=&quot;Detailed information about a single file in Code Climate&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;https://farm3.staticflickr.com/2900/14748209173_2d561a0e99_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Detailed information about a single file in Code Climate&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;caption&quot;&gt;Detailed information about a single file in Code Climate&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Highlight Bad Words In Vim</title>
      <id>http://wikimatze.de/highlight-bad-words-in-vim</id>
      <link href="http://wikimatze.de/highlight-bad-words-in-vim"/>
      <published>2014-07-11T00:00:00+00:00</published>
      <updated>2014-07-11T00:00:00+00:00</updated>
      <category term="vim"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article is part of an ongoing series about my exploration of the Padrino web framework. If you want to read more
about it please check out &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook.com&lt;/a&gt;. You sniff around in the sources of the book under
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#39;m currently writing, reviewing, and deleting a lot of words for my &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook&lt;/a&gt;. Words like &lt;code&gt;easy&lt;/code&gt;, &lt;code&gt;however&lt;/code&gt;, &lt;code&gt;so&lt;/code&gt;, or &lt;code&gt;just&lt;/code&gt; are growing in some parts of the book like a disease. The term for bad words is &lt;strong&gt;clutter&lt;/strong&gt;, which I learned after reading &lt;a href=&quot;http://www.amazon.com/Writing-Well-30th-Anniversary-Nonfiction/dp/0060891548/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1359744126&amp;amp;sr=1-1&amp;amp;keywords=On+Writing+Well&quot;&gt;On Writing Well&lt;/a&gt; by William Zinsser.&lt;/p&gt;

&lt;p&gt;Clutter is not everywhere in the documents. It usually occurs when you are writing on a late evening or you are just thinking in technical terms.&lt;/p&gt;

&lt;p&gt;After finishing a section it would be nice to browse through the text on the screen and scan for bad words. See them and get rid of them. It helps you to be more precise and you stay focus on what you want to write.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;Clutter Highlighting Function in  Vim&lt;/h2&gt;

&lt;p&gt;The idea is to have a list of bad words and then give them a red background. To highlight the words vims &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/syntax.html#highlight-ctermbg&quot;&gt;ctermbg&lt;/a&gt; and &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/syntax.html#highlight-ctermfg&quot;&gt;ctermfg&lt;/a&gt; can be used in combination with the &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/syntax.html#:highlight&quot;&gt;highlight function&lt;/a&gt;. After that we can use the &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/pattern.html#:match&quot;&gt;match&lt;/a&gt; function in combination of the predefined color highlighting.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;highlight TechWordsToAvoid ctermbg&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;red&lt;/span&gt; ctermfg&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;white

&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; MatchTechWordsToAvoid&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;match&lt;/span&gt; TechWordsToAvoid &lt;span class=&quot;sr&quot;&gt;/\c\&amp;lt;\(obviously\|basically\|simply\|of\scourse\|clearly\|just\|everyone\sknows\|however\|so\|easy\)\&amp;gt;/&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;endfunction&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Since I&amp;#39;m writing my book with the help of &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;markdown&lt;/a&gt; I only want to highlight words the words if I&amp;#39;m on those files. Let&amp;#39;s use the &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/autocmd.html#:autocmd&quot;&gt;autocmd&lt;/a&gt; with the &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/autocmd.html#FileType&quot;&gt;FileType&lt;/a&gt; option for markdown:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&quot;vim&quot;&gt;autocmd &lt;span class=&quot;nb&quot;&gt;FileType&lt;/span&gt; markdown &lt;span class=&quot;k&quot;&gt;call&lt;/span&gt; MatchTechWordsToAvoid&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now a file with many bad words will look like the following:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://farm3.staticflickr.com/2929/14614949161_6fa3bc1c2b_o.png&quot; title=&quot;Highlight Bad Words in Vim&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;https://farm3.staticflickr.com/2929/14614949161_46c45efaee_c.jpg&quot; class=&quot;big center&quot; alt=&quot;Highlight Bad Words in Vim&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;caption&quot;&gt;Highlight Bad Words in Vim&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>RespImgPageCache not found in cache.inc file for Drupal</title>
      <id>http://wikimatze.de/respimgpagecache-not-found-in-cache-dot-inc-file-for-drupal</id>
      <link href="http://wikimatze.de/respimgpagecache-not-found-in-cache-dot-inc-file-for-drupal"/>
      <published>2014-06-05T00:00:00+00:00</published>
      <updated>2014-06-05T00:00:00+00:00</updated>
      <category term="drupal"/>
      <content type="html">&lt;p&gt;I&amp;#39;m working with Drupal and &lt;a href=&quot;https://drupal.org/documentation/install/modules-themes/modules-7&quot;&gt;installing a new module&lt;/a&gt; is probably no problem. After installing the &lt;a href=&quot;https://drupal.org/project/webform&quot;&gt;webform module&lt;/a&gt; I got the following error on the QA system:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;Fatal error: Class &lt;span class=&quot;s1&quot;&gt;&#39;RespImgPageCache&#39;&lt;/span&gt; not found &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /var/www/releases/drupal/releases/20140603132022/includes/cache.inc on line 31
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I removed the module, and clear the cache with &lt;code&gt;drush cache-clear&lt;/code&gt; - in the end I still got the error.&lt;/p&gt;

&lt;p&gt;After searching for this error I found the solution on a &lt;a href=&quot;https://drupal.org/node/1706596&quot;&gt;Drupal thread&lt;/a&gt;. I inserted
the following snippet in the &lt;code&gt;cache.inc&lt;/code&gt; file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$cache_class_cache_page_old&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;variable_get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;resp_img_cache_class_cache_page_old&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cache_class_cache_page_old&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;variable_set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;cache_class_cache_page&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$cache_class_cache_page_old&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;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;variable_del&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;cache_class_cache_page&#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;variable_del&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;resp_img_cache_class_cache_page_old&#39;&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;After this commit, you have to call some Drupal page where the loading will take a while. After the loading is finished
you still get white pages now you have to remove the code snippet from above in another commit. Now the
&lt;code&gt;RespImgPageCache&lt;/code&gt; error was gone.&lt;/p&gt;

&lt;p&gt;The strange thing was, that the &lt;a href=&quot;https://drupal.org/project/webform&quot;&gt;webform module&lt;/a&gt; didn&amp;#39;t had any dependencies to the
&lt;code&gt;RespImgPageCache&lt;/code&gt; module. Hopefully, this post will help other developers save a lot of time.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Global Gitignore</title>
      <id>http://wikimatze.de/global-gitignore</id>
      <link href="http://wikimatze.de/global-gitignore"/>
      <published>2014-04-08T00:00:00+00:00</published>
      <updated>2014-04-08T00:00:00+00:00</updated>
      <category term="learning"/>
      <content type="html">&lt;p&gt;For all my projects I was creating a local &lt;code&gt;.gitignore&lt;/code&gt; files which keeps track of files I don&amp;#39;t want to have under version control. The most common ones are for me &lt;code&gt;.*.sw*&lt;/code&gt;, &lt;code&gt;.DS_Store&lt;/code&gt;, &lt;code&gt;log/**/*&lt;/code&gt; or &lt;code&gt;tags&lt;/code&gt; files. You don&amp;#39;t want to repeat yourself and you can put those file in a global gitignore file with the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git config --global core.excludesfile ~/.gitignore
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will create an entry in your &lt;code&gt;~/.gitconfig&lt;/code&gt; file like the following:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;user]
  name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; Matthias Guenther
  email &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; matthias@wikimatze.de
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;apply]
  whitespace &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; nowarn
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core]
  editor &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; vim
  autocrlf &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; input
  excludesfile &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; ~/.gitignore
  pager &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; cat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;My personal &lt;code&gt;.gitignore&lt;/code&gt; has the following contents:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;----------
| Jekyll |
----------
_site/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;

--------
| Ruby |
--------
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.gem
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.thor
bundle/&lt;span class=&quot;k&quot;&gt;**&lt;/span&gt;/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;


-----------
| Padrino |
-----------
application.css
application.js
coverage/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
tags.html


--------
| Vim  |
--------
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.spl
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.sw&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
backup/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
tags
yankring.txt
.netrwhist


----------------------
| Logs and databases |
----------------------
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.log
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.sql
&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.sqlite


----------------------
| OS generated files |
----------------------
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
._&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
Thumbs.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content>
    </entry>
  
    <entry>
      <title>Github Two-Factor Authentication Failed For HTTPS</title>
      <id>http://wikimatze.de/github-two-factor-authentication-failed-for-https</id>
      <link href="http://wikimatze.de/github-two-factor-authentication-failed-for-https"/>
      <published>2014-03-27T00:00:00+00:00</published>
      <updated>2014-03-27T00:00:00+00:00</updated>
      <category term="learning"/>
      <content type="html">&lt;p&gt;I heard from &lt;a href=&quot;https://github.com/blog/1614-two-factor-authentication&quot;&gt;GitHub&amp;#39;s Two-Factor Authentication&lt;/a&gt; nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn&amp;#39;t push to any of my repositories anymore. Learn in this blog post how to fix it.&lt;/p&gt;

&lt;h2&gt;Two-Factor Authentication&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Two-step_verification&quot;&gt;&amp;quot;Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network&amp;quot;&lt;/a&gt;. Github solves this authentication with sending an SMS to a device which wants to push to their platform.&lt;/p&gt;

&lt;h2&gt;Enabling Two-Factor Authentication&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open your Account Settings.&lt;/li&gt;
&lt;li&gt;Set up two-factor authentication.&lt;/li&gt;
&lt;li&gt;You&amp;#39;ll be given the option of setting up 2FA either through a text message, or through an app you can download onto your smart phone.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you enter in the number on your GitHub page, your account is verified.&lt;/p&gt;

&lt;h2&gt;Setting Up a Personal Access Token&lt;/h2&gt;

&lt;p&gt;Since you have enabled 2FA, you can create a personal access token.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your Account Settings.&lt;/li&gt;
&lt;li&gt;Click on Applications - this is where you can find a section to  create your &lt;em&gt;Personal Access Token&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Save the password in some encrypted file.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Testing your Personal Access Token&lt;/h2&gt;

&lt;p&gt;Run:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;curl -u &amp;lt;token&amp;gt;:x-oauth-basic https://api.github.com/user
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If everything works fine then you should get following JSON output:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;login&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;wikimatze&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;264708&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;avatar_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://avatars.githubusercontent.com/u/264708?&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;gravatar_id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;9172bb642e29e9959f078f329308faa1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;html_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://github.com/wikimatze&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;followers_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/followers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;following_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/following{/other_user}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;gists_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/gists{/gist_id}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;starred_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/starred{/owner}{/repo}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;subscriptions_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/subscriptions&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;organizations_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/orgs&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;repos_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/repos&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;events_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/events{/privacy}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;received_events_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/users/wikimatze/received_events&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;User&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;site_admin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Matthias Günther&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;company&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;blog&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://wikimatze.de/about.html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;location&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Berlin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;matthias@wikimatze.de&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;hireable&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;bio&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;software developer, writer, hiker, jogger, and mobile apps lover&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;public_repos&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;public_gists&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;followers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;54&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;following&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;65&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;created_at&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2010-05-04T16:46:36Z&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;updated_at&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2014-03-26T04:43:54Z&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;private_gists&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;total_private_repos&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;owned_private_repos&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;disk_usage&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;57682&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;collaborators&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;plan&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;free&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;space&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;307200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;collaborators&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;private_repos&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If something went wrong, you should get a message like:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Not Found&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;documentation_url&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://developer.github.com/v3&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Pushing to a HTTPS Github URL on Your Own&lt;/h2&gt;

&lt;p&gt;I had all my repositories checked out via HTTPS. But after enabling 2FA, I couldn&amp;#39;t push to this repositories anymore.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git remote -v
  origin https://github.com/wikimatze/wikimatze.de.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;fetch&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  origin https://github.com/wikimatze/wikimatze.de.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;push&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git push origin master
  fatal: &lt;span class=&quot;s1&quot;&gt;&#39;git@github.com/wikimatze/wikimatze.de.git&#39;&lt;/span&gt; does not appear to be a git repository
  fatal: Could not &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I tried every combination of passwords, personal access token and even created a new ssh-key, but it didn&amp;#39;t work. I had
to change the remote URL to &lt;code&gt;git@github.com:wikimatze/wikimatze.de.git&lt;/code&gt; to get it running again.&lt;/p&gt;

&lt;h2&gt;Pushing to a HTTPS GitHub URL on an Organization&lt;/h2&gt;

&lt;p&gt;I&amp;#39;m the maintainer of &lt;a href=&quot;http://vimberlin.de/&quot;&gt;vimberlin.de&lt;/a&gt; and pushing my changes with the &lt;code&gt;git@*&lt;/code&gt; remote URL hack did
not work out very well:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git remote -v
  origin git@github.com/vimberlin/vimberlin.de.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;fetch&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  origin git@github.com/vimberlin/vimberlin.de.git &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;push&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git push
  fatal: &lt;span class=&quot;s1&quot;&gt;&#39;git@github.com/vimberlin/vimberlin.de.git&#39;&lt;/span&gt; does not appear to be a git repository
  fatal: Could not &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Most posts out there advices to use &lt;a href=&quot;http://olivierlacan.com/posts/why-is-git-https-not-working-on-github/&quot;&gt;osxkeychain&lt;/a&gt; to save your credentials. Since I&amp;#39;m using &lt;a href=&quot;http://xubuntu.org/&quot;&gt;Xubuntu&lt;/a&gt; for developing I had to search after another solution.&lt;/p&gt;

&lt;h2&gt;Use .netrc File To Store Credentials&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.netrc&lt;/code&gt; file contains &lt;a href=&quot;http://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-File.html&quot;&gt;login and initialization information&lt;/a&gt; for managing the auto-login process.&lt;/p&gt;

&lt;p&gt;All you have to do is to setup your credentials in &lt;code&gt;~/.netrc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;machine github.com
login wikimatze
password &amp;lt;token&amp;gt;
protocol https

machine gist.github.com
login wikimatze
password &amp;lt;token&amp;gt;
protocol https
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Where &lt;code&gt;&amp;lt;token&amp;gt;&lt;/code&gt; is your personal access token. It would be silly to save your password in plain text.&lt;/p&gt;

&lt;h2&gt;Encrypt .netrc file with GPG&lt;/h2&gt;

&lt;p&gt;I assume that you already have your &lt;code&gt;GPG&lt;/code&gt; key, you need to run the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gpg --encrypt --armor --recipient matthias.guenther@wikimatze.de .netrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And update the credentials helper:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git config --global credential.helper &lt;span class=&quot;s2&quot;&gt;&quot;netrc -f ~/.netrc.asc -v&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you should be able to push again.&lt;/p&gt;

&lt;h2&gt;Update About the organization push problem&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/RyanHiebert&quot;&gt;Ryan&lt;/a&gt; mentioned all you have to do to push to an organization is use a colon before
the username in the URL: Instead of &lt;code&gt;git@github.com/vimberlin/vimberlin.de.git&lt;/code&gt; it should be &lt;code&gt;git@github.com:vimberlin/vimberlin.de.git&lt;/code&gt;. This will mark the remote URL as an SSH path.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://www.hagenburger.net/&quot; title=&quot;Nico Hagenburger&quot;&gt;&lt;strong&gt;Nico Hagenburger&lt;/strong&gt;&lt;/a&gt; for reading an earlier draft of this post. He is working actually on &lt;a href=&quot;http://livingstyleguide.org/&quot;&gt;livingstyleguide.org&lt;/a&gt; - a way to easily create living style guides with Markdown, Sass/SCSS and Compass for your Rails or Sinatra application.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Deploying Padrino Applications On Heroku</title>
      <id>http://wikimatze.de/deploying-padrino-applications-on-heroku</id>
      <link href="http://wikimatze.de/deploying-padrino-applications-on-heroku"/>
      <published>2014-03-13T00:00:00+00:00</published>
      <updated>2014-03-13T00:00:00+00:00</updated>
      <category term="ruby"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article is part of an ongoing series about my exploration of the Padrino web framework. If you want to read more
about it please check out &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook.com&lt;/a&gt;. You sniff around in the sources of the book under
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;I was always asking myself how I can use cloud services like &lt;a href=&quot;http://www.heroku.com/&quot;&gt;heroku&lt;/a&gt; to deploy Padrino applications without having an own server.&lt;/p&gt;

&lt;p&gt;In this post I&amp;#39;m going to show you how you can a simple &amp;quot;Hello Padrino&amp;quot; app on heroku - ones without and ones with database interactions.&lt;/p&gt;

&lt;p&gt;(Note: This post is tested with &lt;a href=&quot;http://www.padrinorb.com/blog/padrino-0-12-0-activesupport-4-rewritten-reloader-smarter-rendering-and-loads-more&quot;&gt;padrino 0.12.0&lt;/a&gt;, and &lt;a href=&quot;https://github.com/heroku/toolbelt/commit/d0fc05d6bf53b57505c1e9d9caa671ae57c357e3&quot;&gt;heroku-toolbelt/3.4.1&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;Installing Heroku&lt;/h2&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gem install heroku
Fetching: heroku-3.4.2.gem &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;100%&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
 !    The &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;heroku&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; gem has been deprecated and replaced with the Heroku Toolbelt.
 !    Download and install from: https://toolbelt.heroku.com
 !    For API access, see: https://github.com/heroku/heroku.rb
Successfully installed heroku-3.4.2
Parsing documentation &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;heroku-3.4.2
Installing ri documentation &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;heroku-3.4.2
Done installing documentation &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;heroku after 1 seconds
1 gem installed
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Hmm, the method above is working but I highly recommend you to follow the installations instructions from &lt;a href=&quot;https://toolbelt.heroku.com/&quot;&gt;toolbelt.heroku.com&lt;/a&gt; page:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To check if everything went well, you can run the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;heroku version
heroku-toolbelt/3.4.1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;i686-linux&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; ruby/1.9.3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Hello World&lt;/h2&gt;

&lt;p&gt;Creating a new app:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;padrino generate project hello-world-heroku
    create
    create  .gitignore
    create  config.ru
    create  config/apps.rb
    create  config/boot.rb
    create  public/favicon.ico
    create  public/images
    create  public/javascripts
    create  public/stylesheets
    create  tmp
    create  .components
    create  app
    create  app/app.rb
    create  app/controllers
    create  app/helpers
    create  app/views
    create  app/views/layouts
    create  Gemfile
    create  Rakefile
  skipping  orm component...
  skipping  &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;component...
  skipping  mock component...
  skipping  script component...
  applying  slim &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;renderer&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;...
     apply  renderers/slim
    insert  Gemfile
  skipping  stylesheet component...
 identical  .components
     force  .components
     force  .components

&lt;span class=&quot;o&quot;&gt;=================================================================&lt;/span&gt;
hello-world-heroku is ready &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;development!
&lt;span class=&quot;o&quot;&gt;=================================================================&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ./hello-world-heroku
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;bundle
&lt;span class=&quot;o&quot;&gt;=================================================================&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The next part is to create a route in &lt;code&gt;app/app.rb&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;HelloWorldHeroku&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Application&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;Hello Padrino On Heroku&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next, you need to setup your account on &lt;a href=&quot;https://id.heroku.com/login&quot;&gt;heroku.com&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm3.staticflickr.com/2236/13108475564_1a87877ac2_o.png&quot; title=&quot;Hello Padrino on heroku&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2236/13108475564_a455e8599e_c.jpg&quot; class=&quot;center&quot; alt=&quot;Hello Padrion on heroku&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next you need to click on &amp;quot;Create a new app&amp;quot;:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7433/13108475924_98cc833ac7_o.png&quot; title=&quot;New App On Heroku&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7433/13108475924_46d0af5eaa_c.jpg&quot; class=&quot;center&quot; alt=&quot;New App On Heroku&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Initialize an empty git repository, make an initial commit, and add the heroku remote:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;hello-world-heroku
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git init &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git add . &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit -m &lt;span class=&quot;s2&quot;&gt;&quot;Initial commit&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git remote add heroku git@heroku.com:hello-world-padrino.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://farm3.staticflickr.com/2332/13108476374_7870beaf76_c.jpg&quot; title=&quot;The Path You Need&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm3.staticflickr.com/2332/13108476374_601991fd40_o.png&quot; class=&quot;center&quot; alt=&quot;The Path You Need&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When everything is setup in the right way, you need to push:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git push --set-upstream heroku master
  Initializing repository, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  Counting objects: 15, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  Delta compression using up to 4 threads.
  Compressing objects: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;13/13&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  Writing objects: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;15/15&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 7.88 KiB | 0 bytes/s, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  Total 15 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, reused 0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

  -----&amp;gt; Ruby app detected
  -----&amp;gt; Compiling Ruby/Rack
  -----&amp;gt; Using Ruby version: ruby-2.0.0
  -----&amp;gt; Installing dependencies using 1.5.2
         New app detected loading default bundler cache
         Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
         Fetching gem metadata from https://rubygems.org/.........
         Fetching additional metadata from https://rubygems.org/..
         Using minitest &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4.7.5&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using i18n &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.6.9&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using rake &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;10.1.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using atomic &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.1.14&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using tzinfo &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.3.38&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using multi_json &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.8.4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using mime-types &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.25.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using rack &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.5.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using tilt &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.4.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using bundler &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.5.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing polyglot &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.3.3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using thread_safe &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.1.3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing thor &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.17.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing url_mount &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.2.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using treetop &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.4.15&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing temple &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.6.7&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing moneta &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.7.20&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Using mail &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.5.4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing rack-protection &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.5.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing http_router &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.11.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing slim &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.0.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing activesupport &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4.0.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing sinatra &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.4.4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing padrino-core &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing padrino-helpers &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing padrino-mailer &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing padrino-cache &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing padrino-admin &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing padrino-gen &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Installing padrino &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Your bundle is &lt;span class=&quot;nb&quot;&gt;complete&lt;/span&gt;!
         Gems &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the groups development and &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;were not installed.
         It was installed into ./vendor/bundle
         Bundle completed &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;13.40s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Cleaning up the bundler cache.
  -----&amp;gt; Writing config/database.yml to &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;from DATABASE_URL
  -----&amp;gt; WARNINGS:
         You have not declared a Ruby version &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;your Gemfile.
         To &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;your Ruby version add this line to your Gemfile:
         ruby &lt;span class=&quot;s1&quot;&gt;&#39;2.0.0&#39;&lt;/span&gt;
         &lt;span class=&quot;c&quot;&gt;# See https://devcenter.heroku.com/articles/ruby-versions for more information.&lt;/span&gt;
  -----&amp;gt; Discovering process types
         Procfile declares types -&amp;gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;none&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
         Default types &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;Ruby  -&amp;gt; console, rake, web

  -----&amp;gt; Compressing... &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;, 15.3MB
  -----&amp;gt; Launching... &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;, v4
         http://hello-world-padrino.herokuapp.com/ deployed to Heroku

  To git@heroku.com:hello-world-padrino.git
   &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;new branch]      master -&amp;gt; master
  Branch master &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;up to track remote branch master from heroku.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you now call &lt;a href=&quot;http://hello-world-padrino.herokuapp.com/&quot;&gt;hello-world-herokuapp.com&lt;/a&gt; you can see it and your done.&lt;/p&gt;

&lt;p&gt;You can find the code for this application on &lt;a href=&quot;https://github.com/wikimatze/padrino-hello-world-heroku&quot;&gt;GitHub padrino-hello-world-heroku&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Database Deployments With Heroku&lt;/h2&gt;

&lt;p&gt;Let&amp;#39;s create a new application:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;padrino g project hello-world-heroku-postgres -d activerecord -a postgres
    create
    create  .gitignore
    create  config.ru
    create  config/apps.rb
    create  config/boot.rb
    create  public/favicon.ico
    create  public/images
    create  public/javascripts
    create  public/stylesheets
    create  tmp
    create  .components
    create  app
    create  app/app.rb
    create  app/controllers
    create  app/helpers
    create  app/views
    create  app/views/layouts
    create  Gemfile
    create  Rakefile
  applying  activerecord &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;orm&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;...
     apply  orms/activerecord
    insert  Gemfile
    insert  Gemfile
    insert  app/app.rb
    create  config/database.rb
  skipping  &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;component...
  skipping  mock component...
  skipping  script component...
  applying  slim &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;renderer&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;...
     apply  renderers/slim
    insert  Gemfile
  skipping  stylesheet component...
 identical  .components
     force  .components
     force  .components

&lt;span class=&quot;o&quot;&gt;=================================================================&lt;/span&gt;
hello-world-heroku-postgres is ready &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;development!
&lt;span class=&quot;o&quot;&gt;=================================================================&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ./hello-world-heroku-postgres
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;bundle
&lt;span class=&quot;o&quot;&gt;=================================================================&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Go to your app and select under &amp;quot;Resources&amp;quot; the &amp;quot;Get Add-ons&amp;quot; link and chose the &amp;quot;Heroku Postgres&amp;quot; addon with the help:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7410/13108187085_822c646670_o.png&quot; title=&quot;Padrino On Heroku with Postgres&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7410/13108187085_59733ee3ab_c.jpg&quot; class=&quot;center&quot; alt=&quot;Padrino On Heroku with Postgres&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also run the following command which does the same:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;heroku addons:add heroku-postgresql

Adding heroku-postgresql on hello-world-heroku-postgres... &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;, v3 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;free&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Attached as HEROKU_POSTGRESQL_TEAL_URL
Database has been created and is available
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pgbackups:restore.
Use &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;heroku addons:docs heroku-postgresql&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; to view documentation.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Hmmm, let&amp;#39;s go into the help:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;heroku addons:docs heroku-postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will open the URL &lt;a href=&quot;https://devcenter.heroku.com/articles/heroku-postgresql&quot;&gt;https://devcenter.heroku.com/articles/heroku-postgresql&lt;/a&gt;. Calling:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;heroku config | grep HEROKU_POSTGRESQL
HEROKU_POSTGRESQL_TEAL_URL: postgres://yxkscmfxkhsvfd:hnGMVRPWmBQ06Bi3ujqP21Orl4@ec2-79-125-21-60.eu-west-1.compute.amazonaws.com:5432/dev751q4jd401b
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;gives us the host URL, the user, the port, as well as the password. You can get the same information under the URL &lt;a href=&quot;https://postgres.heroku.com/databases&quot;&gt;https://postgres.heroku.com/databases&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since we now have the information about our database, it&amp;#39;s time to edit &lt;code&gt;config/database.rb&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;configurations&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:production&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&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;ss&quot;&gt;:adapter&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;postgresql&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:database&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;dev751q4jd401b&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:username&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;yxkscmfxkhsvfd&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:password&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;hnGMVRPWmBQ06Bi3ujqP21Orl4&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:host&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;ec2-79-125-21-60.eu-west-1.compute.amazonaws.com&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:port&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5432&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;Now, it&amp;#39;s time to push our app on heroku:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git push heroku master
Initializing repository, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
Counting objects: 22, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
Delta compression using up to 4 threads.
Compressing objects: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;20/20&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
Writing objects: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;22/22&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 9.43 KiB | 0 bytes/s, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
Total 22 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, reused 0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Ruby app detected
&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Compiling Ruby/Rack
&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Using Ruby version: ruby-2.0.0
&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Installing dependencies using 1.5.2
       New app detected loading default bundler cache
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Fetching gem metadata from https://rubygems.org/.........
       Fetching additional metadata from https://rubygems.org/..
       Using rake &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;10.1.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using i18n &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.6.9&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using minitest &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4.7.5&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using tzinfo &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.3.38&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using builder &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;3.1.4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using activerecord-deprecated_finders &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.0.3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using arel &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4.0.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using rack &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.5.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using mime-types &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.25.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using polyglot &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.3.4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using tilt &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.4.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing thor &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.17.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using bundler &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.5.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using pg &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.17.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing multi_json &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.9.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing url_mount &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.2.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing moneta &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.7.20&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using treetop &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.4.15&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing temple &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.6.7&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Using mail &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.5.4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing atomic &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.1.15&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing rack-protection &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.5.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing slim &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2.0.2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing http_router &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.11.1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing sinatra &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1.4.4&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing thread_safe &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.2.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing activesupport &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4.0.3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing activemodel &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4.0.3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing padrino-core &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing padrino-mailer &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing padrino-gen &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing padrino-helpers &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing activerecord &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;4.0.3&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing padrino-cache &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing padrino-admin &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Installing padrino &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.12.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Your bundle is &lt;span class=&quot;nb&quot;&gt;complete&lt;/span&gt;!
       Gems &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the groups development and &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;were not installed.
       It was installed into ./vendor/bundle
       Bundle completed &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;18.14s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Cleaning up the bundler cache.
&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Writing config/database.yml to &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;from DATABASE_URL
&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;WARNINGS:
       You have not declared a Ruby version &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;your Gemfile.
       To &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;your Ruby version add this line to your Gemfile:
       ruby &lt;span class=&quot;s1&quot;&gt;&#39;2.0.0&#39;&lt;/span&gt;
       &lt;span class=&quot;c&quot;&gt;# See https://devcenter.heroku.com/articles/ruby-versions for more information.&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Discovering process types
       Procfile declares types -&amp;gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;none&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       Default types &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;Ruby  -&amp;gt; console, rake, web

&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Compressing... &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;, 16.1MB
&lt;span class=&quot;gp&quot;&gt;-----&amp;gt; &lt;/span&gt;Launching... &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;, v6
       http://hello-world-heroku-postgres.herokuapp.com/ deployed to Heroku

To git@heroku.com:hello-world-heroku-postgres.git
 &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;new branch]      master -&amp;gt; master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now let&amp;#39;s create a model:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;padrino g model users name:string email:text
   apply  orms/activerecord
  create  models/users.rb
  create  db/migrate/001_create_users.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Before pushing our changes we need to run the migrations:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;heroku run rake db:migrate
Running &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;rake db:migrate&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; attached to terminal... up, run.1057
&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;  CreateUsers: migrating &lt;span class=&quot;o&quot;&gt;====================================================&lt;/span&gt;
-- create_table&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;:users&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
   -&amp;gt; 0.0234s
&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;  CreateUsers: migrated &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0.0236s&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;
&lt;p&gt;Now we need to create some data with the following query:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;INSERT INTO users &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;name, email&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; VALUES &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;Matthias&#39;&lt;/span&gt;, &lt;span class=&quot;s1&quot;&gt;&#39;matthias@wikimatze.de&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next we need to edit our view &lt;code&gt;app/app.rb&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;HelloWorldHeroku&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Application&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Users&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;Hello &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; Your email is: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After pushing the changes, you can call &lt;a href=&quot;http://hello-world-heroku-postgres.herokuapp.com&quot;&gt;http://hello-world-heroku-postgres.herokuapp.com&lt;/a&gt; and see the lovely output.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Making Firefox as Fast as Chrome</title>
      <id>http://wikimatze.de/making-firefox-as-fast-as-chrome</id>
      <link href="http://wikimatze.de/making-firefox-as-fast-as-chrome"/>
      <published>2013-12-05T00:00:00+00:00</published>
      <updated>2013-12-05T00:00:00+00:00</updated>
      <category term="chrome"/>
      <content type="html">&lt;p&gt;&lt;em&gt;Learn in this article how you can make Firefox as fast as Chrome again.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I can remember that in the past some coworker says to me: &amp;quot;Why are you using Firefox and not the faster Chrome?&amp;quot; Hmm, I have always been using Firefox and never saw a reason why to use another browser. But I installed Chrome, it feels faster, and it consumes less CPU and memory of my system. The ecosystem and the look and feel is typical for a Google product: It works, is intuitive, and you know it works. It is not difficult to sync your bookmarks, settings, prefill forms, and even passwords =&amp;gt; just everybody has nowadays a &lt;a href=&quot;https://mail.google.com&quot;&gt;gmail&lt;/a&gt; account and this is how all the magic works.&lt;/p&gt;

&lt;p&gt;But being a German, it always felt wrong to send Google information about my web experience, which buttons I press, what plugins I use and so on. Since I&amp;#39;m a big Vim fan I heard of a plugin called &lt;a href=&quot;https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en&quot;&gt;Vimium&lt;/a&gt; which enables keyboard shortcuts for navigating webpages without using the mouse, I installed it but was not really happy with it because it hasn&amp;#39;t all the shortcuts I really want and it was difficult to create custom mappings, as well as handling bookmarks. Than during a &lt;a href=&quot;http://vimberlin.de/&quot;&gt;vimberlin meetup&lt;/a&gt; I saw &lt;a href=&quot;https://twitter.com/andrewradev&quot;&gt;@andrewradev&lt;/a&gt; using &lt;a href=&quot;http://www.vimperator.org/vimperator&quot;&gt;Vimperator&lt;/a&gt; and it was a blast: He was very fast and doing all the things I wanted but never could do with Vimium. That was a turning point to give Firefox a new chance. I spent one weekend to learn most of Vimperators shortcuts and create a &lt;em&gt;vimperatorrc&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;But than came the release of &lt;a href=&quot;http://xubuntu.org/news/saucy-salamander-final/&quot;&gt;Xubuntu 13.10&lt;/a&gt; and I installed a fresh new system ...&lt;/p&gt;

&lt;h2&gt;Slow Firefox&lt;/h2&gt;

&lt;p&gt;After everything was installed and I was ready to use the new system. Starting Firefox was a nightmare, everything is slow. Thanks to my friend &lt;a href=&quot;https://twitter.com/jcavena&quot;&gt;@jcavena&lt;/a&gt; from Kansas City - he gave me starting point to solve this issue and not spending more hours on it:&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p&gt;&lt;a href=&quot;https://twitter.com/wikimatze&quot;&gt;@wikimatze&lt;/a&gt; how many plugins on Firefox vs chrome?&lt;/p&gt;&amp;mdash; JC (@jcavena) &lt;a href=&quot;https://twitter.com/jcavena/statuses/392387457745821696&quot;&gt;October 21, 2013&lt;/a&gt;&lt;/blockquote&gt;

&lt;script async src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;I didn&amp;#39;t had any plugins, only the basic installation with the default settings. I spend the evening fiddling around with the settings, tried this and that, checked my Internet connection, but all what I did was senseless. Firefox was loading 2000 times slower than Chrome. But don&amp;#39;t give up in such situations, just clear your mind and think about what you want solve.&lt;/p&gt;

&lt;h2&gt;Fast Firefox&lt;/h2&gt;

&lt;p&gt;I stick around the Internet and found the &lt;code&gt;about:config&lt;/code&gt; setting in Firefox (it&amp;#39;s nearly the same when you call the &lt;code&gt;chrome://settings/&lt;/code&gt; URL in Chrome but has more options). This is the place where you can change security, stability, and performance. That what I was searching for and this is the place you can&amp;#39;t find in the normal graphical settings of Firefox. There you can see a list preferences names with either &lt;code&gt;string&lt;/code&gt;, &lt;code&gt;integer&lt;/code&gt;, or &lt;code&gt;boolean&lt;/code&gt; values. Than I stumbled upon the &lt;code&gt;network.dns.disableIPv6&lt;/code&gt; option. There is an error in IPv6-capable DNS servers where an IPv4 address is returned although an IPv6 was requested. Firefox can recover from this error but due to lack of performance. So my solution was to setting this option to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Reduce Firefox Memory and Cache Usage&lt;/h3&gt;

&lt;p&gt;Next, create the &lt;a href=&quot;http://kb.mozillazine.org/Config.trim_on_minimize&quot; title=&quot;config.trim_on_minimize&quot;&gt;config.trim&lt;em&gt;on&lt;/em&gt;minimize&lt;/a&gt;
as a boolean value and set it&amp;#39;s value to true. This will swap out memory when the program is minimized.&lt;/p&gt;

&lt;p&gt;If you have enough memory, you can set the &lt;a href=&quot;http://kb.mozillazine.org/Browser.cache.disk.enable&quot; title=&quot;browser.cache.disk.enable&quot;&gt;browser.cache.disk.enable&lt;/a&gt; and the &lt;a href=&quot;http://kb.mozillazine.org/Browser.cache.memory.enable&quot; title=&quot;browser.cache.memory.enable&quot;&gt;browser.cache.memory.enable&lt;/a&gt; value to false.&lt;/p&gt;

&lt;h3&gt;Pipelining&lt;/h3&gt;

&lt;p&gt;Set the values of &lt;a href=&quot;http://kb.mozillazine.org/Network.http.pipelining&quot;&gt;network.http.pipelining&lt;/a&gt; and &lt;a href=&quot;http://kb.mozillazine.org/Network.http.proxy.pipelining&quot;&gt;network.http.proxy.pipelining&lt;/a&gt; to true. Next set the value &lt;a href=&quot;http://kb.mozillazine.org/Network.http.pipelining.maxrequests&quot;&gt;network.http.pipelining.maxrequests&lt;/a&gt; to 8. This in combination with the pipelining options, Firefox will send 8 requests to a page and this results in a faster load of the page.&lt;/p&gt;

&lt;p&gt;Create the new value &lt;a href=&quot;http://kb.mozillazine.org/Nglayout.initialpaint.delay&quot;&gt;nglayout.initialpaint.delay&lt;/a&gt; with the value of 0. This will load a page initially but take longer till the whole page is rendered. Normally, Firefox renders web pages incrementally, it displays what&amp;#39;s been received before the entire page has been downloaded.&lt;/p&gt;

&lt;h3&gt;Fast Rendering&lt;/h3&gt;

&lt;p&gt;Create the new value &lt;a href=&quot;http://kb.mozillazine.org/Content.notify.interval&quot;&gt;content.notify.interval&lt;/a&gt; to 500000. This preference specifies the minimum amount of time to wait between reflows to 1/2 of a second. Lowering the interval will lower the perceived page loading time but increase the total loading time. To make use of the content.notify.interval setting you need to add the boolean setting &lt;a href=&quot;http://kb.mozillazine.org/Content.notify.ontimer&quot;&gt;content.notify.ontime&lt;/a&gt; to true. This means that pages are not reflowed at an interval any higher than that specified by the content.notify.interval.&lt;/p&gt;

&lt;h3&gt;Frequency Mode&lt;/h3&gt;

&lt;p&gt;Create the new value &lt;a href=&quot;http://kb.mozillazine.org/Content.switch.threshold&quot;&gt;content.switch.threshold&lt;/a&gt; and set it to 250000. When a page is loaded, there is a high frequency and low frequency level. The high frequency mode is active when the user moves the mouse or uses the keyboard - so it allows higher UI responsiveness. On the other hand, the low frequency mode is on, when the user is reading the page. Raising the value will make the application more responsive at the expense of page load time. In order to make use of this option, you need to create the new value &lt;a href=&quot;http://kb.mozillazine.org/Content.interrupt.parsing&quot;&gt;content.interrupt.parsing&lt;/a&gt; and set it to false. Parsing a page will not be interrupted by user and the page is loaded faster. But that means, that the application is unresponsive until the parsing the site is complete.&lt;/p&gt;

&lt;h3&gt;Session History Entries&lt;/h3&gt;

&lt;p&gt;Set the &lt;code&gt;browser.sessionhistory.max_entries&lt;/code&gt; to 5 - you won&amp;#39;t surf more than 5 of the websites we previously surfed before, and there is really no need to store more than that in the session.&lt;/p&gt;

&lt;h3&gt;Increase Page Loading&lt;/h3&gt;

&lt;p&gt;Next, create the new value &lt;a href=&quot;http://kb.mozillazine.org/Nglayout.initialpaint.delay&quot; title=&quot;nglayout.initialpaint.delay&quot;&gt;nglayout.initialpaint.delay&lt;/a&gt;, chose a new integer type and set the value to 0. This will speed up page loading by intentionally telling Firefox to avoid waiting during certain parts of page loading.&lt;/p&gt;

&lt;h2&gt;Further Improvements&lt;/h2&gt;

&lt;p&gt;The following improvements are based on &lt;a href=&quot;http://www.gheorghesarcov.ga/&quot; title=&quot;Gheorghe Sarcov&quot;&gt;Gheorghe Sarcov&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;browser.display.show_image_placeholders&lt;/code&gt; to false - this stops the display of placeholders while images are loading to speed up the page&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;browser.tabs.animate&lt;/code&gt; to false - this disables all tab animation features (e.g.  when you click the ‘New Tab’ (+) button) to make the tab interface feel quicker.&lt;/li&gt;
&lt;li&gt;Set &lt;a href=&quot;http://kb.mozillazine.org/Network.prefetch-next&quot; title=&quot;network.prefetch-next&quot;&gt;network.prefetch-next&lt;/a&gt; to true - this setting can automatically prefetch (load) the contents of pages linked to by the page you are viewing e.g. to load the homepage in the background, making it quicker for you to view next if you want to.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;There is not the perfect setup here for everyone. You can type in &lt;code&gt;about:cache?device=memory&lt;/code&gt; and see your current number of entries, maximum storage size, storage in use and inactive storage. Chrome make better use of a modern multi-core CPU, as described under &lt;a href=&quot;http://www.howtogeek.com/165264/heres-why-firefox-is-still-years-behind-google-chrome/&quot; title=&quot;howtogeek.com&quot;&gt;howtogeek.com&lt;/a&gt; - where Firefox uses a single-process architecture.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.davidtan.org/tips-reduce-firefox-memory-cache-usage/&quot; title=&quot;Reduce Firefox Memory and Cache Usage&quot;&gt;Reduce Firefox Memory and Cache Usage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.makeuseof.com/tag/switching-from-chrome-make-firefox-feel-like-home/&quot; title=&quot;Switching From Chrome: How to Make Firefox Feel Like Home&quot;&gt;Switching From Chrome: How to Make Firefox Feel Like Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.makeuseof.com/tag/best-firefox-addons/&quot; title=&quot;Best Firefox Addons&quot;&gt;Best Firefox Addons&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Browsing Padrino's Code Base With Ctags in Vim</title>
      <id>http://wikimatze.de/browsing-padrinos-codebase-with-ctags-in-vim</id>
      <link href="http://wikimatze.de/browsing-padrinos-codebase-with-ctags-in-vim"/>
      <published>2013-10-17T00:00:00+00:00</published>
      <updated>2013-10-17T00:00:00+00:00</updated>
      <category term="vim"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article is part of an ongoing series about my exploration of the Padrino web framework. If you want to read more
about it please check out &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook.com&lt;/a&gt;. You sniff around in the sources of the book under
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;Working effectively with ctags has been a topic I avoided for a long time because I was too lazy to invest the time to learn about it.&lt;/p&gt;

&lt;p&gt;I was working on my application and needed to constantly consult &lt;a href=&quot;http://www.padrinorb.com/api/index.html&quot;&gt;Padrino&amp;#39;s API docs&lt;/a&gt; in the browser. It would have been more effective if I could do the searching directly in &lt;a href=&quot;https://github.com/padrino/padrino-framework&quot;&gt;Padrino&amp;#39;s code&lt;/a&gt;. Even better would be if I didn&amp;#39;t have to leave the terminal and could stay in the flow of coding. It&amp;#39;s possible with &lt;code&gt;ctags&lt;/code&gt;!&lt;/p&gt;

&lt;h2&gt;What is ctags&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://ctags.sourceforge.net/&quot; title=&quot;ctags&quot;&gt;Ctags&lt;/a&gt; is a tool which make it easy for you to shift rapidly through code.  It does this by indexing classes, methods, variables and other things. All this information is stored in a &lt;code&gt;tags&lt;/code&gt; file - one line in this file contains one tag.&lt;/p&gt;

&lt;p&gt;Ctags is the tool to browse a large code base like &lt;a href=&quot;http://www.padrinorb.com/&quot; title=&quot;Padrino&quot;&gt;Padrino&lt;/a&gt;, where you might not know the project layout and class/method definitions.  Being able to jump forward and backward between variables, classes, modules, and methods is essential in getting to know a code base.&lt;/p&gt;

&lt;h2&gt;Installing ctags&lt;/h2&gt;

&lt;p&gt;Depending on your operation system, you can install it on Ubuntu/Debian with the following packages:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install exuberant-ctags
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Why I&amp;#39;m installing &lt;code&gt;exuberant-ctags&lt;/code&gt; instead of &lt;code&gt;ctags&lt;/code&gt;? &lt;em&gt;Ctags&lt;/em&gt; was originally written by &lt;a href=&quot;http://en.wikipedia.org/wiki/Ken_Arnold&quot; title=&quot;Ken Arnold&quot;&gt;Ken Arnold&lt;/a&gt; (the author of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Rogue_%28video_game%29&quot; title=&quot;Rogue video game&quot;&gt;&amp;quot;Rogue video game&amp;quot;&lt;/a&gt;) and was first introduced in &lt;em&gt;BSD Unix&lt;/em&gt;. &lt;em&gt;Exuberant ctags&lt;/em&gt; is a variant of &lt;code&gt;ctags&lt;/code&gt; and was distributed with &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/version6.html#ctags-gone&quot; title=&quot;Vim 6.0&quot;&gt;Vim 6.0&lt;/a&gt;. The main benefit of &lt;em&gt;exuberant ctags&lt;/em&gt; is that it support over 40 languages and has regular expression support which make it easier to create your own &lt;a href=&quot;http://ctags.sourceforge.net/EXTENDING.html&quot; title=&quot;Exuberant ctags language parser&quot;&gt;custom language parser&lt;/a&gt; for creating the &lt;code&gt;tags&lt;/code&gt; file. The &lt;code&gt;tags&lt;/code&gt; contains the collected information about the things you want to know.&lt;/p&gt;

&lt;h2&gt;Generating ctags for the Padrino&amp;#39;s code base&lt;/h2&gt;

&lt;p&gt;Clone &lt;a href=&quot;https://github.com/padrino/padrino-framework&quot;&gt;Padrino&lt;/a&gt; and run the following command at the root of the project:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git clone https://github.com/padrino/padrino-framework
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;padrino-framework
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ctags -R .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The command will run recursively through the directory and will tag all sources and files it can find. During running the &lt;code&gt;ctags -R .&lt;/code&gt; command I got the following error:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;ctags: Warning: ignoring null tag &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Okay, we are actually interested in all the things, except &lt;a href=&quot;https://en.wikipedia.org/wiki/JavaScript&quot; title=&quot;Javascript&quot;&gt;JavaScript&lt;/a&gt;. Let&amp;#39;s exclude those files with the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;    &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ctags -R --exclude&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;*.js&quot;&lt;/span&gt; .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you are done with the command, you have a &lt;code&gt;tags&lt;/code&gt; file created in the current directory. Let&amp;#39;s open the generated &lt;code&gt;tags&lt;/code&gt; file and try to understand the basic nature of the file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;    &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_TAG_FILE_FORMAT&lt;/span&gt;   &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extended&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;will&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;append&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; to lines/
    !_TAG_FILE_SORTED   1   /0=unsorted, 1=sorted, 2=foldcase/
    !_TAG_PROGRAM_AUTHOR    Darren Hiebert  /dhiebert@users.sourceforge.net/
    !_TAG_PROGRAM_NAME  Exuberant Ctags //
    !_TAG_PROGRAM_URL   http://ctags.sourceforge.net    /official site/
    !_TAG_PROGRAM_VERSION   5.9~svn20110310 //
    &amp;lt;&amp;lt;  padrino-core/lib/padrino-core/logger.rb /^    def &amp;lt;&amp;lt;(message = nil)$/;&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mounter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;    &lt;span class=&quot;sr&quot;&gt;/^    def ==(other)$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; f   class:Padrino.Mounter
    AbstractFormBuilder padrino-helpers/lib/padrino-helpers/form_builder/abstract_form_builder.rb   /^      class AbstractFormBuilder # @private$/;&quot;&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;   &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Helpers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;FormBuilder&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;AbstractHandler&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;helpers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;helpers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;output_helpers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;abstract_handler&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;  &lt;span class=&quot;sr&quot;&gt;/^      class AbstractHandler$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;   c   class:Padrino.Helpers.OutputHelpers
    AccessControl   padrino-admin/lib/padrino-admin/access_control.rb   /^    module AccessControl$/;&quot;&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;   &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Admin&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;AccessControlError&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;access_control&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;   &lt;span class=&quot;sr&quot;&gt;/^    class AccessControlError &amp;lt; StandardError # @private$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;   c   class:Padrino.Admin
    Account padrino-admin/test/fixtures/data_mapper.rb  /^class Account$/;&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;Actions&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;   &lt;span class=&quot;sr&quot;&gt;/^      module Actions$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;  m   class:Padrino.Generators.Admin
    ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The header of each tag file gives you basic information about the creation of the file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;    &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_TAG_FILE_FORMAT&lt;/span&gt;   &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extended&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;will&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;append&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; to lines/
    !_TAG_FILE_SORTED   1   /0=unsorted, 1=sorted, 2=foldcase/
    !_TAG_PROGRAM_AUTHOR    Darren Hiebert  /dhiebert@users.sourceforge.net/
    !_TAG_PROGRAM_NAME  Exuberant Ctags //
    !_TAG_PROGRAM_URL   http://ctags.sourceforge.net    /official site/
    !_TAG_PROGRAM_VERSION   5.9~svn20110310 //
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, the tags are sorted, folded, and you can see the version of ctags in which they were created.  If you take a look close in the example above, you can see detect a tag name schema: Let&amp;#39;s consider our first tag:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/^    def &amp;lt;&amp;lt;(message = nil)$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; f
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;First of all you have the &lt;strong&gt;tagname&lt;/strong&gt; &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt;, then a tab as separator (it isn&amp;#39;t visible in the code examples above), then &lt;strong&gt;tagfile&lt;/strong&gt; &lt;code&gt;padrino-core/lib/padrino-core/logger.rb&lt;/code&gt; where the tag can be found, followed by a tab, and finally the &lt;strong&gt;tagaddress&lt;/strong&gt; the exact location of the tag inside the &lt;em&gt;tagfile&lt;/em&gt;. The &lt;strong&gt;tagaddress&lt;/strong&gt; is a regular expression - the special characters in a search pattern are &lt;code&gt;^&lt;/code&gt; (begin-of-line) and &lt;code&gt;$&lt;/code&gt; (indicates the end of the line). Finally a &lt;strong&gt;term&lt;/strong&gt; marked with &lt;code&gt;;&amp;quot;&lt;/code&gt; which indicates if the tag is either a class (&lt;code&gt;c&lt;/code&gt;), module (&lt;code&gt;m&lt;/code&gt;), or function (&lt;code&gt;f&lt;/code&gt;). The &lt;em&gt;term&lt;/em&gt; may differ for which language constructs you are going to create your tags.&lt;/p&gt;

&lt;h2&gt;Jumping into our first tag&lt;/h2&gt;

&lt;p&gt;Let&amp;#39;s open the &lt;code&gt;padrino-core/lib/padrino-core.rb&lt;/code&gt; file and place your cursor on &lt;code&gt;server&lt;/code&gt; on line 13:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;sinatra/base&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/version&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/support_lite&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/application&#39;&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/caller&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/command&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/loader&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/logger&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/mounter&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/reloader&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/router&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/server&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/tasks&#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-core/module&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# The Padrino environment (falls back to the rack env or finally develop)&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;PADRINO_ENV&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;PADRINO_ENV&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;RACK_ENV&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;development&quot;&lt;/span&gt;  &lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defined?&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;PADRINO_ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# The Padrino project root path (falls back to the first caller)&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;PADRINO_ROOT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;PADRINO_ROOT&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;dirname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;first_caller&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defined?&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;PADRINO_ROOT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Padrino&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now press &lt;code&gt;&amp;lt;C-]&amp;gt;&lt;/code&gt;- you&amp;#39;ll directly to the &lt;code&gt;Server&lt;/code&gt; class in the &lt;code&gt;padrino-core/lib/padrino-core/server.rb&lt;/code&gt; file. Awesome,
that is what you know now what you want to know and you can jump back to your previous position with &lt;code&gt;&amp;lt;C-o&amp;gt;&lt;/code&gt; or
&lt;code&gt;&amp;lt;C-t&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can also jump to the tag you want the command line mode in Vim and use the &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/tagsrch.html#:tag&quot; title=&quot;Vim :tag&quot;&gt;:tag&lt;/a&gt; command. Type in the name of the class or method you want to jump to. For example, if you type in &lt;code&gt;:tag Padrino&lt;/code&gt; you will jump to a tag. But you already have a suspicion that &lt;code&gt;Padrino&lt;/code&gt; exists in more than one file. You may think this is a mistake but ctags keeps up a list of all the tags you have explored so far.&lt;/p&gt;

&lt;p&gt;If you searched after &lt;code&gt;:tag Padrino&lt;/code&gt; again you can message line beyond in your command window: &lt;code&gt;tag 1 of 81 or more&lt;/code&gt;.  There are 81 searchable matchings tags available. Per default Vim will take the first matching tag if your search for the first time in your vim session after &lt;code&gt;:tag Padrino&lt;/code&gt;. Use &lt;code&gt;:tselect&lt;/code&gt; followed by a number to jump to the tag you want:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;  &lt;span class=&quot;c1&quot;&gt;# pri kind tag               file&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;F&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;C&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;    &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;           &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;
               &lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Padrino&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;F&lt;/span&gt;   &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;    &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;           &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;access_control&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;
               &lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Padrino&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;F&lt;/span&gt;   &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;    &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;           &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;actions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;
               &lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Padrino&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;F&lt;/span&gt;   &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;    &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;           &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin_app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;
               &lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Padrino&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;F&lt;/span&gt;   &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;    &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;           &lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;admin_page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rb&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can chose what you want to have. There a bunch of more commands you can use to navigate multiple tags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:tnext (or :tn)&lt;/code&gt; - Goes to the next tag in the &lt;code&gt;:tselect&lt;/code&gt; list.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:tprev (or :tp)&lt;/code&gt; - Goes to the previous tag in the &lt;code&gt;:tselect&lt;/code&gt; list.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:tfirst (or :tf)&lt;/code&gt; - Goes to the first tag in the &lt;code&gt;:tselect&lt;/code&gt; list.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:tlast (or :tl)&lt;/code&gt; - Goes to the last tag in the &lt;code&gt;:tselect&lt;/code&gt; list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before going to add the tags for the Padrino project as well as any other sources you are using on your project, we need to understand how we can get a big tag file of all our installed gems and after that limit our scope to these parts we only need.&lt;/p&gt;

&lt;h2&gt;Ctag for installed gems&lt;/h2&gt;

&lt;p&gt;Let&amp;#39;s say you are using &lt;a href=&quot;https://github.com/sstephenson/rbenv&quot; title=&quot;rbenv&quot;&gt;rbenv&lt;/a&gt; to manage your ruby versions and you want to get a global tag file of all your installed gems. Please run the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ctags -R -f gems.tag &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; ~/.rbenv/versions/&amp;lt;your-ruby-version&amp;gt;/lib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I have over 269 installed gems on my system (use &lt;code&gt;gem list | wc -l&lt;/code&gt;) and it took around 7 seconds to generate a tag file with over 200.000 lines. The chances are high that you have errors in your &lt;code&gt;tags&lt;/code&gt; file occur and I really don&amp;#39;t want to load such a big tag file into my vim session. Please note, that the generated tag file &lt;code&gt;gems.tag&lt;/code&gt; instead of &lt;code&gt;tags&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Generating Ctags project specific ones gems&lt;/h2&gt;

&lt;p&gt;If you think about a ruby project, it is very likely that you will have &lt;code&gt;Gemfile&lt;/code&gt; with all the specified extensions you need for your project. &lt;a href=&quot;http://andrewradev.com/2011/06/08/vim-and-ctags/&quot; title=&quot;Andrew Radev&quot;&gt;Andrew Radev&lt;/a&gt; has created a &lt;a href=&quot;https://gist.github.com/893236&quot; title=&quot;ruby snippet&quot;&gt;ruby snippet&lt;/a&gt; that uses &lt;a href=&quot;http://bundler.io/&quot; title=&quot;Bundler API&quot;&gt;Bundler API&lt;/a&gt; for retrieving the used Gemfile in your project and builds a tag file. Instead of using the script you can also perform the following one-liner on the route of your application:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;ctags -R -f gems.tags &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;bundle show --paths&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You have a Padrino project (like my &lt;a href=&quot;https://github.com/wikimatze/job-vacancy&quot;&gt;Job Vacancy&lt;/a&gt;) with the following &lt;code&gt;Gemfile&lt;/code&gt; for example:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;https://rubygems.org&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Server requirements&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;thin&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;1.5.1&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Project requirements&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;rake&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;10.0.4&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;uglifier&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;2.1.1&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;yui-compressor&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;0.9.6&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Component requirements&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;erubis&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;~&amp;gt; 2.7.0&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;activerecord&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;~&amp;gt; 3.2.9&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;active_record&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;sqlite3&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;~&amp;gt; 1.3.6&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Test requirements&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:test&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;rspec&#39;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;2.13.0&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;factory_girl&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;4.2.0&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;rack-test&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;0.6.2&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;rack/test&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;guard-rspec&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;libnotify&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Security&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;bcrypt-ruby&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;3.0.1&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;bcrypt&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Padrino Stable Gem&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;wirble&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;0.1.3&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;pry&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;0.9.12&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;tilt&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;1.3.7&#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Padrino edge&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:git&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;git://github.com/padrino/padrino-framework.git&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;bundle show --paths&lt;/code&gt; will print the absolute path of the used Gems in the following form:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/open4-1.3.0
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-framework-0c1317b0c897/padrino
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-framework-0c1317b0c897/padrino-admin
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-framework-0c1317b0c897/padrino-cache
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-framework-0c1317b0c897/padrino-core
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-framework-0c1317b0c897/padrino-gen
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-framework-0c1317b0c897/padrino-helpers
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-framework-0c1317b0c897/padrino-mailer
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/padrino-sprockets-8f4f6150b2d9
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/polyglot-0.3.3
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pry-0.9.12
/home/helex/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you start vim in the root of your project, it will only load the &lt;code&gt;tags&lt;/code&gt; file but not the &lt;code&gt;gems.tags&lt;/code&gt; file. Just open the command line in vim and type in &lt;code&gt;:set tags+=gems.tags&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you find yourself doing it over and over again for different project, you have to setup the following setting 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;language-vim&quot; data-lang=&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;span class=&quot;p&quot;&gt;,.&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/tags,gems.tags,./&lt;/span&gt;gems&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;Vim will search for the file named &lt;code&gt;tags&lt;/code&gt;, starting with the directory of the current file. Since padrino is separated into different parts you want to jump to the parent directory to find the tag files so you have to enable &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/editing.html#file-searching&quot;&gt;uppward search&lt;/a&gt; with the &lt;code&gt;;&lt;/code&gt; symbol at the end of the search term&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vim&quot; data-lang=&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;sr&quot;&gt;/tags;,./&lt;/span&gt;gems&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;and then recursively to the directory one level above, till it either locates the &lt;code&gt;tags&lt;/code&gt; file or reaches the root directory. It will do exactly the same for the &lt;code&gt;gems.tags&lt;/code&gt; file.&lt;/p&gt;

&lt;h2&gt;Autogenerate tags with Autotags.vim&lt;/h2&gt;

&lt;p&gt;During the coding you are going to change the name of the method or class and have to generate the tags by hand. Do you really want to leave the terminal and generate the tags on your own? Tada, there is &lt;a href=&quot;http://www.vim.org/scripts/script.php?script_id=1343&quot; title=&quot;Autotags vim plugin&quot;&gt;Autotags.vim&lt;/a&gt;. It deletes all tags that are no longer present and calls &lt;code&gt;ctags -a&lt;/code&gt; to append the new tags to your existing tag file. To try it out, create a new directory with the following class definition inside the file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Ctags&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now create the tags with &lt;code&gt;ctags -R .&lt;/code&gt; search after the tag &lt;code&gt;Ctags&lt;/code&gt; with &lt;code&gt;:tag Ctags&lt;/code&gt;, after that change the class name from &lt;code&gt;Ctags&lt;/code&gt; to &lt;code&gt;VimCtags&lt;/code&gt;. If this doesn&amp;#39;t work for you, it means that you don&amp;#39;t have python support enabled for your vim version. You can check it with &lt;code&gt;vim --version | grep python&lt;/code&gt; - a &lt;code&gt;+python&lt;/code&gt; means that you have it.  I have written a blog post about how to &lt;a href=&quot;/compiling-vim-from-source-for-ubuntu-and-mac-with-rbenv.html&quot;&gt;install vim with python support&lt;/a&gt; for the case you have problems with this.&lt;/p&gt;

&lt;h2&gt;Fuzzy like tag search with Ctrlp plugin&lt;/h2&gt;

&lt;p&gt;As we have learned before it is possible that we partially know the name of the class or method name we want to use. This is where you have to use &lt;a href=&quot;http://kien.github.io/ctrlp.vim/&quot;&gt;ctrlp.vim&lt;/a&gt; plugin. Ones installed, it gives you the &lt;code&gt;:CtrlPTag&lt;/code&gt; tag command which make it possible to do a fuzzy like tag search.&lt;/p&gt;

&lt;p&gt;If you find yourself using this command very often, you have to add the following mapping into 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;language-bash&quot; data-lang=&quot;bash&quot;&gt;nnoremap &amp;lt;leader&amp;gt;. :CtrlPTag&amp;lt;cr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;if the Ctrlp doesn&amp;#39;t provide you enough hits, please use &lt;code&gt;:tselect&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Further Reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://lanyrd.com/2013/navigating-a-codebase-with-vim/scgkmx/&quot;&gt;Video about ctags&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.stwrt.ca/2012/10/31/vim-ctags&quot;&gt;Good introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://andrewradev.com/2011/06/08/vim-and-ctags/&quot;&gt;Specialize ctags for ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://vim.wikia.com/wiki/Browsing_programs_with_tags&quot;&gt;Browsing programs with tags&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Writing Zsh Completion for Padrino</title>
      <id>http://wikimatze.de/writing-zsh-completion-for-padrino</id>
      <link href="http://wikimatze.de/writing-zsh-completion-for-padrino"/>
      <published>2013-07-03T00:00:00+00:00</published>
      <updated>2013-07-03T00:00:00+00:00</updated>
      <category term="zsh"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article is part of an ongoing series about my exploration of the Padrino web framework. If you want to read more
about it please check out &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook.com&lt;/a&gt;. You sniff around in the sources of the book under
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#39;m a user of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Z_shell&quot;&gt;Z shell (zsh)&lt;/a&gt;. It is easy to customize your prompt and to have more abilities for tab completion of the most used programs with this shell. If you are lazy or new to a new command line tool with a huge amount of options, this will help you in the beginning to remember the commands.  When you use [git](http://en.wikipedia.org/wiki/Git_(software) you can press tab to see all available options you have in the current context. The same functions aren&amp;#39;t available for &lt;a href=&quot;http://www.padrinorb.com/&quot;&gt;Padrino&lt;/a&gt; and this is how I came to this article.&lt;/p&gt;

&lt;h2&gt;Start Small with Basic tmuxinator Completion&lt;/h2&gt;

&lt;p&gt;Your first step is to create a file with the name of the command for which you want to have autocompletion. The name of the command must begin with an underscore and needs to be in your &lt;a href=&quot;http://zsh.sourceforge.net/Doc/Release/Functions.html&quot;&gt;fpath&lt;/a&gt;. The &lt;code&gt;fpath&lt;/code&gt; is the variable which will be used for shell searches when the &lt;code&gt;autoload&lt;/code&gt; function is first called. Let&amp;#39;s enable this feature in your &lt;code&gt;.zshrc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# folder of all of your autocomplete functions&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;fpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.zsh-completions &lt;span class=&quot;nv&quot;&gt;$fpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# enable autocomplete function&lt;/span&gt;
autoload -U compinit
compinit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Before going on, you need to install the tmuxinator gem with:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gem install tmuxinator
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s implement the &lt;code&gt;hello-tmux&lt;/code&gt; and &lt;code&gt;version&lt;/code&gt; commands for the tmuxinator gem. Inside your &lt;code&gt;~/.zsh-completions/_tmuxinator&lt;/code&gt; file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#compdef tmuxinator&lt;/span&gt;
_tmuxinator&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;local&lt;/span&gt; -a commands
  &lt;span class=&quot;nv&quot;&gt;commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;&#39;hello-tmux:our first autocompletion function.&#39;&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;&#39;version:show the used gem version.&#39;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;((&lt;/span&gt; CURRENT &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; 2 &lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;_describe -t commands &lt;span class=&quot;s1&quot;&gt;&#39;commands&#39;&lt;/span&gt; commands
  &lt;span class=&quot;k&quot;&gt;fi

  return &lt;/span&gt;0
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

_tmuxinator
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now reload your shell with &lt;code&gt;exec zsh&lt;/code&gt; and type in &lt;code&gt;$ tmuxinator &amp;lt;Tab&amp;gt;&lt;/code&gt;. Voilà, you&amp;#39;ve written you first autocompletion. I will explain part of the code in the next chapters in case you don&amp;#39;t know each detail of the code.&lt;/p&gt;

&lt;h2&gt;Autocompletion for Padrino&lt;/h2&gt;

&lt;p&gt;First of all we need to specify the name of the command for which we want to have for Padrino&amp;#39;s autocompletion:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#compdef padrino&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;typeset&lt;/span&gt; -A opt_args
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Please note, that the first line must be comment with the &lt;code&gt;compdef&lt;/code&gt; command followed by the name of the command. With the help of the &lt;code&gt;typeset&lt;/code&gt; command we can set and display attributes and values for shell parameters. The &lt;code&gt;-A&lt;/code&gt; options says, that names we pass into the autocomplete function refers to &lt;a href=&quot;http://linux.die.net/man/1/zshparam&quot;&gt;associative array parameters&lt;/a&gt;. &lt;code&gt;opt_args&lt;/code&gt; makes it possible to add command-line options like &lt;code&gt;-d&lt;/code&gt; or &lt;code&gt;-f&lt;/code&gt; for our associative array.&lt;/p&gt;

&lt;p&gt;Next, we are going to define the inputs of our function. We need this to be able to define states in order to get the context in which we are during our completion:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;_arguments -C &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;1:cmd:-&amp;gt;cmds&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;2:generators:-&amp;gt;generator_lists&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;*:: :-&amp;gt;args&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;_arguments&lt;/code&gt; function is used to give a complete specification for a command whose arguments follow standard UNIX option and argument conventions.  &lt;code&gt;_arguments&lt;/code&gt; returns status zero if it was able to add matches and non-zero otherwise. The option &lt;code&gt;-C&lt;/code&gt; makes it possible to modify the &lt;code&gt;curcontext&lt;/code&gt; parameter. With the help of &lt;code&gt;curcontext&lt;/code&gt; it is possible to keep track of the current context. This will be used later in our big state machine like case construct.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;1:cmd:-&amp;gt;cmds&lt;/code&gt; describes the first argument in our completion function. The &lt;code&gt;cmd&lt;/code&gt; message will be printed above matches generated and the &lt;code&gt;cmds&lt;/code&gt; action indicates what can be completed in this position. Similar, &lt;code&gt;2:generators:-&amp;gt;generator_lists&lt;/code&gt; stands for the second argument with the &lt;code&gt;generator_lists&lt;/code&gt; option. At last, we need to be able to pass in certain arguments whatever position we are in. For this case we are using &lt;code&gt;*:: :-&amp;gt;args&lt;/code&gt;. The two colons before any message of the command array indicates that the current context parameter refer only to the normal arguments when the action is evaluated.&lt;/p&gt;

&lt;h2&gt;Padrino Generators&lt;/h2&gt;

&lt;p&gt;Everything is set and we need to define Padrino&amp;#39;s command for autocompletion. Padrino uses the &lt;code&gt;g&lt;/code&gt; option to specify the command for using a &lt;a href=&quot;http://www.padrinorb.com/guides/generators&quot;&gt;generator&lt;/a&gt;. After we are in this context we can chose a generator like &lt;em&gt;controller, mailer, migration, model, plugin&lt;/em&gt; or &lt;em&gt;project&lt;/em&gt;. Depending which generator we take, we can use different, context specific arguments like &lt;code&gt;-a&lt;/code&gt; for the &lt;em&gt;mailer&lt;/em&gt; generator to create a mailer for the specified sub application or the &lt;code&gt;-d&lt;/code&gt; option for defining the orm adapter when using the &lt;em&gt;project&lt;/em&gt; generator.&lt;/p&gt;

&lt;p&gt;The first argument in Padrino autocompletion, &lt;code&gt;1:cmd:-&amp;gt;cmds&lt;/code&gt;, is created with the help of a case statement:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#compdef padrino&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;typeset&lt;/span&gt; -A opt_args

_arguments -C &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;1:cmd:-&amp;gt;cmds&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;2:generators:-&amp;gt;generator_lists&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;*:: :-&amp;gt;args&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0


&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$state&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;cmds&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;commands; &lt;span class=&quot;nv&quot;&gt;commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;g:Padrinos generators&#39;&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

      _describe -t commands &lt;span class=&quot;s1&quot;&gt;&#39;command&#39;&lt;/span&gt; commands &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
  &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
ease;

&lt;span class=&quot;k&quot;&gt;return &lt;/span&gt;1;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s go through the parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;case &amp;quot;$state&amp;quot;&lt;/code&gt; - The beginning of our state statement. The &lt;code&gt;$state&lt;/code&gt; variable is used for tracking the current state we are in.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;local commands&lt;/code&gt; - Definition of a variable which is assigned as a list of strings for our completion function. After the name of the command follows the explanation of the command.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_describe -t&lt;/code&gt; - The &lt;code&gt;describe&lt;/code&gt; functions associates completions with description. All it does is taking our previously defined commands as a list variable &lt;code&gt;commands&lt;/code&gt; for zsh compsys function and return 0 to indicate that error occurs. The &lt;code&gt;-t&lt;/code&gt; option specify the tag we want to use we want to use in our describe function. In our case we are tagging the local commands for the completions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we know that we are going to use a generator we need to find out which generator want to use in the completion.  This is the &lt;code&gt;&amp;#39;2:generators:-&amp;gt;generator_lists&amp;#39;&lt;/code&gt; part of the &lt;code&gt;_arguments&lt;/code&gt; function:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#compdef padrino&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;typeset&lt;/span&gt; -A opt_args

_arguments -C &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;1:cmd:-&amp;gt;cmds&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;2:generators:-&amp;gt;generator_lists&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;*:: :-&amp;gt;args&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0

&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$state&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;cmds&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;commands; &lt;span class=&quot;nv&quot;&gt;commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;g:Padrinos generators&#39;&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

      _describe -t commands &lt;span class=&quot;s1&quot;&gt;&#39;command&#39;&lt;/span&gt; commands &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
  &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;generator_lists&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;generators; &lt;span class=&quot;nv&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;controller:creates a new controller&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;mailer:creates a new mailer&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;migration:creates a new migration&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;model:creates a new model&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;project:create a new Padrino app&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;plugin:add plugin to your app&#39;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    _describe -t generators &lt;span class=&quot;s1&quot;&gt;&#39;generator&#39;&lt;/span&gt; generators &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
  &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;esac&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;return &lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The code above follows nearly the same syntax as the &lt;code&gt;cmds&lt;/code&gt; command before. The last thing we need to handle are the optional arguments for each generate state, as defined &lt;code&gt;*:: :-&amp;gt;args&lt;/code&gt; (imagine this thing as the default or else branch of your control structure):&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#compdef padrino&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;typeset&lt;/span&gt; -A opt_args

_arguments -C &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;1:cmd:-&amp;gt;cmds&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;2:generators:-&amp;gt;generator_lists&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&#39;*:: :-&amp;gt;args&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0

&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$state&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;cmds&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;commands; &lt;span class=&quot;nv&quot;&gt;commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;g:Padrinos generators&#39;&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

      _describe -t commands &lt;span class=&quot;s1&quot;&gt;&#39;command&#39;&lt;/span&gt; commands &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
  &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;generator_lists&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;generators; &lt;span class=&quot;nv&quot;&gt;generators&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;controller:creates a new controller&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;mailer:creates a new mailer&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;migration:creates a new migration&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;model:creates a new model&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;project:create a new Padrino app&#39;&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;&#39;plugin:add plugin to your app&#39;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    _describe -t generators &lt;span class=&quot;s1&quot;&gt;&#39;generator&#39;&lt;/span&gt; generators &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
  &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;args&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$line&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2] &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;controller&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        _arguments &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&#39;-d:remove all generated files&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&#39;-n:specify the application&#39;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&#39;-r:specify the root&#39;&lt;/span&gt;
          &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
      &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;mailer&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;mailers; &lt;span class=&quot;nv&quot;&gt;mailers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&#39;-a:creates a mailer for the specified subapp&#39;&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&#39;-d:removes all generated files&#39;&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&#39;-n:specify the application&#39;&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&#39;-r:specify the root destination path&#39;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        _describe -t mailers &lt;span class=&quot;s1&quot;&gt;&#39;mailer&#39;&lt;/span&gt; mailers &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;ret&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
      &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
      ...
      ;;
    &lt;span class=&quot;k&quot;&gt;esac&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;esac&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;return &lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If our second inline parameter &lt;code&gt;$line[2]&lt;/code&gt; is &lt;code&gt;controller&lt;/code&gt; then we have the &lt;code&gt;-d, -n&lt;/code&gt;, and &lt;code&gt;-r&lt;/code&gt; options. One the other hand if the second inline parameter is &lt;code&gt;mailer&lt;/code&gt; the options &lt;code&gt;-a, -d, -n&lt;/code&gt;, and &lt;code&gt;-r&lt;/code&gt; are available. You can find the whole implementation code under &lt;a href=&quot;https://github.com/wikimatze/padrino-zsh-completion&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;The benefit of writing function completions for zsh is that it is available on nearly every platform. All you need is to have the zsh installed on your machine - there are no other dependencies. Documentation about writing is available but there aren&amp;#39;t many practical examples. Look and learn from other how used it and then experiment with it. After some time you&amp;#39;ll get the smell how to do it. And please, if you are writing something complex, write a blog post about your completion function to help other getting into it.&lt;/p&gt;

&lt;h2&gt;Further Reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://linux.die.net/man/1/zshcompsys&quot;&gt;zshcompsys&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/tmuxinator/tmuxinator#completion&quot;&gt;tmuxinator autocompletion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/zsh-users/zsh-completions&quot;&gt;zsh-completion repositories on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/wikimatze/padrino-zsh-completion&quot;&gt;padrino zsh completion on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Testing Helpers in Padrino</title>
      <id>http://wikimatze.de/testing-helpers-in-padrino</id>
      <link href="http://wikimatze.de/testing-helpers-in-padrino"/>
      <published>2013-06-06T00:00:00+00:00</published>
      <updated>2013-06-06T00:00:00+00:00</updated>
      <category term="programming"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article is part of an ongoing series about my exploration of the Padrino web framework. If you want to read more
about it please check out &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook.com&lt;/a&gt;. You sniff around in the sources of the book under
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;I always was wondering how to test helpers in Padrino and to be honest I postponed this problem for a long time. But this morning I reached the point in my book where I was writing helper with many methods without testing them. When something like this happened you have stop going and spend time to solve this problem.&lt;/p&gt;

&lt;h2&gt;The Problem&lt;/h2&gt;

&lt;p&gt;Let&amp;#39;s say you have a typical Padrino helper:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# app/helpers/users_helper.rb&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;JobVacancy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;bar&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can use the &lt;code&gt;foo&lt;/code&gt; method anywhere in you controllers and views. But what happened if your helper is getting more and more complex like the following one:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# app/helpers/users_helper.rb&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;JobVacancy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;current_user&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;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@current_user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;current_user&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@current_user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;find_by_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:current_user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;current_user?&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current_user&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sign_in&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:current_user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;id&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;current_user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sign_out&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:current_user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;signed_in?&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current_user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;nil?&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Right, there is a lot of stuff inside and you need to test this.&lt;/p&gt;

&lt;h2&gt;Assumption&lt;/h2&gt;

&lt;p&gt;Let&amp;#39;s say you have the following structure within you application:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-&quot; data-lang=&quot;&quot;&gt;.
├── app
│   ├── controllers
│   │   ├── ...
│   ├── helpers
│   │   ├── users_helper.rb
│   │   ├── ...
│   ├── models
│       └── ...
├── spec
│   ├── app
│   │   ├── controllers
│   │   │   ├── ...
│   │   ├── helpers
│   │   │   └── users_helper_spec.rb
│   │   ├── models
│   │   │   └── ...
│   ├── spec_helper.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And you have written your helper in the typical helper style of Padrino which are generated when you create a new controller:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# app/helpers/users_helper.rb&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;JobVacancy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;bar&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This syntax is a shortcut for:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;bar&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;JobVacancy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;helpers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In Padrino, helpers are generally an anonymous module. Testing something anonymous isn&amp;#39;t possible. To make this helper testable we need to make this module explicit:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# app/helpers/users_helper.rb&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;UsersHelper&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;bar&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;JobVacancy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;UsersHelper&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can still use the &lt;code&gt;foo&lt;/code&gt; method everywhere in your views and controller. But now you&amp;#39;ve got a big plus. You can test it.&lt;/p&gt;

&lt;h2&gt;Prepare the Spec&lt;/h2&gt;

&lt;p&gt;We need to require the helper in our &lt;code&gt;spec_helper&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/spec_helper.rb&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;PADRINO_ENV&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;test&#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defined?&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;PADRINO_ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;dirname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/../config/boot&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;dirname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/../app/helpers/users_helper&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# &amp;lt;--- this is what we need&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;RSpec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;configure&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conf&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;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
  &lt;span class=&quot;nf&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;full_backtrace&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;false&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;color_enabled&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;formatter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:documentation&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Write the spec&lt;/h2&gt;

&lt;p&gt;And here is a spec for that:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/app/helpers/users_helper_spec.rb&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;spec_helper&#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;UsersHelper&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;before&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UsersHelperClass&lt;/span&gt;
      &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;UsersHelper&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;vi&quot;&gt;@user_helper&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;UsersHelperClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;test foo&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@user_helper&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;bar&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We create a class in the before part of the spec which include our &lt;code&gt;UsersHelper&lt;/code&gt; module. Next, we are creating the instance variable &lt;code&gt;@user_helper&lt;/code&gt; as a new object of our class &lt;code&gt;UsersHelperClass&lt;/code&gt;. Running our tests will make unicorns happy and fast:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rspec spec/app/helpers

  UsersHelper
    &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;foo

  Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.00041 seconds
  1 example, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I&amp;#39;m quiet sure that there is a better way to write the spec. If you know a way, please let me know.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Using Hub for Faster Contributing to GitHub Open-Source Projects</title>
      <id>http://wikimatze.de/using-hub-for-faster-contributing-to-github-open-source-projects</id>
      <link href="http://wikimatze.de/using-hub-for-faster-contributing-to-github-open-source-projects"/>
      <published>2013-06-04T00:00:00+00:00</published>
      <updated>2013-06-04T00:00:00+00:00</updated>
      <category term="git"/>
      <content type="html">&lt;p&gt;&lt;em&gt;Ever wondering how you can easily fork and contribute to an Open-Source project without forking a repository manually in your browser? Then you should have a look into the &lt;a href=&quot;https://github.com/defunkt/hub&quot;&gt;hub gem&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hub is a command-line wrapper for &lt;a href=&quot;http://git-scm.com/&quot;&gt;git&lt;/a&gt; written by &lt;a href=&quot;http://defunkt.io/&quot;&gt;defunkt&lt;/a&gt;. With it, you can easily create forks of repositories, making pull requests, and get code from other forks with no problems. If you are a maintainer of a very popular repository like &lt;a href=&quot;https://github.com/twitter/bootstrap&quot;&gt;twitter bootstrap&lt;/a&gt; with over ~23k forks, this tool makes your life a lot easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: &lt;a href=&quot;https://github.com/jingweno/gh&quot;&gt;gh&lt;/a&gt; is the hub implementation written in &lt;a href=&quot;http://golang.org/&quot;&gt;Go&lt;/a&gt;.
It is faster and will &lt;a href=&quot;https://github.com/github/hub/issues/475&quot;&gt;be a replacement&lt;/a&gt; of the pure hub in the future - thanks &lt;a href=&quot;https://twitter.com/_ZPH&quot;&gt;@_ZKH&lt;/a&gt; for showing me this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: hub is now available as &lt;a href=&quot;https://github.com/github/hub/releases&quot;&gt;precompiled binaries&lt;/a&gt; - so you don&amp;#39;t need
it compile with go&lt;/p&gt;

&lt;h2&gt;Installing hub&lt;/h2&gt;

&lt;p&gt;Grab the &lt;a href=&quot;https://github.com/github/hub/releases&quot;&gt;latest hub release&lt;/a&gt; for your system and player into your bin path.&lt;/p&gt;

&lt;h2&gt;Workflow to get things done&lt;/h2&gt;

&lt;p&gt;What I normally do when using Open-Source technologies like the &lt;a href=&quot;http://foundation.zurb.com/&quot;&gt;Foundation Framework&lt;/a&gt; is trying to give something back. For example  by improving documentation, reporting bugs, or solving problems.&lt;/p&gt;

&lt;p&gt;First of all let&amp;#39;s get the code:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;hub clone zurb/foundation-sites
  Cloning into &lt;span class=&quot;s1&quot;&gt;&#39;foundation-sites&#39;&lt;/span&gt;...
  remote: Counting objects: 81224, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  remote: Compressing objects: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;28/28&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  remote: Total 81224 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 10&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, reused 0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;delta 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, pack-reused 81195
  Receiving objects: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;81224/81224&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 112.63 MiB | 1.11 MiB/s, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  Resolving deltas: 100% &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;48423/48423&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
  Checking connectivity... &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now let&amp;#39;s make a branch for fixing some documentation issues:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git checkout -b readme-fixes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you make your changes and run a &lt;code&gt;git commit -m &amp;quot;Fixed documentation&amp;quot;&lt;/code&gt; and you are ready to &lt;a href=&quot;https://help.github.com/articles/fork-a-repo&quot;&gt;fork the repo&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;hub fork
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you need to push the changes to your remote and open a pull request:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git push -u wikimatze readme-fixes
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;hub pull-request
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&amp;#39;s it. If you want to see a list of open issues, you can use the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;hub browse -- issues
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will open the issue site in your browser. In our case this would be &lt;a href=&quot;https://github.com/zurb/foundation-sites/issues&quot;&gt;https://github.com/zurb/foundation-sitesissues&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want to see a list of pull-requests, just pass the &lt;code&gt;pulls&lt;/code&gt; param&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;hub browse -- pulls
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Remember your username and token&lt;/h1&gt;

&lt;p&gt;Go to your &lt;a href=&quot;https://github.com/settings/tokens&quot; title=&quot;github token settings&quot;&gt;github token settings&lt;/a&gt;, generate a fresh one and
put them into &lt;code&gt;~/.config/hub&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yml&quot; data-lang=&quot;yml&quot;&gt;&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;github.com&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;wikimatze&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;oauth_token&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;lt;TOKEN&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you don&amp;#39;t need to type in your username and password everytime.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;The idea for this blog came out of my first remote paring session with my friend &lt;a href=&quot;https://twitter.com/_ZPH&quot;&gt;@_ZPH&lt;/a&gt; where I wanted to show him this gem but wasn&amp;#39;t able to explain him the work flow. So this little snippet is a reminder for him and me.&lt;/p&gt;

&lt;h2&gt;Further Reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://defunkt.io/hub&quot;&gt;hub documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Using Sprockets to Manage the Asset Pipeline in Padrino</title>
      <id>http://wikimatze.de/using-sprockets-to-manage-the-asset-pipeline-in-padrino</id>
      <link href="http://wikimatze.de/using-sprockets-to-manage-the-asset-pipeline-in-padrino"/>
      <published>2013-05-23T00:00:00+00:00</published>
      <updated>2013-05-23T00:00:00+00:00</updated>
      <category term="programming"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article is part of an ongoing series about my exploration of the Padrino web framework. If you want to read more
about it please check out &lt;a href=&quot;http://padrinobook.com/&quot;&gt;padrinobook.com&lt;/a&gt;. You sniff around in the sources of the book under
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/sstephenson/sprockets&quot;&gt;Sprockets&lt;/a&gt; are a way to manage serving your assets like CSS, and JavaScript compiling all the different files in one summarized file for each type. They make it easy to take advantage to use a preprocessor to write your assets with &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt;, &lt;a href=&quot;http://coffeescript.org/&quot;&gt;Coffesscript&lt;/a&gt;, or &lt;a href=&quot;http://lesscss.org/&quot;&gt;LESS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To implement Sprockets in Padrino there the following strategies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/livingsocial/rake-pipeline&quot;&gt;rake-pipeline&lt;/a&gt; - Define filters that transforms directory trees.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gruntjs.com/&quot;&gt;grunt&lt;/a&gt; - Set a task to compile and manage assets in JavaScript.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rstacruz/sinatra-assetpack&quot;&gt;sinatra-assetpack&lt;/a&gt; - Let&amp;#39;s you define you assets transparently in Sinatra.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/nightsailer/padrino-sprockets&quot;&gt;padrino-sprockets&lt;/a&gt; - Integrate sprockets with Padrino in the Rails way.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Padrino Sprockets&lt;/h2&gt;

&lt;p&gt;First we will create a new Padrino app:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;padrino g project job-vacancy -d activerecord -t rspec -s jquery -e erb -a sqlite
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We are using the &lt;strong&gt;padrino-sprockets&lt;/strong&gt; gem. Let&amp;#39;s add it to our Gemfile:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Gemfile&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-sprockets&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;padrino/sprockets&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:git&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;git://github.com/nightsailer/padrino-sprockets.git&#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next we need to move all our assets from the public folder in the assets folder:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;path-to-your-padrino-app&amp;gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;mkdir -p app/assets
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;mv public/javascript app/assets
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;mv public/stylesheets app/assets
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;mv public/images app/assets
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now we have to register Padrino-Sprockets in this application:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# app/app.rb&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;JobVacancy&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Application&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;register&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Sprockets&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sprockets&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
  &lt;span class=&quot;nf&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next we need to determine the order of the loaded CSS files:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;stylesheets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;application&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.css&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/*
 * This is a manifest file that&#39;ll automatically include all the stylesheets available in this directory
 * and any sub-directories. You&#39;re free to add application-wide styles to this file and they&#39;ll appear at
 * the top of the compiled file, but it&#39;s generally better to create a new file per style scope.
 * require_self: Puts the CSS contained within this file at the precise location (puts this command
 * at the top of the generated css file
 * require_tree . means, that requiring all stylesheets from the current directory.
 *
 *= require_self
 *= require bootstrap
 *= require bootstrap-responsive
 *= require site
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;First we are loading the &lt;code&gt;bootstrap&lt;/code&gt; default CSS, then &lt;code&gt;bootstrap-response&lt;/code&gt;, and finally our customized &lt;code&gt;site&lt;/code&gt; CSS. The &lt;code&gt;require_self&lt;/code&gt; loads the file itself, to define the order that the files are loaded. This is helpful if you want to check the order of the loaded CSS as a comment above your application without ever have to look into the source of it.&lt;/p&gt;

&lt;p&gt;Next let&amp;#39;s have a look into our JavaScript files:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;javascript&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;application&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;js&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// This is a manifest file that&#39;ll be compiled into including all the files listed below.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Add new JavaScript/Coffee code in separate files in this directory and they&#39;ll automatically&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// be included in the compiled file accessible from http://example.com/assets/application.js&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// It&#39;s not advisable to add code directly here, but if you do, it&#39;ll appear at the bottom of the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// the compiled file.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//= require_tree .&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The interesting thing here is the &lt;code&gt;require_tree .&lt;/code&gt; option. This option tells Sprockets to include all JavaScript files in the assets folder with no specific order.&lt;/p&gt;

&lt;p&gt;Now, we can clean up the include statements in our application template:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;# app/views/layouts/application.erb

&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;en-US&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Job Vacancy - find the best jobs&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;err&quot;&gt;&amp;lt;&lt;/span&gt;%= stylesheet_link_tag &#39;/assets/application&#39; %&amp;gt;
  &lt;span class=&quot;err&quot;&gt;&amp;lt;&lt;/span&gt;%= javascript_include_tag &#39;/assets/application&#39; %&amp;gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Enable Compression for CSS and JavaScript&lt;/h2&gt;

&lt;p&gt;Now we want to enable compression for our CSS and JavaScript files. For CSS compression Padrino Sprockets is using &lt;a href=&quot;https://github.com/sstephenson/ruby-yui-compressor&quot;&gt;YUI compressor&lt;/a&gt; and for JS compression the &lt;a href=&quot;https://github.com/lautis/uglifier&quot;&gt;Uglifier&lt;/a&gt;. We need to add these these Gems in our &lt;code&gt;Gemfiles&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Gemfile&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino-sprockets&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;padrino/sprockets&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:git&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;git://github.com/nightsailer/padrino-sprockets.git&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;uglifier&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;2.1.1&#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;yui-compressor&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;0.9.6&#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And finally we need to enable minifying in our production environment:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# app/app.rb&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;JobVacancy&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Application&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;register&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Sprockets&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sprockets&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:minify&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Padrino&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;env&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:production&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;br&gt;
&lt;div class=&quot;default alert&quot;&gt;
  &lt;h4&gt;Learn more about Padrino Book? Sign Up!&lt;/h4&gt;
  &lt;br&gt;
  &lt;link href=&quot;http://cdn-images.mailchimp.com/embedcode/slim-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;style type=&quot;text/css&quot;&gt;
    #mc&lt;em&gt;embed&lt;/em&gt;signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
  &lt;/style&gt;
  &lt;div id=&quot;mc_embed_signup&quot;&gt;
  &lt;form action=&quot;http://wikimatze.us6.list-manage.com/subscribe/post?u=4010f8ce18503766e176536f1&amp;amp;id=198f8c0321&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;
    &lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;email&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;email address&quot; required&gt;
    &lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button pretty medium info btn&quot;&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>My Talk at Ruby Midwest 2013</title>
      <id>http://wikimatze.de/my-talk-at-ruby-midwest-2013</id>
      <link href="http://wikimatze.de/my-talk-at-ruby-midwest-2013"/>
      <published>2013-05-02T00:00:00+00:00</published>
      <updated>2013-05-02T00:00:00+00:00</updated>
      <category term="talk"/>
      <content type="html">&lt;p&gt;Here is a picture that explains everything I experienced at this conference:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8265/8630304575_202b9ee6dc_c.jpg&quot; title=&quot;Me and some of the speakers.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8265/8630304575_202b9ee6dc_b.jpg&quot; class=&quot;center&quot; alt=&quot;Me and some of the speakers.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I received  &lt;em&gt;love, motivation, fun, feeling that I&amp;#39;m doing right, passion, energy, and new ideas&lt;/em&gt;. But most importantly I made &lt;strong&gt;new friends&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The topic of my talk: &lt;strong&gt;&amp;quot;We all love Open Source work and Pomodoro will help you to hack on your beloved babies in a time-boxed way to get more done in less time.&amp;quot;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;Slides&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
&lt;script src=&quot;http://speakerdeck.com/embed/9e6577708e71013090591231391735e3.js&quot;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;You can find the slides on &lt;a href=&quot;https://speakerdeck.com/wikimatze/more-time-for-open-source-work-with-the-help-of-the-pomodoro-technique&quot;&gt;speakerdeck&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Video&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
&lt;iframe width=&quot;640&quot; height=&quot;360&quot; src=&quot;http://www.youtube.com/embed/249osnsUXtE&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;p&gt;You can find this video on &lt;a href=&quot;http://confreaks.tv/videos/rmw2013-more-time-for-open-source-work-with-the-help-of-the-pomodoro-technique&quot;&gt;confreaks&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Impressions&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8258/8630529711_e174eeeca1_b.jpg&quot; title=&quot;Downtown Kansas City.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8258/8630529711_e174eeeca1_c.jpg&quot; class=&quot;center&quot; alt=&quot;Downtown Kansas City.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Downtown Kansas City.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8536/8630526389_133cd8c2b2_b.jpg&quot; title=&quot;@kobier from confreaks recording the videos.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8536/8630526389_133cd8c2b2_c.jpg&quot; class=&quot;center&quot; alt=&quot;@kobier from confreaks recording the videos.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;@kobier from confreaks recording the videos.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8529/8631401824_eb3f31e26f_b.jpg&quot; title=&quot;Interesting discussions at a roof in the heart of Kansas City.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8529/8631401824_eb3f31e26f_c.jpg&quot; class=&quot;center&quot; alt=&quot;Interesting discussions at a roof in the heart of Kansas City.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Interesting discussions at a roof in the heart of Kansas City.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8248/8630335663_57915e4f39_b.jpg&quot; title=&quot;Ruby Midwest organzisers, Steve Klabnik, Ashe Dryden, and me having lunch.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8248/8630335663_57915e4f39_c.jpg&quot; class=&quot;center&quot; alt=&quot;Ruby Midwest organzisers, Steve Klabnik, Ashe Dryden, and me having lunch.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Ruby Midwest organzisers, Steve Klabnik, Ashe Dryden, and me having lunch.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8519/8630306649_e428baf48e_b.jpg&quot; title=&quot;Some of the Ruby Midwest speakers.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8519/8630306649_e428baf48e_c.jpg&quot; class=&quot;center&quot; alt=&quot;Some of the Ruby Midwest speakers.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Some of the Ruby Midwest speakers.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8393/8631444608_e793edf348_b.jpg&quot; title=&quot;Reward for a speaker - the BBQ sauce is so delicious.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8393/8631444608_e793edf348_c.jpg&quot; class=&quot;center&quot; alt=&quot;Reward for a speaker - the BBQ sauce is so delicious.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Reward for a speaker - the BBQ sauce is so delicious.&lt;/div&gt;

&lt;p&gt;More pictures can be found under &lt;a href=&quot;http://www.flickr.com/photos/wikimatze/sets/72157633195207226/&quot;&gt;flickr Ruby Midwest 2013&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Software: &lt;a href=&quot;https://github.com/bartaz/impress.js/&quot;&gt;impress.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Typface:

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fontsquirrel.com/fonts/FFF-Tusj&quot;&gt;FFFTusj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fontsquirrel.com/fonts/lobster-two&quot;&gt;Lobster Two&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://bitbucket.org/wikimatze/presentations/commits/all/tip/pomodoro-for-open-source-works&quot;&gt;Bitbucket&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Speaking at Ruby Midwest 2013</title>
      <id>http://wikimatze.de/speaking-at-ruby-midwest-2013</id>
      <link href="http://wikimatze.de/speaking-at-ruby-midwest-2013"/>
      <published>2013-02-12T00:00:00+00:00</published>
      <updated>2013-02-12T00:00:00+00:00</updated>
      <category term="talk"/>
      <content type="html">&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8225/8457381969_a4ecae5eff_z.jpg&quot; title=&quot;Ruby Midwest 2013&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8225/8457381969_a4ecae5eff.jpg&quot; class=&quot;center&quot; alt=&quot;Ruby Midwest 2013&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I received notification that my talk proposal for &lt;a href=&quot;http://www.rubymidwest.com/&quot;&gt;Ruby Midwest 2013&lt;/a&gt; has been accepted.  My talk &lt;strong&gt;&amp;quot;More time for Open Source work with the help of the Pomodoro Technique&amp;quot;&lt;/strong&gt; will show you how you can do more Open Source work besides your day job and other liabilities. I&amp;#39;m very excited, as this will be my first time giving a talk at a conference.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.rubymidwest.com/&quot;&gt;Ruby Midwest 2013&lt;/a&gt; will be held in &lt;a href=&quot;http://www.kansascity.com/&quot;&gt;Kansas City&lt;/a&gt;, 5th and 6th of April. &lt;a href=&quot;http://www.twitter.com/mfeathers&quot;&gt;Michael Feather&lt;/a&gt; and &lt;a href=&quot;http://www.twitter.com/JEG2&quot;&gt;James Edward Grey II&lt;/a&gt; are giving keynotes and I will receive the opportunity to meet them.  If you attend the conference as well, let us get in touch.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Getting started with RSpec Puppet</title>
      <id>http://wikimatze.de/getting-started-with-rspec-puppet</id>
      <link href="http://wikimatze.de/getting-started-with-rspec-puppet"/>
      <published>2012-09-27T00:00:00+00:00</published>
      <updated>2012-09-27T00:00:00+00:00</updated>
      <category term="howto"/>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;You never improve if you can&#39;t change at all.&lt;/p&gt;
  &lt;strong&gt;Tom DeMarco&lt;/strong&gt;
&lt;/blockquote&gt;

&lt;p&gt;Writing your service configuration with Puppet can be easy. But when it comes to debugging, it can be very difficult to edit things and to find certain errors. This article presents your the basic of setting up your environment for testing Puppet modules in a BDD way.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8291/7804199724_37c12fbbc0_b.jpg&quot; title=&quot;Prevention of bad code with tests.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/8291/7804199724_37c12fbbc0_z.jpg&quot; class=&quot;center&quot; alt=&quot;Prevention of bad code with tests.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Prevention of bad code with tests.&lt;/div&gt;

&lt;h2&gt;The tools&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://rubygems.org/gems/rspec-puppet/&quot;&gt;rspec-puppet gem&lt;/a&gt; is the &lt;a href=&quot;http://docs.rubygems.org/read/chapter/1#page22&quot;&gt;Gem&lt;/a&gt; setup to get started. It install the &lt;code&gt;rspec-puppet-init&lt;/code&gt; command which automatically sets up the basic settings for testing. As a text tool we want to use &lt;a href=&quot;http://rubygems.org/gems/puppet-lint/&quot;&gt;puppet-lint&lt;/a&gt;: This tool checks your Puppet manifests against the &lt;a href=&quot;http://docs.puppetlabs.com/guides/style_guide.html&quot;&gt;Puppet Labs style guide&lt;/a&gt; and alert you to any discrepancies =&amp;gt; you have now your constant feedback loop when writing code.&lt;/p&gt;

&lt;p&gt;Run the following commands to install the gem:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gem install rspec-puppet
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gem install puppet-lint
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can use &lt;code&gt;puppet-lint&lt;/code&gt; in your terminal to check a puppet manifest.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;puppet-lint &amp;lt;path-to-your-manifest&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s assume, we have the following puppet file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/init.pp&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;package&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;If we run &lt;code&gt;puppet-lint&lt;/code&gt; on it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;puppet-lint manifests/init.pp
ERROR: two-space soft tabs not used on line 10
WARNING: unquoted resource title on line 10
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Setting up the environment&lt;/h2&gt;

&lt;p&gt;The next step is to clone the &lt;a href=&quot;https://github.com/andreashaerter/puppet-boilerplate-modules&quot;&gt;puppet boilerplate repository&lt;/a&gt; . It&amp;#39;s perfect for creating a initial skeleton for a new module. After we get the code, we run a script which guides you through the process of creating a new module:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git clone https://github.com/andreashaerter/puppet-boilerplate-modules.git
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;./puppet-boilerplate-modules/newmodule.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Answer the questions in this dialog, that means select the module name, the template for it (&lt;em&gt;0: application-001&lt;/em&gt; is perfect for the beginning), the location, and the author. When your are done with this, go into the directory of your new module and perform the following cleanup commands:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;your-module-path&amp;gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rm COPYING CREDITS Modulefile NOTICE README
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rm -rf files/ templates/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The cleanup is necessary to get you focused on the basics of testing. Now, your file structure should look like the following.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;-- manifests
    |-- init.pp
    |-- package.pp
    |-- params.pp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This structure follows the &lt;strong&gt;package, config, and service&lt;/strong&gt; (okay, we have &lt;code&gt;params.pp&lt;/code&gt; instead of &lt;code&gt;service.pp&lt;/code&gt; but this not bad because the module we create in this example isn&amp;#39;t a service) pattern as mentioned by R.I.Pienaar &lt;a href=&quot;http://www.devco.net/archives/2009/09/28/simple_puppet_module_structure.php&quot;&gt;blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The last step is to run &lt;code&gt;rspec-puppet-init&lt;/code&gt; in the directory of your module and it will create all the files for testing.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;your-module-path&amp;gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rspec-puppet-init
 + spec/
 + spec/classes/
 + spec/defines/
 + spec/functions/
 + spec/hosts/
 + spec/fixtures/
 + spec/fixtures/manifests/
 + spec/fixtures/modules/
 + spec/fixtures/modules/git/
 + spec/fixtures/manifests/site.pp
 + spec/fixtures/modules/git/manifests
 + spec/spec_helper.rb
 + Rakefile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And the file structure should be the following:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-&quot; data-lang=&quot;&quot;&gt;|-- manifests
|   |-- init.pp
|   |-- package.pp
|   `-- params.pp
|-- Rakefile
`-- spec
    |-- classes
    |-- defines
    |-- fixtures
    |   |-- manifests
    |   |   `-- site.pp
    |   `-- modules
    |       `-- git
    |           `-- manifests -&amp;gt; ../../../../manifests
    |-- functions
    |-- hosts
    `-- spec_helper.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The symlinks in the &lt;code&gt;spec/&lt;/code&gt; directory are linking the manifests folder into your spec folder, so that they are in the runpath of your specs when you run &lt;code&gt;rspec&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Testing, testing, and testing&lt;/h2&gt;

&lt;p&gt;First, we want to test that the class &lt;code&gt;git::package&lt;/code&gt; is created in &lt;code&gt;manifests/init.pp&lt;/code&gt; manifests. All we need to do is to create a spec named &lt;code&gt;init_spec.rb&lt;/code&gt; in the &lt;code&gt;spec/classes&lt;/code&gt; directory. To make it testable, we need to define a scope for our &lt;code&gt;init.pp&lt;/code&gt; manifest.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/init.pp&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;git::package&#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;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s do the test for it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/init_spec.rb&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;spec_helper&#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;git::init&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;git::packagee&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; Run &lt;code&gt;rake spec&lt;/code&gt; always from the root directory of your module!&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;your-module-path&amp;gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/init_spec.rb

git::init
  should contain Class[git::packagee] &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;FAILED - 1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

Failures:

  1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; git::init
     Failure/Error: it &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; should create_class&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;git::packagee&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)}&lt;/span&gt;
       expected that the catalogue would contain Class[git::packagee]
     &lt;span class=&quot;c&quot;&gt;# ./spec/classes/init_spec.rb:4:in `block (2 levels) in &amp;lt;top (required)&amp;gt;&#39;&lt;/span&gt;

Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.05637 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/classes/init_spec.rb:4 &lt;span class=&quot;c&quot;&gt;# git::init&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Duh, it&amp;#39;s red, what should we do? The catalog does not contain a class &lt;code&gt;git::packagee&lt;/code&gt;. Gosh, it&amp;#39;s a typo in our &lt;code&gt;init_spec.rb&lt;/code&gt; file. Let&amp;#39;s fix this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/init_spec.rb&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;spec_helper&#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;git::init&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;git::package&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And run our tests again:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/init_spec.rb

git::init
  should contain Class[git::package]

Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.03963 seconds
1 example, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&amp;#39;s green and running - perfect.&lt;/p&gt;

&lt;h2&gt;Testing the creation of a package with an attribute&lt;/h2&gt;

&lt;p&gt;Since we are now sure, that the &lt;code&gt;package&lt;/code&gt; manifests is integrated, it&amp;#39;s time to write a test, that we have the &lt;code&gt;git-core&lt;/code&gt; package in our package manifests. Let&amp;#39;s write &lt;code&gt;spec/classes/install_spec.rb&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/package_spec.pp&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;spec_helper&#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;git::package&#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;context&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;install git-core&#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contain_package&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;git-core&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;contains\_&amp;lt;resource&amp;gt;&lt;/code&gt; &lt;em&gt;matcher&lt;/em&gt; will test if the manifest contains a particular puppet resource.&lt;/p&gt;

&lt;p&gt;And run the tests again with &lt;code&gt;rake spec&lt;/code&gt; form the root directory of your module:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package[git-core] &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;FAILED - 1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

git::init
  should contain Class[git::package]

Failures:

  1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; git::package install git-core
     Failure/Error: it &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; should contain_package&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;git-core&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       expected that the catalogue would contain Package[git-core]
     &lt;span class=&quot;c&quot;&gt;# ./spec/classes/package_spec.rb:6:in `block (3 levels) in &amp;lt;top (required)&amp;gt;&#39;&lt;/span&gt;

Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.19843 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/classes/package_spec.rb:6 &lt;span class=&quot;c&quot;&gt;# git::package install git-core&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s edit &lt;code&gt;manifests/package.pp&lt;/code&gt; file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/package.pp&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;git-core&#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;And run the tests again:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package[git-core]

git::init
  should contain Class[git::package]

Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.19894 seconds
2 examples, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next we want to add the &lt;strong&gt;ensure&lt;/strong&gt; attribute to the get the latest version of the &lt;code&gt;git-core package&lt;/code&gt;. Let&amp;#39;s write a failing test first:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/package_spec.pp&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;spec_helper&#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;git::package&#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;context&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;install git-core&#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contain_package&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;git-core&#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;nf&quot;&gt;with_ensure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;latest&#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;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;with\_*&lt;/code&gt; and &lt;code&gt;without\_*&lt;/code&gt; &lt;em&gt;matcher&lt;/em&gt; can test the presence or absence of the parameter of resources. Run our tests, to see they are failing:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package[git-core] with ensure &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt; &lt;span class=&quot;s2&quot;&gt;&quot;latest&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;FAILED - 1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

git::init
  should contain Class[git::package]

Failures:

  1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; git::package install git-core
     Failure/Error: .with_ensure&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;latest&#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       expected that the catalogue would contain Package[git-core] with ensure &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;to &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;latest&quot;&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; but it is &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;to &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;nil&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the catalogue
     &lt;span class=&quot;c&quot;&gt;# ./spec/classes/package_spec.rb:7:in `block (3 levels) in &amp;lt;top (required)&amp;gt;&#39;&lt;/span&gt;

Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.19862 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/classes/package_spec.rb:6 &lt;span class=&quot;c&quot;&gt;# git::package install git-core&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Time to fix it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/package.pp&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;git-core&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;ensure&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;latest&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;If we run now our tests again, it should work:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package[git-core] with ensure &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt; &lt;span class=&quot;s2&quot;&gt;&quot;latest&quot;&lt;/span&gt;

git::init
  should contain Class[git::package]

Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.20456 seconds
2 examples, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you have problems with understanding the syntax of RSpec, just checkout the &lt;a href=&quot;http://pragprog.com/book/achbd/the-rspec-book&quot;&gt;&amp;quot;The RSpec Book&amp;quot;&lt;/a&gt; by David Chelimsky.&lt;/p&gt;

&lt;h2&gt;Refactor&lt;/h2&gt;

&lt;p&gt;Since we now have green tests, we can play with the code. Let&amp;#39;s make &lt;code&gt;manifests.init.pp&lt;/code&gt; nicer:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/init.pp&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# don&#39;t like the class declaration syntax: class { &#39;git::package&#39;: }&lt;/span&gt;
  &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# much better&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;Run the test:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package[git-core] with ensure &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt; &lt;span class=&quot;s2&quot;&gt;&quot;latest&quot;&lt;/span&gt;

git::init
  should contain Class[git::package]

Finished &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;0.20158 seconds
2 examples, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Your catalog is still valid. Have beer because you have written your first tests for puppet and refactored your first manifest.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Testing is important - even or especially with the environment settings for your systems. It take some time to get used to it and you will find it in the beginning very cumbersome to write the code double. But when you are writing 4000 lines of code long manifest you will be happy to have structure, and confidence in your code with your lovely tests.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://rspec-puppet.com/&quot;&gt;rspec-puppet page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://puppet-lint.com/&quot;&gt;puppet-lint page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bombasticmonkey.com/&quot;&gt;Tim Sharp - author of rspec-puppet and puppet-lint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://docs.puppetlabs.com/puppet_core_types_cheatsheet.pdf&quot;&gt;Puppet core type cheatsheet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Checking your HDD</title>
      <id>http://wikimatze.de/checking-your-hard-disk-drive</id>
      <link href="http://wikimatze.de/checking-your-hard-disk-drive"/>
      <published>2012-07-12T00:00:00+00:00</published>
      <updated>2012-07-12T00:00:00+00:00</updated>
      <category term="learning"/>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;Do one thing and do it well.&lt;/p&gt;
  &lt;strong&gt;Unix Philosophy&lt;/strong&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;This article describes a tool for testing your HDD on a daily basis and how can you fill it completely with zeros or random numbers to check it for broken sectors.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I was spending a whole day installing and configuring 4 different operating systems on my new Desktop PC - I didn&amp;#39;t use virtualization my Windows because I wanted to use it for gaming (especially &lt;a href=&quot;http://fallout.bethsoft.com/&quot;&gt;Fallout 3&lt;/a&gt;). After four weeks the disasters happened: My hard disk drive (HDD)was broken. Before spending a whole installing your new systems, it is worth spending a day to check your new HDD.&lt;/p&gt;

&lt;h2&gt;Symptoms of a breaking HDD&lt;/h2&gt;

&lt;p&gt;If you encounter any of the following things you can be sure that your HDD will break soon:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;working with Blue Screens and occasionally system fall downs&lt;/li&gt;
&lt;li&gt;problems with installing new OS - even on Knoppix&lt;/li&gt;
&lt;li&gt;overwriting the hard disk completely&lt;/li&gt;
&lt;li&gt;blinking LED even if you are not working - is a sign that the HDD disk is writing the content into still valid sectors&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Checking your new HDD with smartools&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Smartmontools&quot;&gt;Smartmontools&lt;/a&gt; is an analysis tool for Linux/Unix systems which allows you to check your hard disk - even on your regular usage. The program consists of two parts: &lt;code&gt;smartctl&lt;/code&gt; (checking and evaluating HDD parameters) and &lt;code&gt;smartd&lt;/code&gt; (is daemon to check your HDD on a regularly state).&lt;/p&gt;

&lt;p&gt;Install the tool with the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install smartmontools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Using smartctl for HDD diagnosing&lt;/h2&gt;

&lt;p&gt;To get an overview of your new HDD please perform:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo smartctl -A /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;-A&lt;/code&gt; options says that it will only print the vendor specific informations:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo smartctl -A /dev/sda
smartctl 6.2 2013-04-20 r3812 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;i686-linux-3.11.0-15-generic] &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;build&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Copyright &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;C&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

&lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; START OF READ SMART DATA SECTION &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt;
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
&lt;span class=&quot;gp&quot;&gt;ID# &lt;/span&gt;ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       199
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       114
177 Wear_Leveling_Count     0x0013   099   099   000    Pre-fail  Always       -       9
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   055   055   000    Old_age   Always       -       45
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       8
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       2076944882
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;By using the following command&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo smartctl --all /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;you will get all any information about your hard disk:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;smartctl --all /dev/sda
smartctl 6.2 2013-04-20 r3812 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;i686-linux-3.11.0-15-generic] &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;build&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Copyright &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;C&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

&lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; START OF INFORMATION SECTION &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt;
Model Family:     Samsung based SSDs
Device Model:     Samsung SSD 840 PRO Series
Serial Number:    S1ATNEAD710430B
LU WWN Device Id: 5 002538 5503e9703
Firmware Version: DXM05B0Q
User Capacity:    256.060.514.304 bytes &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;256 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Device is:        In smartctl database &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is:  SATA 3.1, 6.0 Gb/s &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;current: 6.0 Gb/s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Local Time is:    Sat Feb 22 08:38:14 2014 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

&lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; START OF READ SMART DATA SECTION &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt;
SMART overall-health self-assessment &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;result: PASSED

General SMART Values:
Offline data collection status:  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x00&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; 244&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Self-test routine &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;progress...
                    40% of &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;remaining.
Total &lt;span class=&quot;nb&quot;&gt;time &lt;/span&gt;to &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;Offline
data collection:        &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;53956&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; seconds.
Offline data collection
capabilities:            &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x53&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x0003&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x01&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Error logging supported.
                    General Purpose Logging supported.
Short self-test routine
recommended polling &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;:    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;   2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; minutes.
Extended self-test routine
recommended polling &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;:    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;  20&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; minutes.
SCT capabilities:          &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x003d&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
&lt;span class=&quot;gp&quot;&gt;ID# &lt;/span&gt;ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       199
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       114
177 Wear_Leveling_Count     0x0013   099   099   000    Pre-fail  Always       -       9
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   055   055   000    Old_age   Always       -       45
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       8
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       2077259002

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
 SPAN    MIN_LBA    MAX_LBA  CURRENT_TEST_STATUS
    1          0          0  Not_testing
    2          0          0  Not_testing
    3          0          0  Not_testing
    4          0          0  Not_testing
    5          0          0  Not_testing
  255  203828736  203894271  Read_scanning was never started
Selective self-test flags &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:
  After scanning selected spans, &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;NOT &lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt;-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Important of the output is the parameter &lt;strong&gt;&amp;quot;PASSED&amp;quot;&lt;/strong&gt;, it tells you that the test is over. You can perform longer tests of your hard disk with:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo smartctl -t long /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Depending on the size of your HDD, it takes some time. For checking a whole 500 GB the program runs about 80 minutes. It is even possible to check if your HDD has damage incurred during transporting the drive with the &lt;code&gt;conveyance&lt;/code&gt; option:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo smartctl -t conveyance /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Performing long time diagnostic with smartd&lt;/h2&gt;

&lt;p&gt;The first step is to give the daemon the permission to run checks in the background:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;vim /etc/default/smartmontools
&lt;span class=&quot;gp&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;start_smartd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Find the line with and uncomment it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# uncomment to start smartd on system startup&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# start_smartd=yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The configuration file for the daemon can be found under &lt;code&gt;/etc/smartd.conf&lt;/code&gt;. Here only one line is sufficient to check
all HDDs:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;DEVICESCAN -m matthias@wikimatze.de -M &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; /usr/share/smartmontools/smartd-runner
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s get through each line step-by-step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DEVICESCAN&lt;/code&gt;: will scan all HDDs in the range between &lt;code&gt;/dev/hd[a-I] .. /dev/sd[a-z]&lt;/code&gt;, which support SMART&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-m matthias@wikimatze.de&lt;/code&gt;: in case of an error, an email will be sent to this address&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-M&lt;/code&gt;: the frequency of emails departure

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-M exec&lt;/code&gt;: don&amp;#39;t send testmails&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-M test&lt;/code&gt;: send a testmail (when using this option, you must leave out the &lt;code&gt;/usr/share/smartmontools/smartd-runner&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-M daily&lt;/code&gt;: send daily reports Now it&amp;#39;s time to test our configuration: &lt;code&gt;bash $ smartd -q onecheck&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can check your internal mails with &lt;code&gt;$ sudo mail&lt;/code&gt; (you need install &lt;a href=&quot;http://www.postfix.org/&quot;&gt;Postfix&lt;/a&gt; on your OS) and rebooting the daemon:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;/etc/init.d/smartmontools restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you want to have a graphical client for this tool, you need to run:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install gsmartcontrol
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You need then to start the program in sudo mode to detect all HDDs &lt;code&gt;sudo gsmartcontrol&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Checking the whole space on your HDD&lt;/h2&gt;

&lt;p&gt;You know these tiny small &lt;code&gt;dd&lt;/code&gt; commands? No, it&amp;#39;s time to learn and understand them. They are very handy to fill your your whole HDD with lovely zeros and ones.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dd&lt;/code&gt; stands for &lt;strong&gt;data definition&lt;/strong&gt;. It has direct access on the hard disk and can read boot sectors - it is even used to
create iso files of CDs.&lt;/p&gt;

&lt;h3&gt;Writing zeros or random numbers&lt;/h3&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Take from the &lt;strong&gt;input file&lt;/strong&gt; (&lt;code&gt;if&lt;/code&gt;) the zeros (&lt;code&gt;/dev/zero&lt;/code&gt;) and write them on the &lt;strong&gt;output file&lt;/strong&gt; (&lt;code&gt;of&lt;/code&gt;) &lt;code&gt;/dev/sda&lt;/code&gt;. If
the command has written the whole hard disk, it will end.&lt;/p&gt;

&lt;h3&gt;Speeding up the process with faster writing&lt;/h3&gt;

&lt;p&gt;Normally, each block of the hard disk has the size of 512 KB. To set the blocksize on 1 MB (1024 KB), we can speed up the writing speed with the factor two. We can achieve do this with the &lt;code&gt;bs&lt;/code&gt; option.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda &lt;span class=&quot;nv&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1024
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Jump over errors&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;dd&lt;/code&gt; will end, if it detects a broken sector. With the &lt;code&gt;conv=noerror&lt;/code&gt; option, &lt;code&gt;dd&lt;/code&gt; will write till the HDD is full even over broken sectors:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;noerror &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda &lt;span class=&quot;nv&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1024
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Other useful parameters are &lt;code&gt;notrunc&lt;/code&gt; (write the output file completely) or &lt;code&gt;sync&lt;/code&gt; (write with the full length).&lt;/p&gt;

&lt;h3&gt;Running the dd command with status display&lt;/h3&gt;

&lt;p&gt;We can use the &lt;a href=&quot;http://manpages.ubuntu.com/manpages/dapper/man1/pv.1.html&quot;&gt;pv&lt;/a&gt; command to monitor the progress of data through a pipe. First we need to install it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install pv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To get an overview about how many MB or GB have already be written, use the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/random &lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;notrunc,sync &lt;span class=&quot;nv&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1024 | pv &amp;gt; /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;A broken HDD is a bad thing, but if you know the symptoms it saves you a lot of time because you you know that you have to buy new hardware. Always have backup on an external HDD to have a save data replacement.&lt;/p&gt;

&lt;p&gt;It is good to run a couple of tests before you start implementing your whole system.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sourceforge.net/apps/trac/smartmontools/wiki&quot;&gt;smartmontools project page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://help.ubuntu.com/community/Smartmontools&quot;&gt;smartmontools help on Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Creation of a Ruby Gem</title>
      <id>http://wikimatze.de/creation-of-a-ruby-gem</id>
      <link href="http://wikimatze.de/creation-of-a-ruby-gem"/>
      <published>2012-06-07T00:00:00+00:00</published>
      <updated>2012-06-07T00:00:00+00:00</updated>
      <category term="programming"/>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;Everything should be made as simple as possible, but not simple.&lt;/p&gt;
  &lt;strong&gt;Albert Einstein&lt;/strong&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;This article describes the crafting of a Ruby gem.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The situation: For &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; I wanted to get an overview of how many pages, links, when the last build was, how many images I used in my blog, and when I lastly updated my &lt;a href=&quot;https://bitbucket.org/wikimatze/&quot;&gt;Bitbucket repositories&lt;/a&gt;. But before we dive deep into the creation, I will explain what a gem is and how you get started with writing your own gem. Don&amp;#39;t be afraid if you are writing a gem that already exists, your goal is to learn how to write a gem.&lt;/p&gt;

&lt;h2&gt;Ruby Gem&lt;/h2&gt;

&lt;p&gt;A Ruby gem is a self contained Ruby application which is packed as software. It can be downloaded and then used in other programs.  Gems extends the core Ruby language through functions that are commonly used and may be of usage by other programmers. Many gems provides command line operations and help to automate tasks. Not all gems needs to contain a binary, like my &lt;a href=&quot;https://github.com/wikimatze/sweetie&quot;&gt;sweetie gem&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Basic structure of a Gem&lt;/h2&gt;

&lt;p&gt;Below is a typical structure of gem:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-&quot; data-lang=&quot;&quot;&gt;.
├── README.md
├── Rakefile
├── lib
│   ├── sweetie
│   │   ├── bitbucket.rb
│   │   ├── conversion.rb
│   │   └── helper.rb
│   │   ...
│   └── sweetie.rb
│   ...
├── spec
│   ├── sweetie_bitbucket_spec.rb
│   └── sweetie_conversion_spec.rb
│   ...
└── sweetie.gemspec
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A typical gem consists of the main class file (like &lt;code&gt;sweetie.rb&lt;/code&gt;). This file contains other ruby-files (normally a list of &lt;em&gt;require&lt;/em&gt; statements). The &lt;code&gt;README.md&lt;/code&gt; briefly explains what the gem does, how to install it, explains the license, and should include small use cases for the gem (please checkout the &lt;a href=&quot;https://github.com/wikimatze/sweetie/blob/master/README.md&quot;&gt;README&lt;/a&gt; of the sweetie gem to see what I mean). The &lt;code&gt;sweetie.gemspec&lt;/code&gt; file contains meta-information like who invented the gem, declare runtime environment dependencies, etc. A gem should have test-files, that other people can contribute to the Gem without damaging the main functionality.&lt;/p&gt;

&lt;h2&gt;Gemfile structure&lt;/h2&gt;

&lt;p&gt;First of all we create a &lt;code&gt;Gemfile&lt;/code&gt; which defines important informations for the &lt;a href=&quot;http://rubygems.org/&quot;&gt;rubygems.org&lt;/a&gt; website. The site shows the author, the sources, the homepage, and some statistics (e.g. how often the gem was installed) - and by the way, it&amp;#39;s a nice place to sniff in the code of other hackers.&lt;/p&gt;

&lt;p&gt;Here is an example &lt;code&gt;sweetie.gemspec&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;vg&quot;&gt;$:&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;push&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;../lib&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;sweetie/version&#39;&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Gem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Specification&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;name&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;sweetie&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;version&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;VERSION&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;date&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;2012-06-05&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;authors&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;&#39;Matthias Guenther&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;email&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;matthias.guenther@wikimatze.de&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;homepage&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;https://github.com/wikimatze/sweetie&#39;&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;summary&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%q{Be short and precice!}&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;description&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%q{Here you can write more and describe detailed features!}&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;files&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`git ls-files`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;test_files&lt;/span&gt;       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`git ls-files -- {test,spec,features}/*`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;require_paths&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;s2&quot;&gt;&quot;lib&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;extra_rdoc_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;s2&quot;&gt;&quot;README.md&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add_runtime_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;nokogiri&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&amp;gt;= 1.4.6&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add_runtime_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;json&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&amp;gt;= 1.6.1&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add_development_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;rake&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add_development_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;rspec&#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add_development_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;yard&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s explain the stuff which aren&amp;#39;t obvious:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$:.push&lt;/code&gt; - magic line that ensures &amp;quot;../lib&amp;quot; is in the load path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;require &amp;#39;sweetie/version&amp;#39;&lt;/code&gt; - we need this line, because the module &lt;code&gt;sweetie/version.rb&lt;/code&gt; contains the version number of the gem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.files&lt;/code&gt; -  uses a clever git command which lists all files under version-control - these files are directly included in the gem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.test_files&lt;/code&gt; - again, a clever git listing command with ruby&amp;#39;s &lt;code&gt;split()&lt;/code&gt; method - files that are used for testing the gem (the line supports &lt;a href=&quot;https://github.com/test-unit/test-unit&quot;&gt;TestUnit&lt;/a&gt;, &lt;a href=&quot;https://github.com/seattlerb/minitest&quot;&gt;MiniTest&lt;/a&gt;, &lt;a href=&quot;https://github.com/notahat/machinist&quot;&gt;Machinist&lt;/a&gt;, &lt;a href=&quot;https://github.com/rspec/rspec&quot;&gt;RSpec&lt;/a&gt;, &lt;a href=&quot;http://cukes.info/&quot;&gt;Cucumber&lt;/a&gt;, and others&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.require_paths&lt;/code&gt; - these paths will be added to &lt;em&gt;$LOAD_PATH&lt;/em&gt; when the gem is activated&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.summary&lt;/code&gt; - short summary of the gem&amp;#39;s description =&amp;gt; will be displayed when running &lt;code&gt;gem list -d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.description&lt;/code&gt; - a long description of this gem =&amp;gt; it goes more into detail than &lt;code&gt;s.summary&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.extra_rdoc_files&lt;/code&gt; - here you can add files which can be used for the &lt;a href=&quot;http://rubydoc.info&quot;&gt;RubyDoc&lt;/a&gt; site - here the .gemspec &lt;em&gt;README.md&lt;/em&gt; is the &amp;quot;main homepage&amp;quot; of the generated documentation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.add_runtime_dependency&lt;/code&gt; - additional gems that will be installed when using this gem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.add_development_dependency&lt;/code&gt; - additional gems needed when hacking on the gem (e.g.  &lt;a href=&quot;http://en.wikipedia.org/wiki/Rake_%28software%29&quot;&gt;Rake&lt;/a&gt; is used for building and deploying the gem)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Building and Installing the Gem&lt;/h2&gt;

&lt;p&gt;Once you have created some code (it doesn&amp;#39;t matter how small the code is, except it must be valid and tested ruby code), you should build it on your local machine before making it public:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;build&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gemspec&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Successfully&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;built&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;RubyGem&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Version&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you can install the gem &lt;em&gt;locally&lt;/em&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And test the installation with:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;irb&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;sweetie&#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&amp;#39;s working and you can experiment with the script locally.&lt;/p&gt;

&lt;h2&gt;Publishing your gem&lt;/h2&gt;

&lt;p&gt;First, you need to register on &lt;a href=&quot;http://rubygems.org/&quot;&gt;rubygems.org&lt;/a&gt;. After that you can push the gem there with one simple command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;push&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gem&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Pushing&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;RubyGems&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;org&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Successfully&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;registered&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;gem: &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&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;If you want to check if your gem is online, the console is your friend:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;

&lt;span class=&quot;nf&quot;&gt;sweetie&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&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;This will print all the gems which fit to the specified gem.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It is easy to write an gem for ruby. Start small, create a repository on &lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt; get something similar to &lt;em&gt;hello world&lt;/em&gt; running, test your code with , and create a briefly documentation (read &lt;a href=&quot;http://zachholman.com/posts/documentation/&quot;&gt;Zach Holman documentation talk&lt;/a&gt; to see why) about what the gem does, and give small examples. After this test your gem, deploy it on &lt;a href=&quot;http://rubygems.org/&quot;&gt;rubygems.org&lt;/a&gt; and spread the word about your accomplished on &lt;a href=&quot;http://www.twitter.com/&quot;&gt;twitter&lt;/a&gt; - time to drink a beer!&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://guides.rubygems.org/make-your-own-gem/&quot;&gt;Great article on rubygems.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rakeroutes.com/blog/lets-write-a-gem-part-one/&quot;&gt;Writing a ruby gem part one&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rakeroutes.com/blog/lets-write-a-gem-part-two/&quot;&gt;Writing a ruby gem part two&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://guides.rubygems.org/specification-reference/&quot;&gt;Gemspec specification&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Searching Haml files with ack</title>
      <id>http://wikimatze.de/searching-haml-files-with-ack</id>
      <link href="http://wikimatze.de/searching-haml-files-with-ack"/>
      <published>2012-05-14T00:00:00+00:00</published>
      <updated>2012-05-14T00:00:00+00:00</updated>
      <category term="vim"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article describes how you can configure your ack settings to search for additionals files.  UPATE: &lt;a href=&quot;http://petdance.com/&quot;&gt;Andy Lester&lt;/a&gt;, the author of ack, give me feedback about this article.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Recently I was working on a Rails project and was using Vim with the &lt;code&gt;:Ack &amp;lt;pattern&amp;gt;&lt;/code&gt; command to search after a certain typed string &amp;quot;Übreschrift&amp;quot; and would like to replace it with the correct version &amp;quot;Überschrift&amp;quot;. I typed into the console &lt;code&gt;:Ack Übreschrift&lt;/code&gt; and I couldn&amp;#39;t find a single match. What went wrong?&lt;/p&gt;

&lt;h2&gt;Questions to answer&lt;/h2&gt;

&lt;p&gt;Why couldn&amp;#39;t I find the file with that content? Was I in the wrong directory? No:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;-&amp;gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/git-repositories/brokenlifts
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Did I used the wrong pattern? No, I searched after the right word &amp;quot;Übreschrift&amp;quot;. Did I used the wrong command?  No, I tried &lt;code&gt;ack-grep&lt;/code&gt; in the terminal to search for other common words like &lt;em&gt;test&lt;/em&gt; or &lt;em&gt;string&lt;/em&gt; and could only find results in &lt;em&gt;.rb, *.js files but not in `&lt;/em&gt;.html.haml&lt;code&gt;files. Tada, found the mistake,&lt;/code&gt;ack&lt;code&gt;is per default not configured to include these very special file types. If your press&lt;/code&gt;ack -f&lt;code&gt;(thanks [Andy Lester](http://petdance.com/) for this note) you will get the output of all files ack will go through - and this command didn&amp;#39;t displayed&lt;/code&gt;*.html.haml` files.&lt;/p&gt;

&lt;h2&gt;Solve problems .ackrc&lt;/h2&gt;

&lt;p&gt;I created the &lt;code&gt;$HOME/.ackrc&lt;/code&gt; and added the entries to include these special filename:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;--type-add
&lt;span class=&quot;nv&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.html.haml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now my search worked and I got hits in &lt;code&gt;*.html.haml&lt;/code&gt; files for searching the term &amp;quot;Übreschrift&amp;quot;.&lt;/p&gt;

&lt;h2&gt;Further refinements&lt;/h2&gt;

&lt;p&gt;Since I&amp;#39;m working with Rails there are other file types like &lt;code&gt;sass, erb, less, scss, ..&lt;/code&gt; I would like to include into the search:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;--type-add
&lt;span class=&quot;nv&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.html.erb,.html.haml,.haml
--type-add
&lt;span class=&quot;nv&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.sass,.less,.scss
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And there might be directories I don&amp;#39;t want to have in my search path. Let&amp;#39;s ignore them and speed up our search:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# ignore certain file types&lt;/span&gt;
--type-set&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ignorables&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.log,.tmp,.pdf

&lt;span class=&quot;c&quot;&gt;# ignore whole directories&lt;/span&gt;
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;vendor
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;log
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;tmp
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;doc
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;coverage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you would like to see the specified files for your grep environment search, use &lt;code&gt;ack --help types&lt;/code&gt; - this will print all information you need. Here is an example:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ack --help types
&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt;
  --[no]actionscript .as .mxml
  --[no]ada          .ada .adb .ads
  --[no]asm          .asm .s
  --[no]batch        .bat .cmd
  --[no]binary       Binary files, as defined by Perl&lt;span class=&quot;s1&quot;&gt;&#39;s -B op (default: off)
  --[no]cc           .c .h .xs
  --[no]cfmx         .cfc .cfm .cfml
  --[no]cpp          .cpp .cc .cxx .m .hpp .hh .h .hxx
  --[no]csharp       .cs
  --[no]css          .css .sass .less .scss
  --[no]elisp        .el
  --[no]erlang       .erl .hrl
  --[no]fortran      .f .f77 .f90 .f95 .f03 .for .ftn .fpp
  --[no]haskell      .hs .lhs
  --[no]hh           .h
  --[no]html         .htm .html .shtml .xhtml .html.erb .html.haml .haml
  --[no]ignorables   .log .tmp .pdf
...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://betterthangrep.com/&quot;&gt;ack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Installing PostgreSQL gem under Ubuntu and Mac</title>
      <id>http://wikimatze.de/installing-postgresql-gem-under-ubuntu-and-mac</id>
      <link href="http://wikimatze.de/installing-postgresql-gem-under-ubuntu-and-mac"/>
      <published>2012-02-26T00:00:00+00:00</published>
      <updated>2012-02-26T00:00:00+00:00</updated>
      <category term="howto"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article describes how to install the postgresql gem (called &amp;#39;pg&amp;#39;) under your local machine.  The installation process is not trivial because you need to install the right packages under Ubuntu/Linux or set the specify the correct path for Mac.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I checked out a new rails app called &lt;a href=&quot;https://github.com/sozialhelden/brokenlift&quot;&gt;Brokenlifts&lt;/a&gt;. Brokenlifts in public transportation are annoying and limit the mobility of people in wheelchairs. The app provides status information from different operators on one page and shows how well they are performing.&lt;/p&gt;

&lt;p&gt;Ones I checked out the project I have detected that it uses &lt;a href=&quot;http://www.rhok.org/node/20654&quot;&gt;PostgreSQL&lt;/a&gt; as their database driver. I have never worked with it and I run into a couple of problems to get it running.&lt;/p&gt;

&lt;h2&gt;The problem&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;$ gem install pg&lt;/code&gt; brought me the following error message:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gem install pg
Building native extensions.  This could take a &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;...
/Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /Users/helex/bin &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;PATH, mode 040777
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

        /Users/helex/.rbenv/versions/1.9.2-p290/bin/ruby extconf.rb
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/path/to/pg_config
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;libpq-fe.h... no
Can&lt;span class=&quot;s1&quot;&gt;&#39;t find the &#39;&lt;/span&gt;libpq-fe.h header
&lt;span class=&quot;se&quot;&gt;\*\*\*&lt;/span&gt; extconf.rb failed &lt;span class=&quot;se&quot;&gt;\*\*\*&lt;/span&gt;
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;more
details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;opt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/include
  --with-opt-lib
  --without-opt-lib&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;opt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/lib
  --with-make-prog
  --without-make-prog
  --srcdir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.
  --curdir
  --ruby&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/Users/helex/.rbenv/versions/1.9.2-p290/bin/ruby
  --with-pg
  --without-pg
  --with-pg-dir
  --without-pg-dir
  --with-pg-include
  --without-pg-include&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/include
  --with-pg-lib
  --without-pg-lib&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/lib
  --with-pg-config
  --without-pg-config
  --with-pg_config
  --without-pg_config


Gem files will remain installed &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.13.2 &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;inspection.
Results logged to /Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.13.2/ext/gem_make.out
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What relevant about the mess up there is the following part:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/path/to/pg_config
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;libpq-fe.h... no
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ruby can&amp;#39;t find the relevant setting of the PostgreSQL installation. Let&amp;#39;s change this!&lt;/p&gt;

&lt;h2&gt;Solution for Mac&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;install PostgreSQL library as described on the &lt;a href=&quot;http://www.postgresql.org/download/macosx/&quot;&gt;PostgreSQL page&lt;/a&gt; (opening the &lt;code&gt;*.dmg&lt;/code&gt; file will install a bunch of stuff, so don&amp;#39;t be afraid of the amount of steps you have to perform)&lt;/li&gt;
&lt;li&gt;check if you can find the installation open it under &lt;code&gt;/Library/PostgreSQL/x.y&lt;/code&gt; - where x.y stands for the version you installed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Say you want to install the PostgreSQL manually with a &lt;code&gt;gem install&lt;/code&gt; - you have to perform the following command:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo &lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;:/Library/PostgreSQL/x.y/bin gem install pg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you want to install it with &lt;a href=&quot;http://gembundler.com/&quot;&gt;Bundle&lt;/a&gt;, run the following command&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo &lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;:/Library/PostgreSQL/x.y/bin bundle install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Please change the &lt;strong&gt;x.y&lt;/strong&gt; with the version you have installed. Thats it!&lt;/p&gt;

&lt;p&gt;If you have problems with &lt;code&gt;gcc&lt;/code&gt;, please look into the &lt;a href=&quot;http://stackoverflow.com/questions/26486163/gcc-4-9-1-in-os-x-yosemite-gcc-warning-couldn-t-understand-kern-osversion-1/26609483#26609483&quot; title=&quot;stackoverflow link&quot;&gt;stackoverflow link&lt;/a&gt; - thanks &lt;a href=&quot;https://disqus.com/by/AsadAkbar/&quot; title=&quot;Asad&quot;&gt;Asad&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Solution for Ubuntu/Linux&lt;/h2&gt;

&lt;p&gt;It is easier because you only have to install the right packages:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;sudo apt-get install postgresql
sudo apt-get install libpq-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now &lt;code&gt;gem install pg&lt;/code&gt; should work.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It can be a really pain if you want to install gems and don&amp;#39;t have the right dependencies on your machine but if you initially invest some time on the problem, you have your enlightenment.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Compiling Vim from source for Ubuntu and Mac with ruby and python support</title>
      <id>http://wikimatze.de/compiling-vim-from-source-for-ubuntu-and-mac-with-rbenv</id>
      <link href="http://wikimatze.de/compiling-vim-from-source-for-ubuntu-and-mac-with-rbenv"/>
      <published>2012-02-19T00:00:00+00:00</published>
      <updated>2012-02-19T00:00:00+00:00</updated>
      <category term="howto"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This article describes how to build &lt;a href=&quot;http://www.vim.org/&quot;&gt;Vim&lt;/a&gt; (vim and gvim) from the source and compile it against a predefined version of &lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;ruby&lt;/a&gt; installed with &lt;a href=&quot;https://github.com/sstephenson/rbenv/&quot;&gt;rbenv&lt;/a&gt;. In the first chapter I&amp;#39;m describing how to build it from source for Ubuntu. The second part describes how to build for &lt;a href=&quot;https://github.com/b4winckler/macvim/&quot;&gt;MacVim&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By installing Vim with ruby support from the sources, it is build against the system wide installation of ruby.  If you already installed Vim and/or ruby with &lt;code&gt;sudo apt-get install vim&lt;/code&gt; (or &lt;code&gt;sudo apt-get install ruby&lt;/code&gt;) or with &lt;code&gt;brew install vim&lt;/code&gt; (e.g.  &lt;code&gt;brew install ruby&lt;/code&gt;) if you are using OS X, remove it completely from your system to install the latest version of Vim.&lt;/p&gt;

&lt;h2&gt;Install rbenv&lt;/h2&gt;

&lt;p&gt;I&amp;#39;m installing &lt;em&gt;rbenv&lt;/em&gt; on different machines I created the following script (named &lt;em&gt;rbenv_install.sh&lt;/em&gt;) to install &lt;strong&gt;ruby 1.9.2-p320&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;
sudo rm -rf .rbenv
git clone git://github.com/sstephenson/rbenv.git .rbenv
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;export PATH=&quot;$HOME/.rbenv/bin:$PATH&quot;&#39;&lt;/span&gt; &amp;gt;&amp;gt; ~/.bash_profile

&lt;span class=&quot;c&quot;&gt;# install steps for rbenv-install command&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Downloads
sudo rm -rf ruby-build
git clone git://github.com/sstephenson/ruby-build.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ruby-build
sudo bash install.sh

&lt;span class=&quot;c&quot;&gt;# updating the current shell&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SHELL&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.bash_profile

rbenv-install 1.9.2-p290
rbenv rehash
&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SHELL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After this try the following:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rbenv global 1.9.2-p320
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;rbenv &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;1.9.2-p320
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;ruby -v
&lt;span class=&quot;gp&quot;&gt;=&amp;gt; &lt;/span&gt;ruby 1.9.2p320 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2012-04-20 revision 35421&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;i686-linux]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Get the latest version of Python&lt;/h2&gt;

&lt;p&gt;This will be put in the &lt;code&gt;$HOME/lib&lt;/code&gt; folder:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar xjvf Python-2.7.3.tar.bz2
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;Python-2.7.3
./configure --prefix&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;
make &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; make install
make inclinstall
&lt;span class=&quot;nb&quot;&gt;hash&lt;/span&gt; -r

&lt;span class=&quot;c&quot;&gt;# cleanup&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm -rf Python-2.7.3

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Get the latest version of Vim&lt;/h2&gt;

&lt;p&gt;Visit &lt;a href=&quot;http://www.vim.org/download.php/&quot;&gt;vim.org&lt;/a&gt; and select the right download for your operation system (mainly Unix).  If you are using a Unix system yo can get the latest Vim from &lt;a href=&quot;ftp://ftp.vim.org/pub/vim/unix/&quot;&gt;here&lt;/a&gt;, download and unzip it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Downloads
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;tar -xjvf vim-7.4.tar.bz2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can also get the latest Vim version from the git repository &lt;a href=&quot;https://github.com/b4winckler/vim&quot;&gt;https://github.com/b4winckler/vim&lt;/a&gt; and checkout the latest tag you want to have.&lt;/p&gt;

&lt;h2&gt;Compiling Vim and Gvim&lt;/h2&gt;

&lt;p&gt;To install Gvim on Ubuntu we need to install additional packages on our machine. The following snippets describe the packages for Ubuntu:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;sudo apt-get install libncurses-dev libgnome2-dev &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 libx11-dev libxpm-dev libxt-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next, we need to configure the compilation and make the install:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/git-repositories/vim &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git checkout v7-4-183 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git clean -f

./configure --prefix&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --without-x &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --disable-nls &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --enable-gui&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;no &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --enable-multibyte &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --enable-rubyinterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --enable-luainterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --enable-pythoninterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --with-python-config-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/lib/python2.7/config &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --enable-gui&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;gnome2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --with-features&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;huge &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  --with-tlib&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ncurses &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;

sudo make &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo make install &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo make clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;#39;s get over the heavy stuff:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--prefix=/usr/local&lt;/code&gt; - place of the binaries of the installed Vim installation (check the &lt;code&gt;/usr/local/bin&lt;/code&gt;) - there will be the executable binaries&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--enable-rubyinterp&lt;/code&gt; - says you want to build Vim with the default ruby installation (in our case &lt;code&gt;/home/mg/.rbenv/shims/ruby&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--enable-gui=gnome2&lt;/code&gt; - building Vim with Gvim support (if you don&amp;#39;t want Gvim than you can leave this line out)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After configuring the compilation check if the console response contains the following terms:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;checking --with-ruby-command argument... defaulting to ruby
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;ruby... &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;cached&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; /home/mg/.rbenv/shims/ruby
checking Ruby version... OK
checking Ruby header files... /home/mg/.rbenv/versions/1.9.2-p320/include/ruby-1.9.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you can&amp;#39;t see the lovely &lt;strong&gt;Ok&lt;/strong&gt;, your Vim compilation will probably not have ruby support. Maybe you have not installed ruby the right way or some packages are missing on your machine.&lt;/p&gt;

&lt;h2&gt;Check the installation&lt;/h2&gt;

&lt;p&gt;Open a new session or perform &lt;code&gt;exec $SHELL&lt;/code&gt; to reboot your Shell. You will see the fresh installed version of Vim:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;which vim
/usr/local/bin/vim

&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;which gvim
/usr/local/bin/gvim
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next check is to get the correct --version of &lt;code&gt;vim&lt;/code&gt; and &lt;code&gt;gvim&lt;/code&gt; with the following commands:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;vim --version | ack ruby
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;vim --version | ack python
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gvim --version | ack ruby
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;gvim --version | ack python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If both commands return &lt;strong&gt;+ruby&lt;/strong&gt; and &lt;strong&gt;+python&lt;/strong&gt;, you are fine, and got the achievement &lt;em&gt;&amp;quot;I installed vim form source with ruby support on my own&amp;quot;&lt;/em&gt;. You should now be able to run the &lt;a href=&quot;https://github.com/wikimatze/hammer.vim&quot;&gt;Hammer.vim&lt;/a&gt; plugin - install it, start it with &lt;code&gt;:Hammer&lt;/code&gt;, install the missing gems and if you are able to run &lt;code&gt;:Hammer&lt;/code&gt; without any missing dependencies, you have setup everything correct.&lt;/p&gt;

&lt;h2&gt;Installing MacVim from source&lt;/h2&gt;

&lt;p&gt;The ways are nearly the same as mentioned above: Install rbenv as mentioned in the steps before.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Download
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;git clone git://github.com/b4winckler/macvim.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next step is to &lt;strong&gt;configure&lt;/strong&gt; MacVim for OSX:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;macvim/src
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;./configure --prefix&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --with-features&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;huge &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-rubyinterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-pythoninterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-perlinterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-cscope
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After configuring the compilation check the console response after the following terms:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;checking --with-ruby-command argument... defaulting to ruby
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;ruby... /Users/helex/.rbenv/shims/ruby
checking Ruby version... OK
checking Ruby header files... /Users/helex/.rbenv/versions/1.9.2-p320/include/ruby-1.9.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When this is finished, it is time &lt;code&gt;build&lt;/code&gt; MacVim with make:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;make
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Next step is to run the MacVim installation:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;open MacVim/build/Release/MacVim.app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The window should open MacVim. Run the following command in the MacVim quickfix window:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;:ruby puts &lt;span class=&quot;s2&quot;&gt;&quot;MacVim&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In the next step, you can drop the &lt;strong&gt;MacVim.app&lt;/strong&gt; icon in your Application folder and you are done.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It was a pain to gather the information for building vim by source with rbenv. Duration of finding that was: ~ &lt;strong&gt;6 h&lt;/strong&gt;.  I&amp;#39;m not sure if all of this works on &lt;a href=&quot;https://rvm.beginrescueend.com/&quot;&gt;RVM&lt;/a&gt; - I just need additional feedback from people using it. Happy &lt;em&gt;&amp;quot;Vim-ing&amp;quot;&lt;/em&gt;!&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://vim.wikia.com/wiki/Building_Vim&quot;&gt;Building Vim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://arjanvandergaag.nl/blog/compiling-vim-with-ruby-support.html&quot;&gt;Vim with ruby support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/b4winckler/macvim/wiki/Building&quot;&gt;Building MacVim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>SMART principle</title>
      <id>http://wikimatze.de/smart-principle</id>
      <link href="http://wikimatze.de/smart-principle"/>
      <published>2012-01-12T00:00:00+00:00</published>
      <updated>2012-01-12T00:00:00+00:00</updated>
      <category term="learning"/>
      <content type="html">&lt;p&gt;&lt;em&gt;This post is about the SMART principle that helps you to start and keep rolling projects. I outlined how I use SMART for my eBook project.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I recently read the book &lt;a href=&quot;http://pragprog.com/the-pragmatic-programmer&quot;&gt;Pragmatic Programmer&lt;/a&gt;, in which &lt;a href=&quot;http://en.wikipedia.org/wiki/Dave_Thomas_programmer&quot;&gt;Dave Thomas&lt;/a&gt; explained the &lt;em&gt;SMART&lt;/em&gt; principle. SMART is an acronym and each character of the principle has the following meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;S&lt;/strong&gt; (&lt;em&gt;specific goal&lt;/em&gt;): What is the goal of the new project you want to start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;M&lt;/strong&gt; (&lt;em&gt;measurable&lt;/em&gt;): List all the features you need to accomplish to start the project.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A&lt;/strong&gt; (&lt;em&gt;action&lt;/em&gt;):  When will you start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;R&lt;/strong&gt; (&lt;em&gt;realistic&lt;/em&gt;): Is the project small enough to finish it in the specified time frame demanded time frame.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;T&lt;/strong&gt; (&lt;em&gt;time&lt;/em&gt;): In the beginning of July 2012 everything should be fine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Putting theory into practice&lt;/h2&gt;

&lt;p&gt;Late in 2011, I started a new and personally ambitious project: Writing an eBook about the great web framework &lt;a href=&quot;http://www.padrinorb.com/&quot; title=&quot;Padrino&quot;&gt;Padrino&lt;/a&gt;. In a first step, I created a rough road map, about what I wanted to write and which topics should be covered. After writing the intro section and pushing the resources to &lt;a href=&quot;https://github.com/wikimatze/padrino-book&quot; title=&quot;GitHub&quot;&gt;GitHub&lt;/a&gt; I did something very crazy and mentioned &lt;a href=&quot;https://twitter.com/padrinorb&quot;&gt;@padrinorb&lt;/a&gt; in one of my tweets and this was it -- the authors of the framework motivated me with with writing the book. They retweeted every small progress I made with the project and through that I got further pull requests and even a bunch of interested followers who are watching the project.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://img.skitch.com/20111105-d9cjedpatps5wch3g5bbi6u1km.jpg&quot; class=&quot;center&quot; alt=&quot;Beginning of something great&quot;/&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Beginning of something great&lt;/div&gt;

&lt;p&gt;Let&amp;#39;s see how I can formulate the Book project with SMART:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;S&lt;/strong&gt; (&lt;em&gt;specific goal&lt;/em&gt;) - I want to learn how to write a eBook easily about Padrino web framework&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;M&lt;/strong&gt; (&lt;em&gt;measurable&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;create a roadmap about the topics of the book&lt;/li&gt;
&lt;li&gt;find a method to write book in one format and export the as PDF, EPUB, MOBI, and HTML format&lt;/li&gt;
&lt;li&gt;get really involved in Open source community and communicate with them&lt;/li&gt;
&lt;li&gt;find an audience and get help from other people&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A&lt;/strong&gt; (&lt;em&gt;action&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;start as soon as possible&lt;/li&gt;
&lt;li&gt;try to write everyday one chapter of the book&lt;/li&gt;
&lt;li&gt;tweet about the progress I made everyday&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;R&lt;/strong&gt; (&lt;em&gt;realistic&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;it is a big project (never have written a book before) but continuously delivery will motivate me during this long
period&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;T&lt;/strong&gt; (&lt;em&gt;time&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;till February 2012 everything should be finished&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I set up the frame of SMART goals and developed a rough plan - that&amp;#39;s all you need to let come your dreams true.&lt;/p&gt;

&lt;p&gt;The SMART principle was first mentioned in 1981 as an issue of Management Review by George T. Doran.&lt;/p&gt;

&lt;h2&gt;Cost for SMART&lt;/h2&gt;

&lt;p&gt;To be honest, writing of my Padrino eBook project consumes a lot of my free time so I in the near future I will publish only a few new entries on this blog. I have many ideas and topics I want to cover, but first I will finish this book to deepen my writing experience. I&amp;#39;m glad to hear your opinion (or contribution) to the &lt;a href=&quot;https://github.com/wikimatze/padrino-book&quot;&gt;book&lt;/a&gt; - I will put every contributer on the special thanks &lt;a href=&quot;https://github.com/wikimatze/padrino-book/blob/master/README.md&quot;&gt;list&lt;/a&gt; of the book.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;SMART is great if you want to start in small steps to begin with something completely new, learn much about it, and report (for example, I&amp;#39;m using the twitter Hashtag &lt;strong&gt;#dailywriting, #padrinobook&lt;/strong&gt;) about the progress you made.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://sebastianguenther.org/&quot; title=&quot;Sebastian Guenther&quot;&gt;&lt;strong&gt;Sebastian Guenther&lt;/strong&gt;&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Global Coderetreat 2011 in Berlin</title>
      <id>http://wikimatze.de/global-code-retreat-2011</id>
      <link href="http://wikimatze.de/global-code-retreat-2011"/>
      <published>2011-12-04T00:00:00+00:00</published>
      <updated>2011-12-04T00:00:00+00:00</updated>
      <category term="programming"/>
      <content type="html">&lt;p&gt;I attended the &lt;a href=&quot;http://coderetreat.org/&quot;&gt;&lt;strong&gt;Global Coderetreat&lt;/strong&gt;&lt;/a&gt; event initialized by &lt;a href=&quot;http://coreyhaines.com/&quot;&gt;Corey Haines&lt;/a&gt;. The general purpose of this event was to get a bunch of hackers together to implement &lt;a href=&quot;http://en.wikipedia.org/wiki/Conway&amp;#x27;s_Game_of_Life&quot;&gt;Conway&amp;#39;s Game of Life&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7029/6452198253_ca6e01b7f4_b.jpg&quot; title=&quot;Coderetreat@Immobilienscout - Photo was taken from http://www.flickr.com/photos/60906583@N08/6452198253/&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7029/6452198253_ca6e01b7f4_z.jpg&quot; class=&quot;center&quot; alt=&quot;Coderetreat@Immobilienscout - Photo was taken from http://www.flickr.com/photos/60906583@N08/6452198253/&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Setting up goals&lt;/h2&gt;

&lt;p&gt;As &lt;strong&gt;J. B. Rainsberger&lt;/strong&gt; mentioned in his &lt;a href=&quot;http://www.jbrains.ca/permalink/the-four-elements-of-simple-design&quot;&gt;article&lt;/a&gt; four elements of
simple design, it is best to setup goals for your retreat to get most out of it. Here is a list of what I achieved in each session:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Being a mentor of TDD: I taught &lt;a href=&quot;https://github.com/dedan&quot;&gt;dedan&lt;/a&gt; how to use TDD, why TDD helps you to think about your design.&lt;/li&gt;
&lt;li&gt;Being a mentor of BDD: Showing a fellow Rubyist how to do BDD.&lt;/li&gt;
&lt;li&gt;Doing something completely stupid: I played &lt;em&gt;evil coder&lt;/em&gt; and &lt;em&gt;ping-pong pairing&lt;/em&gt; with &lt;a href=&quot;http://twitter.com/#!/tilosoenke&quot;&gt;@tilosoenke&lt;/a&gt; - we couldn&amp;#39;t communicate with words, only with code, one writing tests and other the implementation of the tests.&lt;/li&gt;
&lt;li&gt;Discuss about names: We said together and discussed about right names for methods, variables, and classes. We concluded that good names saves you scary comments in your code.&lt;/li&gt;
&lt;li&gt;Explain Ruby to a Java-Programmer.&lt;/li&gt;
&lt;li&gt;Being mentored about Lisp: We solved the whole &amp;#39;Game of Live&amp;#39; in common &lt;a href=&quot;http://en.wikipedia.org/wiki/Lisp_(programming_language)&quot;&gt;Lisp&lt;/a&gt; , while &lt;a href=&quot;http://twitter.com/#!/hanshuebner&quot;&gt;@HansHuebener&lt;/a&gt; explained me the strength and beauty Common Lisp.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It was great to get so many people with so many different skills and mindsets together, exchange experience and encouraging others to try something new. I will definitely have a closer look on Lisp to enhance my Ruby programming style.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://sebastianguenther.org/&quot; title=&quot;Sebastian Guenther&quot;&gt;&lt;strong&gt;Sebastian Guenther&lt;/strong&gt;&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Benefits of Scala</title>
      <id>http://wikimatze.de/benefits-of-scala</id>
      <link href="http://wikimatze.de/benefits-of-scala"/>
      <published>2011-10-29T00:00:00+00:00</published>
      <updated>2011-10-29T00:00:00+00:00</updated>
      <category term="programming"/>
      <content type="html">&lt;p&gt;When a new programming language is created, it came from a desire of one person or a group of to do it better than their forerunner. It&amp;#39;s an evolutionary process that humans are trying to improve themselves if something doesn&amp;#39;t as they want it to.  Sometimes it&amp;#39;s only a small piece of improvement which creates an absolutely new feeling about something. By designing a new programming language you have a great pool of existing languages: LISP (1958), Smalltalk (1970), C++ (1979), Python (1991) and Ruby (1995). Today it is often told not to waste your time on building up an new language from the scratch. It&amp;#39;s time-consuming and why should you invent the wheel a second time? I think this is normal. If you spend some time reading about the languages mentioned above, you will see that older language have still a great influence on new ones. Today, it is common to use DSLs (they are used extensively in Rails) to create new languages. Not
everything happened in the past was bad and sometimes if you stick your head into some old forgotten technology you may find some diamonds.&lt;/p&gt;

&lt;p&gt;This was the main idea of Odersky when he created Scala. It is the first language which is a real hybrid language and combines the invigorations of OOP and FP.&lt;/p&gt;

&lt;h2&gt;Facts about Scala&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scala is ideal for today&amp;#39;s scalable, distributed, component-based applications that support concurrency and distribution.&lt;/li&gt;
&lt;li&gt;Scala is &lt;em&gt;statically typed&lt;/em&gt; that means that the type of some variable is immutable during the whole execution of the program.&lt;/li&gt;
&lt;li&gt;There is modular &lt;em&gt;mixin-composition for classes&lt;/em&gt; - some hack to enable multiple inheritance in Scala, which solves the diamond problem through linearity of the inheritance hierarchy via &lt;em&gt;traits&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Support of functions that may have other functions as arguments which enables using anonymous functions.&lt;/li&gt;
&lt;li&gt;Lower risk to use Scala in an existing Java Application because Scala works &lt;em&gt;seamless&lt;/em&gt; with existing Java Code.&lt;/li&gt;
&lt;li&gt;high level type system with &lt;em&gt;variance annotations&lt;/em&gt;, &lt;em&gt;compound types, lower and upper bounds for types&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;usage of &lt;em&gt;inner and anonymous classes&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;implicit conversions&lt;/em&gt; - that means a function take one type as an argument and returns to another type (like converting an Integer into String)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Scala is a very rich language which combines many features of different languages. It&amp;#39;s great if you have to make different sections of your code cleaner, faster and conciser. See &lt;a href=&quot;http://www.scala-lang.org/node/6436&quot;&gt;Scala at LinkedIn&lt;/a&gt; to know what I mean.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;em&gt;Hanna Schütt&lt;/em&gt; and &lt;a href=&quot;http://sebastian-gerth.eu&quot; title=&quot;Sebastian Gerth&quot;&gt;Sebastian Gerth&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Lisp_%28programming_language%29&quot;&gt;LISP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Smalltalk&quot;&gt;Smalltalk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.cplusplus.com&quot;&gt;C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.python.org/&quot;&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Domain-specific_language&quot;&gt;DSLs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Diamond_problem&quot;&gt;diamond problem&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Mail Client in Java</title>
      <id>http://wikimatze.de/email-client-in-java</id>
      <link href="http://wikimatze.de/email-client-in-java"/>
      <published>2011-10-22T00:00:00+00:00</published>
      <updated>2011-10-22T00:00:00+00:00</updated>
      <category term="howto"/>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;Most people spend more time and energy going around problems than trying to solve them.&lt;/p&gt;
  &lt;strong&gt;Henry Ford&lt;/strong&gt;
&lt;/blockquote&gt;

&lt;p&gt;During the summer term 2007 we had the task to create a &lt;a href=&quot;http://www.mozilla.org/en-US/thunderbird&quot;&gt;Thunderbird&lt;/a&gt; like email client &lt;a href=&quot;http://www.java.com/de/download/manual.jsp&quot;&gt;Java&lt;/a&gt;.  The GUI should be created either with &lt;a href=&quot;http://java.sun.com/docs/books/tutorial/uiswing/&quot;&gt;Swing&lt;/a&gt; or &lt;a href=&quot;http://java.sun.com/javase/6/docs/technotes/guides/awt/&quot;&gt;AWT&lt;/a&gt;. Beside the graphical implementation, we had to check and study the functionality of &lt;a href=&quot;http://en.wikipedia.org/wiki/Post_Office_Protocol&quot;&gt;POP3&lt;/a&gt; and
&lt;a href=&quot;http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol&quot;&gt;SMTP&lt;/a&gt;. Only the correct numbers in this protocols are important because they stands for each transactions if it was a success or a failure.  A first attempt this functionality was done with plain old &lt;em&gt;sockets&lt;/em&gt; to get a feeling how POP3 and SMTP works.&lt;/p&gt;

&lt;p&gt;After we a running function the basic functions of the mail client, we had to implement some extra-functions like attachments (mime parts in an email) or the handling of emails with drag-and-drop. I implemented this big project with the help of &lt;a href=&quot;http://netbeans.org/&quot;&gt;NetBeans IDE&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Images&lt;/h2&gt;

&lt;p&gt;By means of the following images I will describe the basic layout of my email client.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7228/7257429146_a8e69185f7_b.jpg&quot; title=&quot;The basic surface when the program starts.  If you press on the upper task bar a drag-and-drop menu will open.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7228/7257429146_a8e69185f7_z.jpg&quot; class=&quot;center&quot; alt=&quot;The basic surface when the program starts.  If you press on the upper task bar a drag-and-drop menu will open.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;The basic surface when the program starts. If you press on the upper task bar a drag-and-drop menu will open.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7071/7257429010_90c8c37b00_z.jpg&quot; title=&quot;In this window you can add data of a new account.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7071/7257429010_90c8c37b00.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_2.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;In this window you can add data of a new account.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8022/7257428772_387fce2670_b.jpg&quot; title=&quot;Get the mail of an already existing account.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8022/7257428772_387fce2670.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_3.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Get the mail of an already existing account.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7243/7257428880_ebf4f8e24c_z.jpg&quot; title=&quot;The window where to write a new email.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7243/7257428880_ebf4f8e24c.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_4.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;The window where to write a new email.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7088/7257428050_f021ac4ffc.jpg&quot; title=&quot;Drag-and-Drop window to manage emails.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7088/7257428050_f021ac4ffc_n.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_5.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Drag-and-Drop window to manage emails.&lt;/div&gt;

&lt;h2&gt;Installation for NetBeans&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;get the &lt;a href=&quot;https://github.com/wikimatze/mailclient&quot;&gt;sources from github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;extract the &lt;em&gt;javamail-1.4.zip&lt;/em&gt; =&amp;gt; this package contains a Java library for handling emails&lt;/li&gt;
&lt;li&gt;create a new project under NetBeans and copy all files of the &lt;em&gt;Mail Client&lt;/em&gt; directory in the &lt;em&gt;src&lt;/em&gt; directory of you
NetBeans project&lt;/li&gt;
&lt;li&gt;then you have to insert the &lt;em&gt;mail.jar&lt;/em&gt; file in your project in the following way:

&lt;ul&gt;
&lt;li&gt;click right on Libraries in the near of the view of your NetBeans project and chose &lt;em&gt;Add JAR&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;navigate to &lt;em&gt;javamail-1.4&lt;/em&gt; folder and select the &lt;em&gt;mail.jar&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;when you now select the files &lt;em&gt;GUIMailsend.java&lt;/em&gt; and &lt;em&gt;GUIMailsget.java&lt;/em&gt; should not show any errors&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;now you have to adopt the paths in the file &lt;em&gt;GUIMain.java&lt;/em&gt; &lt;code&gt;(static File f, String dir, FileReader file)&lt;/code&gt; and
&lt;em&gt;GUITree&lt;/em&gt; &lt;code&gt;(File driveC, File source, File ziel)&lt;/code&gt; to your NetBeans project folder through absolute paths =&amp;gt; I know
it&amp;#39;s cumbersome but due to this date I couldn&amp;#39;t do any other&lt;/li&gt;
&lt;li&gt;set the &lt;em&gt;GuiMain.java&lt;/em&gt; as the main file in your project and start the program&lt;/li&gt;
&lt;li&gt;the standard account is &lt;em&gt;MG kontoinfos.kondat&lt;/em&gt; which contains the necessary data to access my spam account (you can
guess how to change the data)&lt;/li&gt;
&lt;li&gt;the directory &lt;em&gt;Inbox MG&lt;/em&gt; saves all read mails of the user MG, further accounts have to be created each in an own
directory&lt;/li&gt;
&lt;li&gt;&lt;em&gt;MailApi.java&lt;/em&gt; is not necessary for the mail client, this will be used to check the correctness of the POP3
settings via the terminal&lt;/li&gt;
&lt;li&gt;main cause of error messages:

&lt;ul&gt;
&lt;li&gt;wrong paths to your project&lt;/li&gt;
&lt;li&gt;POP3 and SMTP&lt;/li&gt;
&lt;li&gt;&lt;em&gt;mail.jar&lt;/em&gt; is not included correct in the project, but this will be shown in NetBeans&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This project was my first big piece of software and I used all my gathered knowledge about Java. The classes are not bug-free, manually tested, has a size over 1000 LOCs, has absolute paths, and the function are sometimes very big. In the end it was just hacking down the software without using certain patterns or careful development with clean code. I tested my code with &lt;code&gt;System.out.println&lt;/code&gt; and I lost much time with this stupid testing. One good thing I did: I created comments and was able to get the program running even after two year.&lt;/p&gt;

&lt;p&gt;Nowadays programming methodologies like &lt;a href=&quot;http://en.wikipedia.org/wiki/Agile_software_development&quot;&gt;Agile&lt;/a&gt;, Rapid-Prototyping or Model-Driven development together with the framework Rails let you develop my application with much more less effort and is more maintainable by driving the Test-Driven way- you can refactor your code and don&amp;#39;t need to manual test part of your basis if you have tests available.&lt;/p&gt;

&lt;p&gt;This project shows that it is possible to develop modular software in Java but in even greater projects it is easy to get lost in the lost in Java code if you don&amp;#39;t rely on a framework.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Benefits of reading a book - and use it right after that</title>
      <id>http://wikimatze.de/benefits-of-reading-a-book-and-use-it-right-after-that</id>
      <link href="http://wikimatze.de/benefits-of-reading-a-book-and-use-it-right-after-that"/>
      <published>2011-10-15T00:00:00+00:00</published>
      <updated>2011-10-15T00:00:00+00:00</updated>
      <category term="reading"/>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;We are what we repeatedly do. Excellence, then, is not an act, but a habit.&lt;/p&gt;
    &lt;strong&gt;Aristotle&lt;/strong&gt;
&lt;/blockquote&gt;

&lt;p&gt;It&amp;#39;s a typical situation which every person knows: You look on your workspace and have a bunch of new books there. You ordered them because some great guys lay their hands in the fire that you need this wisdom. You have to do a stressful job and don&amp;#39;t have time to read all the things but you still must learn new things in order to develop new skills. What should you do? The simple answer is start reading!&lt;/p&gt;

&lt;h2&gt;What you should do during the process of reading&lt;/h2&gt;

&lt;p&gt;Don&amp;#39;t read books and put it away, read trough the table of contents, mark the parts which are interesting for you and draw a mind map. If you have questions which should be answered by the book, it&amp;#39;s good because then you will read the book with much more focus on them.&lt;/p&gt;

&lt;p&gt;Don&amp;#39;t think of reading the book like in school: Cram for a test about it, get a good grade and then forget everything.  This isn&amp;#39;t good and a waste of time. Don&amp;#39;t say you don&amp;#39;t have time, think of allocating your time effective. For me it&amp;#39;s the best, to use the new knowledge out of the book. This is the best way to get the most out of it. What you&amp;#39;re right using is just as good as cooking a new meal right after reading the recipe of it. You inherit the procedure you recently learned with your own mind, own feelings, own observations and add your own style (think of your own ingredients in your favorite meal).&lt;/p&gt;

&lt;h2&gt;Benefits of note taking&lt;/h2&gt;

&lt;p&gt;Years after reading the book you will maybe come in the situation where you need some of the knowledge you have read of this certain book you read it a lot of years ago. You know the title of the book but can&amp;#39;t remember anything.  Before I explain the advantage of taking notes during reading a book, I suggest you my different methods for taking notes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;a pencil and a sheet of paper (which I personal prefer)&lt;/li&gt;
&lt;li&gt;Netbook/iPad/cellphone (there you can directly take your notes)&lt;/li&gt;
&lt;li&gt;you can use post-it or stick it to mark important passages&lt;/li&gt;
&lt;li&gt;speaking notes of certain passages which you find very interesting&lt;/li&gt;
&lt;li&gt;read an eBook with your kindle, iPhone or some other devices in
which you can take custom-notes about something&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The disadvantages of 1, 2 and 3 are carry the notes respectively the book with you (think you are on your trip to America and don&amp;#39;t want to fill your hole luggage with tons of books or do you want to travel without your favorite Simpsons trousers).&lt;/p&gt;

&lt;p&gt;Method 4 is a reminder of important passages. If such a file is very long you have problems in searching the needed sections - you have to play forward and back and this is boring. Don&amp;#39;t forget the amount of space which you need to store it. The advantage is, that you can easily take notes and train your language when your tongue is on air.&lt;/p&gt;

&lt;p&gt;The usage of a specialized device for eBook-reading is a great opportunity. You can have many books on on your device, set bookmarks and can take notes. I think writing notes without a keyboard may have a worse usability - maybe with the iPad 2 its more easier. If you are used to this technology and you are are good then use it. You can make it public or lock it with a certain password. But why hidden your knowledge so that no other one can see it? Let other benefit by your conclusions and wisdom.&lt;/p&gt;

&lt;p&gt;Personally for me the best method is to write my impressions of a read book on a sheet of paper and transform with my PC later. A further step may be publishing your notes to your website - you have the possibility to access your thoughts via an Internet connection. I&amp;#39;m using a desktop-wiki &lt;a href=&quot;http://zim-wiki.org&quot;&gt;zim&lt;/a&gt; and wrote a bunch of handy scripts, which transform the text directly in format of my web page.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;If I had known early I would have started with this methods during my education at school. But better later then never.  If I travel for a longer period and have a book with me, it has still some sheets of papers in it, that I have space to take notes.  A pencil is for me standard equipment. I can put every place where I read a book my thought about it on paper. If the book is finished and I have a little bit time left, I will transform it into my Netbook and then have my thoughts with me.&lt;/p&gt;

&lt;p&gt;Remember: In the beginning it&amp;#39;s unusual to make several breaks during reading a book, which breaks your normal flow of reading. But during these breaks you can reorder your thoughts about certain things and get new insights. I suggest to publish it online and then see what will happen with it.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;em&gt;Hanna Schütt&lt;/em&gt; and &lt;a href=&quot;http://sebastian-gerth.eu&quot; title=&quot;Sebastian Gerth&quot;&gt;Sebastian Gerth&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Personal_wiki#Free_software&quot;&gt;desktop-wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/IPad&quot;&gt;IPad&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.thesimpsons.com/&quot;&gt;Simpsons&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/dp/B0015T963C/?tag=gocous-20&amp;amp;hvadid=5266389317&amp;amp;ref=pd_sl_7caym1p0x_e&quot;&gt;kindle&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Why learning a new programming language</title>
      <id>http://wikimatze.de/why-learning-a-new-programming-language</id>
      <link href="http://wikimatze.de/why-learning-a-new-programming-language"/>
      <published>2011-10-08T00:00:00+00:00</published>
      <updated>2011-10-08T00:00:00+00:00</updated>
      <category term="programming"/>
      <content type="html">&lt;p&gt;&amp;quot;Why should you start learning a new programming language&amp;quot; was the questions I asked me in the 2011?  Nowadays we are all too busy to try out new things, to expand our horizon. In the following chapter I will explain you, how I learned programming languages.&lt;/p&gt;

&lt;h2&gt;In the beginning there was Turbo Pascal&lt;/h2&gt;

&lt;p&gt;The first language I learned was Turbo Pascal. Everything (not only the programs) looked like a great &amp;quot;geek nerving god tool&amp;quot;. I quite don&amp;#39;t understand what I was doing with Turbo Pascal as my computer science teacher told me to make some simple calculation the perimeter for triangular and other geometric object. It was great to declare your variables and then put them into a function and print line the outcome.  Here are some code snippets:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/wikimatze/435584.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;Turbo Pascal was my first procedural language and later during my studies I learned in a lecture about compiler construction that this language was developed 1970 by Niklaus Wirth (whom I admire for building such easy and effective techniques like the recursive descendant, but thats another tale). If you want to have this retro feeling check out Ubuntu resources (or other things if you want to stay up).&lt;/p&gt;

&lt;p&gt;The following images show the &lt;strong&gt;IDE&lt;/strong&gt;. It has few options with fancy looking buttons and no options-overload.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7240/7257427894_93694bded3_b.jpg&quot; title=&quot;Nice blue environment.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7240/7257427894_93694bded3_z.jpg&quot; class=&quot;center&quot; alt=&quot;Nice blue environment.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Nice blue environment.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8021/7257429850_2711abddc9_b.jpg&quot; title=&quot;A successful compilation.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8021/7257429850_2711abddc9_z.jpg&quot; class=&quot;center&quot; alt=&quot;A successful compilation.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;A successful compilation.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7235/7257429384_7bc10a9f10_b.jpg&quot; title=&quot;Syntax highlighting looks like in a old hacker movie.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7235/7257429384_7bc10a9f10_z.jpg&quot; class=&quot;center&quot; alt=&quot;Syntax highlighting looks like in a old hacker movie.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Syntax highlighting looks like in a old hacker movie.&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7225/7257429250_448c1fbef6_b.jpg&quot; title=&quot;Output in a console.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7225/7257429250_448c1fbef6_z.jpg&quot; class=&quot;center&quot; alt=&quot;Output in a console.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Output in a console.&lt;/div&gt;

&lt;p&gt;In secondary school we had written some programs in Delphi (original it had the name Object Pascal).  The new things was that even the girls had little fun in writing programs in it (&lt;em&gt;some&lt;/em&gt; nice &amp;quot;Hello Kitty&amp;quot; in with pink color, but they actually love it). We learned how to write functions and to create some appealing graphics. After that I lost my interests in programming because the age of &lt;strong&gt;warhammer&lt;/strong&gt; or &lt;strong&gt;video games&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;Then Java came ...&lt;/h2&gt;

&lt;p&gt;When I started my studies of computer science I knew I had still no programming experience and during my first year I had to learn Java. It was quite good and quite bad if you ask my. The good things about it was that I had to learn an exhausting new methodologies: OOP, Interfaces, Recursion, Inheritance, Encapsulation, Polymorphism and many other concept. I was lost, I wanted to learn how to write simple programs and no one could tell me, why I have to write this &lt;em&gt;public static void main (String args[])&lt;/em&gt; to start my program. My fellow students told my that I was an absolute newbie (they were actually right).&lt;/p&gt;

&lt;p&gt;Chad Fowler wrote in his book &lt;strong&gt;The Passionate Programmer&lt;/strong&gt;: &amp;quot;Always be the worst guy in every band you&amp;#39;re in.&amp;quot; I actually was it and in now time I made great progresses. But some aspects of Java hit my but: It was so long to express simple things, so much overhead with static, private etc. To what I mean have a look on the following code:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Socke&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;farbe&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gewicht&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;boolean&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;istTrocken&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;trockne&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;istTrocken&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&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;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;wasche&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;istTrocken&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&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;kt&quot;&gt;boolean&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;istTrocken&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;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;istTrocken&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;

&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;NewClass&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&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;args&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;Socke&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stinki&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;Socke&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;farbe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;schwarz&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;gewicht&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;565&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;trockne&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;istTrocken&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;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ok, you may say: &amp;quot;It&amp;#39;s quite readably&amp;quot; but wait until you have written, about several kilo of LOCs and want to maintain or refactor it. I thought that I could understand my &amp;quot;well&amp;quot; written mail client but well afterwards you know it better.&lt;/p&gt;

&lt;p&gt;For another term I looked on C++. It was good to see how pointer (or &lt;em&gt;references&lt;/em&gt;) are working, how you must allocate your memory (Java has it&amp;#39;s ) and generics (or &lt;em&gt;templates&lt;/em&gt;) for your data structures. C++ is like Java, it&amp;#39;s OOP and you can program procedural if you like to. Have a look on some code:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cpp&quot; data-lang=&quot;cpp&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/*
* 2.1
* Author: Matthias Guenther
* function: repeated shortening of breaches with a ggT
* use the Euklid-Algo to compute the ggT
*/&lt;/span&gt;

&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;iostream&amp;gt;
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compute_ggT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&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;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compute_ggT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&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;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_breach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Please input the parameters to solve the breach: a/b&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;[Input] Parameter a: &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;[Input] Parameter b: &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// look at the ggT
&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;This is not allowed&quot;&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;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compute_ggT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;The breach is:&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; Continue?&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; [Input &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; to leave the programm or &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; to &quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&quot;continue]&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &quot;&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;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;q&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;q&quot;&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;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;shortening_breach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&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;h2&gt;Enlightenment with Ruby&lt;/h2&gt;

&lt;p&gt;Normally I&amp;#39;m not the guy how runs after every hype but I haven&amp;#39;t found my beloved programming language. Why not risk a look. And then there was this &amp;#39;Whosh&amp;#39; (think DC Comics). You could program in different styles, could design your own languages (called DSL) and this nifty framework Ruby on Rails (RoR) with Test-Driven Development (TDD), Behavior Driven Development (BDD), Continuous Integration (CI) and many more things. These things sound a like a mystery for me, but just get started and see how &amp;quot;easy&amp;quot; you can use it with RoR. It hits my head.&lt;/p&gt;

&lt;p&gt;It was a very hard steady learning curve but it was more pleasantly then just go to the candy shop and get what you want for nothing. You have to invest much time. But look for yourself on ruby - it looks like a natural language. Look at a script I wrote to tag MP3:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;mp3info&quot;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# setting the basedirectory&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;base_directory&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;check/&quot;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# run through all directories and get the mp3&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;base_directory&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;**/*.mp3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# get the directory&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;arr_directory&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# empty string which will be merged to a string and which is needed for file renaming as a path&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;arr_directory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;part&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;part&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gsub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;//&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# open the mp3 to read the id3 infos&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Mp3Info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# delete genre&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;TCON&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Game&quot;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# check, if the track title exists&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# mp3 with an underscore are translated in / so we must catch this&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;track_string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gsub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track_string&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Please set the track-tag for &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ... NOT converted&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# save mp3 tag&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# rename files&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;mp3_newname&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tracknum&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; - &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.mp3&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3_newname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;rename&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3_newname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ... converted [&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;album&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;]&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Automating tasks&lt;/h2&gt;

&lt;p&gt;I resisted very long to learn the bash, but there were so many tasks over the years which I didn&amp;#39;t do because it gives me the heebie-jeebies to do the same thing over and over again. After one weekend studying the open book &amp;quot;The Linux Command Line&amp;quot; by William E. Shotts I caught fire.  For a long time I messed my desktop up with tons of images with ugly names, so I wrote a script to change this.  I have a bunch of images with ugly name, so I wrote a script to change this.  Each command has it&amp;#39;s purpose you have to learn its syntax. Here is some sample code:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;ls | wc -l&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0

&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;i &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.jpg; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$[$z&lt;/span&gt;+1]; mv &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;##*.jpg&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\_&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;.jpg; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt; ; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# replace watermark_ (prefix)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&amp;#39;s like Lego, you have these and that, plug it together to create something new. For my diploma thesis I create a Rakefile (the modern version of make written completely in ruby):&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Create a directory for the compiled classes&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_class_directory&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;mkdir -p classes&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;compile the plugin and put the files in the directory&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:compile_plugin&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;fsc -d classes Plugin.scala&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;copy the plugin descriptor&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:copy_plugin_descriptor&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;cp scalac-plugin.xml classes&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;create the jar file&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_jar_file&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;cd classes; jar cf ../divbyzero.jar .&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;create environment&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_environment&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:create_class_directory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:compile_plugin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:copy_plugin_descriptor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_jar_file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;done with creating the jar file ...&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;compile the traits&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:compile_traits&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;fsc -d classes TraitProgrammingHelper.scala&#39;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;fsc -d classes TraitUpdaterHelper.scala&#39;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;fsc -d classes TraitArithmeticRulesHelper.scala&#39;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;fsc -d classes TraitBasicRulesHelper.scala&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;create environment with traits&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_environment_complete&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:compile_traits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_environment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;run example file&quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:test&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:create_environment_complete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;scalac -Xplugin:divbyzero.jar Example.scala&#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Head Scratching With Scala&lt;/h2&gt;

&lt;p&gt;I learned this language for my diploma-thesis, otherwise I still wouldn&amp;#39;t put a thumb on FP. So far I must say that it was a good decision to learn an functional language. Scala showed me how to use &lt;em&gt;chained function&lt;/em&gt;, &lt;em&gt;anonymous functions&lt;/em&gt;, &lt;em&gt;currying&lt;/em&gt;, &lt;em&gt;type bounds&lt;/em&gt; and many more constructs. In the beginning my head howls like a steam-tank, there was so much new terrain for me that I need several breaks to get used to it. After many hours of happy cramming I got surprisingly insights in doing OOP better. That was is, what the Pragmatic Programmers were preaching. To get new insight in a technology you have to regard it&amp;#39;s counterpart. Don&amp;#39;t hesitate to do something you would never do, you gain experience and more confidence in your profession.&lt;/p&gt;

&lt;p&gt;Here is some of Scala code:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-scala&quot; data-lang=&quot;scala&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Reference&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&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;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;_&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&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;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;IntegerReference&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;String&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;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cell&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Reference&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Reference contains the half of &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;cell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&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;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This was my first essay. I tried to cover the things which whom I&amp;#39;m actually dealing. I presented my wide route from my programming experience so that you can see, how the things evolved for me. I always get my hands dirty and try to roll up my sleeves to get a touch about the newest technology.  I think through adventuring you become each day a little bit better then yesterday.&lt;/p&gt;

&lt;h2&gt;Further Reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://andy.pragprog.com/&quot;&gt;Andy Hunt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Behavior_driven_development&quot;&gt;Behavior Driven Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.capify.org&quot;&gt;Capistrano&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://chadfowler.com/&quot;&gt;Chad Fowler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Continuous_integration&quot;&gt;Continuous Integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.dccomics.com&quot;&gt;DC comics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Domain-specific_language&quot;&gt;DSL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pragdave.pragprog.com&quot;&gt;Dave Thomas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29&quot;&gt;Encapsulation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/FP_%28programming_language%29&quot;&gt;FP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sanrioeurope.com/&quot;&gt;Hello Kitty&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Integrated_development_environment&quot;&gt;IDE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Inheritance_%28object-oriented_programming%29&quot;&gt;Inheritance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Interface_%28computer_science%29&quot;&gt;Interfaces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.java.com/en/&quot;&gt;Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.lego.com&quot;&gt;Lego&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.inf.ethz.ch/personal/wirth&quot;&gt;Niklaus Wirth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Object-oriented_programming&quot;&gt;OOP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Object_Pascal&quot;&gt;Object Pascak&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Subtype_polymorphism&quot;&gt;Polymorphism&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pragprog.com/titles/tpp/the-pragmatic-programmer&quot;&gt;Pragmatic Programmer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Recursion#Recursion_in_computer_science&quot;&gt;Recursion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rubyonrails.org/screencasts&quot;&gt;Ruby on Rails&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.scala-lang.org/&quot;&gt;Scala&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot;&gt;Text-Driven Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gd.tuwien.ac.at/linuxcommand.org/tlcl.php&quot;&gt;The Linux commandline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.pragprog.com/titles/cfcar2/the-passionate-programmer&quot;&gt;The Passionate Programmer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Generic_programming#Templates_in_C.2B.2B&quot;&gt;generic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Pointer_%28computing%29&quot;&gt;pointer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rake.rubyforge.org/&quot;&gt;rake&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Recursive_descent_parser&quot;&gt;recursive descendant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ubuntu.com&quot;&gt;ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Video_game&quot;&gt;video games&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.games-workshop.com&quot;&gt;warhammer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Method alias in ruby</title>
      <id>http://wikimatze.de/method-alias-in-ruby</id>
      <link href="http://wikimatze.de/method-alias-in-ruby"/>
      <published>2011-10-01T00:00:00+00:00</published>
      <updated>2011-10-01T00:00:00+00:00</updated>
      <category term="programming"/>
      <content type="html">&lt;p&gt;You can create aliases for a method and variable name in ruby. This can be helpful if you want to override the behavior of some method without changing the origin implementation of it. &lt;code&gt;alias_method&lt;/code&gt; take a &lt;code&gt;new_name&lt;/code&gt; as a copy name of the &lt;code&gt;old_name&lt;/code&gt; and it has the following syntax.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;kp&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;old_name&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;A small example:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Davi&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;capital&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Karaz-a-Karak&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;kp&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:orig_capital&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:capital&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;capital&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Karaz-a-Karak rebuild&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;orig_capital&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;davi&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Davi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;davi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;capital&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# output&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&quot;Karaz-a-Karak rebuild&quot;&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&quot;Karaz-a-Karak&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;What is the difference between &lt;code&gt;alias&lt;/code&gt; and &lt;code&gt;alias_method&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Alias&lt;/code&gt; will looks at the value of self lexically where the aliased keyword lies. &lt;code&gt;Alias_method&lt;/code&gt; use the value of self during runtime which may be a subclass where the call is lexically located. Consider the following example to understand what I mean:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;A&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;swap&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;alias&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bar&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;A foo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;B&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;A&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;B foo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;swap&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;B&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;bar&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# =&amp;gt; &quot;A foo&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Y&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;swap&lt;/span&gt;
    &lt;span class=&quot;kp&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:foo&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Y foo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Z&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Y&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Z foo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;swap&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;bar&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# =&amp;gt; &quot;Z foo&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It is possible with &lt;code&gt;alias_method&lt;/code&gt; to reopen a class, override a method call and you can still use the original call. In order to maintain backward compatibility &lt;code&gt;alias_method&lt;/code&gt; are used in plugins, extensions, deprecating variables.  &lt;code&gt;Alias_method&lt;/code&gt; can be used in Rails to define action with duplicated content and remove duplicated code.&lt;/p&gt;

&lt;p&gt;Here the duplicated variant:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UsersController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ApplicationController&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;home&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;search&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The DRY variant:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UsersController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ApplicationController&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;home&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;kp&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:home&lt;/span&gt;
  &lt;span class=&quot;kp&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:home&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://ruby-doc.org/stdlib-1.9.1/libdoc/rdoc/rdoc/RDoc/Alias.html&quot;&gt;alias&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ruby-doc.org/core-2.1.0/Module.html#method-i-alias_method&quot;&gt;alias_method&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </entry>
  
    <entry>
      <title>Why I use Jekyll for blogging</title>
      <id>http://wikimatze.de/why-i-use-jekyll-for-blogging</id>
      <link href="http://wikimatze.de/why-i-use-jekyll-for-blogging"/>
      <published>2011-07-03T00:00:00+00:00</published>
      <updated>2011-07-03T00:00:00+00:00</updated>
      <category term="writing"/>
      <content type="html">&lt;p&gt;For several years I want to write and tried many different platforms like &lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt; &lt;a href=&quot;http://www.blogger.com&quot;&gt;blogger&lt;/a&gt;, or &lt;a href=&quot;http://www.tumblr.com/&quot;&gt;tumblr&lt;/a&gt;. The main problem which kept me away from writing was just the fact, that every time I want to write I had to do it in a new environment and not in my favorite editor &lt;a href=&quot;http://www.vim.org/&quot;&gt;vim&lt;/a&gt;. Every system gives me the freedom to extend it in several ways but in the end it didn&amp;#39;t provide me the freedom to change every tiny piece I want.  With &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;jekyll&lt;/a&gt; I can use my favorite text editor and it really &amp;quot;&lt;strong&gt;turned me into a text monster&lt;/strong&gt;&amp;quot;. This description sounds like a holy grail, but let me explain its abilities in the following sections.&lt;/p&gt;

&lt;h2&gt;What Jekyll is&lt;/h2&gt;

&lt;p&gt;Jekyll is a static site generator written in &lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;ruby&lt;/a&gt;. It generates static html pages. The page is presented through several templates and then fires the whole site, were articles are written in a text markup language like &lt;a href=&quot;http://redcloth.org/textile&quot;&gt;Textile&lt;/a&gt; or &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; through the &lt;a href=&quot;http://www.liquidmarkup.org/&quot;&gt;liquid converters&lt;/a&gt; to generate fully generated compiled website. Don&amp;#39;t think that it will be easy for you to do it. First of all you have to learn either Textile or Markdown. I chose textile for writing my posts because I use Markdown to create the README files for my GitHub account.&lt;/p&gt;

&lt;h2&gt;Setting up the environment&lt;/h2&gt;

&lt;p&gt;You need to have a valid ruby and &lt;a href=&quot;http://rubygems.org/&quot;&gt;ruby gems&lt;/a&gt; installation on your machine. A simple &lt;code&gt;gem install jekyll&lt;/code&gt; will install the following gems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/TwP/directory_watcher&quot;&gt;directory_watcher&lt;/a&gt;: gives a list of files which change in some intervals&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Shopify/liquid&quot;&gt;liquid&lt;/a&gt;: rendering templates in a safe manner&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ahoward/open4&quot;&gt;open4&lt;/a&gt;: creates a child process to handle &lt;code&gt;pid&lt;/code&gt;, &lt;code&gt;stdout&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&quot;&gt;maruku&lt;/a&gt;: (Markdown interpreter&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rubygems.org/gems/classifier&quot;&gt;classifier&lt;/a&gt;: is a Bayes implementation and can be used semantic indexing like to
display related post - this mechanism is used in machine learning)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To get nice syntax highlighting for your code you have to install &lt;a href=&quot;http://pygments.org/&quot;&gt;pygments&lt;/a&gt; via &lt;code&gt;sudo apt-get install python-pygments&lt;/code&gt; on Ubuntu/Debian. On the &amp;quot;install page(install link for &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/install&quot;&gt;jekyll install&lt;/a&gt; you can get more information about how to setup Jekyll.&lt;/p&gt;

&lt;h2&gt;The directories and styles&lt;/h2&gt;

&lt;p&gt;Here is the basic layout of a typical Jekyll project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_includes&lt;/code&gt;: Small snippets which can be used in every place of the page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_layouts&lt;/code&gt;: You can define layouts for post entries and the general default layout. Posts can have the special &lt;strong&gt;Yaml
Front Matter&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_posts&lt;/code&gt;: Contains all posts in your specified markup language&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_config.yml&lt;/code&gt;: Is a file to store configuration data like the styling of the URLs, or some global variables. It is
also possible to define own variables which can be used as global things on other pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other files can put on the root directory like an &lt;code&gt;atom.xml&lt;/code&gt; file (for RSS feed) or &lt;code&gt;404.html&lt;/code&gt; page. For example my &lt;code&gt;post.html&lt;/code&gt; has the following layout:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;---
layout: default
---
&lt;span class=&quot;nt&quot;&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;header&amp;gt;&lt;/span&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;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      Posted on &lt;span class=&quot;nt&quot;&gt;&amp;lt;time&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;datetime=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;2011-07-03&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;pubdate&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;2011-07-03&lt;span class=&quot;nt&quot;&gt;&amp;lt;/time&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&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;&quot;social&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;//www.reddit.com/submit?url=/why-i-use-jekyll-for-blogging/&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fa fa-lg fa-reddit-square&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;//news.ycombinator.com/submitlink?u=/why-i-use-jekyll-for-blogging/&amp;amp;amp;t=Why I use Jekyll for blogging&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fa fa-lg fa-hacker-news&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://twitter.com/share?url=/why-i-use-jekyll-for-blogging&amp;amp;amp;text=%22Why I use Jekyll for blogging%22%20%40wikimatze&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fa fa-lg fa-twitter-square&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://www.facebook.com/share.php?u=/why-i-use-jekyll-for-blogging&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fa fa-lg fa-facebook-square&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;https://plus.google.com/share?url=/why-i-use-jekyll-for-blogging&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fa fa-lg fa-google-plus-square&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://feeds.feedburner.com/guenther?format=xml&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;fa fa-lg fa-rss-square&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&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;&quot;clearfix&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/header&amp;gt;&lt;/span&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;&quot;clearfix&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;aside&amp;gt;&lt;/span&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;&quot;whoring&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;disqus_thread&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;cm&quot;&gt;/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;disqus_shortname&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;wikimatze&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// required: replace example with your forum shortname&lt;/span&gt;

    &lt;span class=&quot;cm&quot;&gt;/* * * DON&#39;T EDIT BELOW THIS LINE * * */&lt;/span&gt;
    &lt;span class=&quot;p&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;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;dsq&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;script&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;dsq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;text/javascript&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;dsq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;dsq&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;&#39;http://&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;disqus_shortname&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;.disqus.com/embed.js&#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;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;head&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;body&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;appendChild&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;dsq&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;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;noscript&amp;gt;&lt;/span&gt;Please enable JavaScript to view the &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://disqus.com/?ref_noscript&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;comments powered by Disqus.&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/noscript&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://disqus.com&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;dsq-brlink&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;comments powered by &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;logo-disqus&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Disqus&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;


  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The lines between &lt;code&gt;---&lt;/code&gt; mark a special &lt;a href=&quot;http://jekyllrb.com/docs/frontmatter/&quot;&gt;Yaml Front Matter&lt;/a&gt; This block is treated as a special block in Jekyll and can contain different components. The `` stands for the content of a post entry.&lt;/p&gt;

&lt;h2&gt;Creating the layout&lt;/h2&gt;

&lt;p&gt;Here is the main template for my blog.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if lt IE 7]&amp;gt; &amp;lt;html class=&quot;no-js ie6 oldie&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 7]&amp;gt;    &amp;lt;html class=&quot;no-js ie7 oldie&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 8]&amp;gt;    &amp;lt;html class=&quot;no-js ie8 oldie&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if IE 9]&amp;gt;    &amp;lt;html class=&quot;no-js ie9&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Consider adding an manifest.appcache: h5bp.com/d/Offline --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;no-js&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;en&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemscope&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemtype=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://schema.org/Product&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;charset=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Why I use Jekyll for blogging&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;


  &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;description&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Writings, and talks by Matthias Günther. Günther works at MyHammer, loves painting Warhammer figures, and enjoys making cakes.&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;

  ...
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&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;&quot;navbar row&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;nav2&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;toggle&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;gumby-trigger=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#nav2 &amp;gt; ul&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;icon-menu&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;four columns logo&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/index.html&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;wikimatze&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;eight columns&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      ...
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&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;&quot;row&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&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;&quot;push_one ten columns&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;header&amp;gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;lead&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Why I use Jekyll for blogging&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&amp;lt;/header&amp;gt;&lt;/span&gt;


    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&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;&quot;modal&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&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;&quot;content&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;close switch&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;gumby-trigger=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;|#modal1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;icon-cancel&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&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;&quot;row&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&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;&quot;ten columns centered&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Contact&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
          ...
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;footer&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;row&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
      ...
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Grab Google CDN&#39;s jQuery, fall back to local if offline --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- 2.0 for modern browsers, 1.10 for .oldie --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;oldieCheck&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Boolean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;html&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;oldie&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;oldieCheck&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;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;&amp;lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js&quot;&amp;gt;&amp;lt;\/script&amp;gt;&#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;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;&amp;lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js&quot;&amp;gt;&amp;lt;\/script&amp;gt;&#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;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;jQuery&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;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;oldieCheck&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;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;&amp;lt;script src=&quot;js/libs/jquery-2.0.2.min.js&quot;&amp;gt;&amp;lt;\/script&amp;gt;&#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;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;&amp;lt;script src=&quot;js/libs/jquery-1.10.1.min.js&quot;&amp;gt;&amp;lt;\/script&amp;gt;&#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;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!--
  Include gumby.js followed by UI modules followed by gumby.init.js
  Or concatenate and minify into a single file --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;gumby-touch=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/js/libs&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;js/libs/gumby.js&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  ...
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I&amp;#39;m using the meta-language &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt; to create my CSS. There is one problem with Sass: You have to compile it every time you made a change. Fortunately, there is the &lt;a href=&quot;http://compass-style.org/&quot;&gt;compass&lt;/a&gt; which always compiles my sass file when I change it. When I build my page I started with &lt;code&gt;compass watch css/ &amp;amp;&lt;/code&gt; a command to automate Sass building. This is very handy when changing the layout.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Look on &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/Sites&quot;&gt;other pages&lt;/a&gt; what is possible with Jekyll. You can learn many new things by looking at other Jekyll blogs and copy what you need. I love to write a little bit and after I finished an article perform &lt;code&gt;rake d&lt;/code&gt; to upload my blog.&lt;/p&gt;
</content>
    </entry>
  
</feed>
