Loading..

2014-03-19 @ 16:38

Habanero & Bird-Eye Chilli Hot Sauce

I'am enjoying one month of parent holiday (Elternzeit in German) which started at 6th of March. I have decided to not to touch programming at all. I've somehow missed my college's hot sauces we have used to enhance every lunch and that's why I have decided to prepare one of them.

The following sauce has about 250.000 - 300.000 scoville which is quite hot, but it's still very tasty. The sauce has habanero like flavor, little sweet with a wonderful color and great aroma. Big thanks to Hartog for sharing his recipe.

You will need:

  • 5 habaneros
  • 300gr Birds eye
  • 1 onion
  • 1/2 head garlic
  • 1/2 cup vinegar
  • 1 cup water
  • 2 tbsp honey
  • 2 tbsp salt
  • 1 tsp cumin
  • 1 tsp curcuma
  • 2 tsp coriander seed (whole, dried)
  • 1/2 tsp cinamon
  • 1 cup vegetable oil
  • juice of a lemon

Bird-Eye chillis

Habaneros

Here is the original recipe (by Hartog):

Over low heat, glace the onion and garlic. Add spices, except coriander and stir until the onions are colored and the aroma fills your kitchen. Add the fluids and the chilies. try to keep the mixture from boiling for about ten minutes, then crank up the heat and once it boils (and all germs, etc. have died off) set aside to cool down for about 30 minutes. Blend until the consistency is yours.

Cooking the stuff

Mixing

I have followed all the steps and at the end I have filled small preserving glasses with the sauce and put them to 80°C warmed oven for 10 minutes. The result is great (especially for pizza and Döner)! Good appetite, but be careful! fire scream_cat

show more »

2014-02-07 @ 22:19

Installing Vim with ruby and python support on Debian/Ubuntu

First check if your Vim version already (incidentally) supports Ruby and Python:

vim --version | grep "ruby\|python"

If you see +ruby or +python respectively, then your Vim is already supporting Ruby and Python. Congratulations! The rest of you guys must remove previous version of vim first:

sudo apt-get remove --purge vim-common vim-runtime

Install dependencies Vim needs to compile:

sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
  libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
  libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo apt-get build-dep vim

Install Mercurial hg if you have not done it previously:

sudo apt-get install mercurial

Get the latest/greatest version of Vim:

hg clone https://vim.googlecode.com/hg/ /tmp/vim
cd /tmp/vim
./configure --enable-pythoninterp --enable-rubyinterp --with-features=huge
make
sudo make install

Pheew, that's all!

show more »

2014-01-22 @ 20:59

RSpec capture output of Kernel's abort method

It may be bit tricky to capture output of abort to $sterr stream using RSpec. Let's assume we have following piece of code:

class FileEater
  def initialize(*args)
    abort "You have to give me a file!" if (file = args[0]).nil?

    begin
      eat(File.read(file))
    rescue Errno::ENOENT
      abort "Cannot eat the file. Grrr"
    end
  end

  def eat(content)
    puts "Eating #{content}. Yummy."
  end
end

Now let's test the behavior of initialize method when no arguments are given. Our first attempt may look like this:

describe FileEater do
  it 'should abort when no file given' do
    FileEater.any_instance.should_receive(:abort)
      .with("You have to give me a file!")

    FileEater.new
  end
end

After running rspec spec we get the following (unexpected) output:

TypeError: no implicit conversion of nil into String

Ehh, what just happen? The problem is that abort method is now stubbed and therefore doesn't actually abort execution of your code. Because of this, File#read method is called with nil argument and we get the TypeError exception. The way around is to temporarily replace $stderr with a StringIO object, which we can then check the contents of. Thereafter we have to check that abort is taking a place using following trick lambda { ... }.should raise_error(SystemExit)

def capture_stderr(&block)
  original_stderr = $stderr
  $stderr = fake = StringIO.new
  begin
    yield
  ensure
    $stderr = original_stderr
  end
  fake.string
end

describe FileEater do
  it 'should abort when no file given' do
    stderr = capture_stderr do
      lambda { FileEater.new }.should raise_error(SystemExit)
    end
    stderr.should match("You have to give me a file!")
  end
end
show more »

About

Jiri Chara My name is Jiří Chára and I am an intermediate Ruby and JavaScript developer. I was born in Plzeň the home of the Pilsner Beer. I currently live in Karlsruhe, Germany together with my wife and my daughter. I work as a Ruby on Rails developer at OrganisedMinds.

see more »



Copyright © 2014 Jiří Chára. All Rights Reserved.