Jekyll - Pygments, mistyping the syntax highlight language tag results in blog build fail

Jekyll on GitHub uses liquid tags and Pygments as its default syntax highlighter. It generally works great, but sometimes it can cause troubles to the Jekyll build process, especially if you mistype the language it should output. This is the syntax you should use: {% highlight languageTag %} … your code goes here … {% endhighlight %} The problem is: if you mistype the ‘languageTag’ chances are that Jekyll is not able to build the site anymore and the returning message from GitHub isn’t of much help; in the emails sent to me I could read: “The page build failed...

Fluent Interface and Class Hierarchy in C#

Do you like to have fluent interfaces in your code because they make it more readable? Do you have a ‘deep’ class hierarchy and you’d like to have a fluent interface without the need of always returning the base class type? and possibly avoid all the cast(s) in the methods’ chain? Here’s the standard way of approaching Fluent Interfaces with inherited classes in C#: public class Calculator { public Calculator Add() { // do the job return this; } } public class ScientificCalculator : Calculator { public ScientificCalculator Sin() { // do the job return this; } } public class...

AngularJs 1.x and TypeScript best practices - bindToController

One of my best practices when creating new Angular components using TypeScript is to use classes when defining Service(s) and Controller(s) and to use the ‘controllerAs’ syntax for the bindings. You can take a look at the material from my session at the Italian AngularConf2015 in the previous posts to have a better idea of what I mean. Some code samples are also available to better illustrate the matter. There’s however a problem when it comes to the ‘controllerAs’ syntax and directives that define an isolated scope and use properties on that scope to bind values from the outside world....

AngularConf2015 - Slides and Code Samples

Last week I had the honor and the priviledge to give speech at the italian AngularConf 2015, which was held at the Environment Park in Turin (Italy). It was a very good event with many interesting sessions on Angular 1.x and a look some aspects of Angular 2.0. I’ve hosted a session on which benefits you have when using TypeScript to develop Angular 1.x applications and how your code will change when you move to Angular 2.0. Here are the slides I used as a reference: AngularConf2015 from Alessandro Giorgetti The public repositories with the code samples are hosted on...

How to add Disqus to your Jekyll Blog

Setup a Disqus account. Hit ‘Settings’ - ‘add Disqus to Site’. Fill in the required informations for the site you’ll like to add Disqus to. After that you are asked to choose the platform in which ‘install’ the service; for Jekyll just pick ‘Universal Code’. This will send you to a page in which you’ll see instructions on which scripts to add to your templates and how to configure them. Look for the proper position on your blog template (in the Notepad theme I used the file is: _includes/disqus_comments.html) and check/update the code if needed. Done. It was pretty simple...

Web European Conference 2015 - Slides and Code

Here are the slides of my session: ‘TypeScript - the JavaScript developer best friend’: TypeScript . the JavaScript developer best friend! from Alessandro Giorgetti The source code can be found at this GitHub repository: GitHub AngularConf2015 cya next