Create a drop-down list with custom options text and value in Angular

It is a common practice that the text of the options of a select drop-down box is a combination of a shortcut and it’s full text label.

For example consider the following array of JSON objects that a server might return:

1
2
3
4
var countries = [
    {"shortcut": "DE", "label": "Germany"},
    {"shortcut": "GB", "label": "Great Britain"}
];
Read the complete article

How to deactivate Ruby code from executing when it is used inside a code example highlighted with pygments

When you want to highlight ruby-code snippets you will deal with the problem that the code, even when it is wrapped inside the {% highlight ruby linenos %}…{% endhighlight %} tags, it gets executed and you do not see the code snippet itself.

Read the complete article

Use Jekyll and Bootstrap to create a tag-area with links to pages showing only the articles of the current tag

For my personal blog, which in based on Jekyll, I created a tag-area on the top of the homepage so that the visitors are able to navigate through the different articles in a tag-page by clicking on the tag that they are interested in. With this article I would like to present you the code of the tag-area:

1
2
3
4
5
6
7
<div class="well well-sm">Filter the articles:
    {% for tag in site.tags %}
        <a class="btn btn-warning" type="button" href="tags/{{ site.baseurl }}{{tag | first }}">
            {{ tag | first }} <span class="badge">{{ tag | last | size }}</span>
        </a>
    {% endfor %}
</div>
Read the complete article

Six practical features of C# 6.0 to use in your everyday coding

With this article I would like to present you six useful features of the 6.0 version of C#.

null conditional operator

Removes the need for checking for null values and thus we avoid the tedious if(... != null && ... != null ...) if conditions.

1
2
  if (myDog?.Mouth?.TeethsInMouth[0]?.ScientificName == "default tooth name") ...
  
Read the complete article

Six simple steps to install the pygment syntax highlighter in a Jekyll blog that uses bootstrap.

Highlighting your code-examples in your blog makes your articles simpler to read. When using Jekyll the “default” option for highlighting code is provided from the pygments plugin.

Read the complete article