Jonas Brusman

I like to do high fives, take photographs and make cool things with Ruby.

Berlin

Lived i Berlin for half a year but didn’t use my camera much at all.

Sunday walk

Took a sunday walk with Eva and David and it resulted in four new photos to my serie “from behind”.

Jekyll 1.0

The Jekyll gem have been updated to 1.0. So I’ve now updated both this site’s source (even made the repository open!) and my example repository for hosting a Jekyll site on Heroku.

David

This is my brother David last December. His band, Skogen Brinner has recently released their debut album. Listen to it on Spotify.

Ice fishing

Went Ice fishing with Eva’s family and some friends on the easter holiday.

09-07-09

Dublin – part 2

Two more photos from the trip to Dublin last November.

Mormor 95

My grandmother, the best grandma in the whole world turned 95 and celebrated with a party last weekend. xoxo

Breakfast at Mynewsdesk

Every Monday morning at 8:00 breakfast is served for the Mynewsdesk employees at our headquarter in Stockholm. It became some sort of tradition for me to take a photograph of my breakfast every morning and here’s the result from 2012’s breakfasts.

Jekyll code highlighting on Heroku

The built in code highlighter in Jekyll doesn’t work on Heroku due to some issues with Python. I came up with a work around by using the Pygmentize gem instead.

Gemfile

Add the Pygmentize gem to your gemfile:

gem 'pygmentize'

And run bundle install

_plugins/highlight.rb

Create a new file in the _plugins directory with the name highlight.rb. Paste the following code to make the built in code highlighter use the new Pygmentize gem:

require 'pygmentize'
class Jekyll::HighlightBlock < Liquid::Block
  def render_pygments(context, code)
    @options[:encoding] = 'utf-8'
    output = add_code_tags(
      Pygmentize.process(code, @lang),
      @lang
    )

    output = context["pygments_prefix"] + output if context["pygments_prefix"]
    output = output + context["pygments_suffix"] if context["pygments_suffix"]
    output
  end
end

Use

Just use the standard highlight blocks as usual:

{% highlight ruby %}
gem 'pygmentize'
{% endhighlight %}