Alessandro Melandri

Synchronize Sublime Text packages on multiple computers

02 Jan 2014 • Permalink

Finally a way to synchronize Sublime packages beetween my home iMac and my work ThinkPad.

Manage posts excerpt in Jekyll

24 Nov 2013 • Permalink

Jekyll has a built in excerpt feature, but I wanted more control on how excerpt is generated and displayed, so googling around I found two nice posts that explain how to manage it and display a “Read on” button that links to the article page.

This is how it works:

  • Check if the post contains the excerpt separator
  • If the separator is found, split the post content in an array, print the first element and a link to the full article
  • If there isn’t a separator just display the post content

This is how I modified my index.html page.

{% if post.content contains '<!--more-->' %}
	
	{{ post.content | split:'<!--more-->' | first }}
	
	<p><a href="{{ post.url }}">Continue reading</a></p>

{% else %}

	{{ post.content }}
	
{% endif %}

Custom notifications for a specific status change in Jira

20 Nov 2013 • Permalink

The default Jira notification scheme sometimes might look like a spam bot, especially if you have a lot of users actively using it, so for one of our project we decided to create an empty notification scheme and add just one notification for a specific status change.

Jira doesn’t have a built in notification for specific status changes but fortunately adding a new one is quite easy.

Continue reading

Update table with data from another table using SQL

19 Nov 2013 • Permalink

A simple but useful SQL snippet that lets you update a table using data from another table

UPDATE
     Table1 
SET
     Table1.col1 = Table2.col1,
     Table1.col2 = Table2.col2 
FROM
     Table1 
INNER JOIN     
     Table2 
ON     
     Table1.id = Table2.id

Custom Jekyll filter for tags

12 Nov 2013 • Permalink

This is a simple Jekyll filter that I wrote in order to use Bootstrap’s label objects to display post tags.
It’s based on the original array\_to\_sentence\_string filter, part of the Jekyll core.

Just put it in your _plugins folder and use it in your layout:

module Jekyll
  module CustomTagFilter
    def tag_array(array)
      connector = ","
      case array.length
        when 0
          ""
        when 1
          "<span class=\"label label-default\">#{ array[0].to_s}</span>"
        else
          "<span class=\"label label-default\">#{array.join('</span> <span class="label label-default">')}</span>"
      end
    end
  end
end

Liquid::Template.register_filter(Jekyll::CustomTagFilter)

Usage

<span class="posttags">{ { page.tags | tag_array } } </span>

Result

Tags: <span class="label label-default">Tech</span> <span class="label label-default">Jekyll</span> <span class="label label-default">Bootstrap</span>

About this blog theme

12 May 2013 • Permalink

I keep receiving requests about the theme used on my blog and a lot of people are asking me to release it as I did with DarkStripes.

I’m not going to publish the source code anytime soon, because I’d like to keep the look of my blog “unique”.

I promised to write a tutorial on how to customize the default Octopress theme to get a look similar to my blog, but I couldn’t find enough spare time.
The new born baby and a relocation are draining my energies so, please, be patient and if you are in a hurry remember that Firebug and Chrome web inspector are your good friends.

Ettore

07 Mar 2013 • Permalink

Ettore by Alessandro Melandri (amelandri)) on 500px.com

Why passwords have never been weaker and crackers have never been stronger

10 Feb 2013 • Permalink

An in-dept technical article by Arstechnica on password cracking techniques, a must read for an IT guy and for whoever is worried about his online security.

For the record, after reading the article I bought 1Password and changed every password of my key online accounts.

World War II in Photos

01 Feb 2013 • Permalink

A great retrospective on World War II by The Atlantic.

Living without human contact for 40 years

31 Jan 2013 • Permalink

The incredible story of the meeting between a group of geologists and a family that lived for 40 years in the russian taiga without human contacts, even unaware of World Ward II.

The low door creaked, and the figure of a very old man emerged into the light of day, straight out of a fairy tale. Barefoot. Wearing a patched and repatched shirt made of sacking. He wore trousers of the same material, also in patches, and had an uncombed beard. His hair was disheveled. He looked frightened and was very attentive…. We had to say something, so I began: ‘Greetings, grandfather! We’ve come to visit!’

The old man did not reply immediately…. Finally, we heard a soft, uncertain voice: ‘Well, since you have traveled this far, you might as well come in.’