My Bower/Gulp settings

This is my Gulp.js workflow settings based on examples shown in this PluralSight course (I really recommend you to watch it). I am using these gulp plugins: main-bower-files for creating list of js files to be injected gulp-inject for injecting js/css files into index.html file When you install some library via bower you should do so with the –save […]

Difference between async loops in C#

What do you think will happen when you run these 2 snippets of code? They both looks quite similar at the first sight, don’t they. This one var results = new List<SomeClass>(); mylist.ForEach(async item => { var result = await SomeDbQueryAsync(item); results.Add(result); }); versus this one var results = new List<SomeClass>(); foreach(var item in mylist) […]

VisualStudio has problem when multiple versions of Typescript are installed

You can have several versions of Typescript installed on your machine and each project in Visual Studio can be configured to use different version by specifying that version in .csproj file. Like this But you might still have problems with IntelliSense for some native javascript objects. VisualStudio uses file lib.d.ts  to learn interfaces of window objects, events, […]

Hledám kancelář

PROSÍM O SDÍLENÍ Od 1.1.2016 budu pracovat na volné noze a potřebuji si najít nějakou pěknou kancelář. Nechci být celý den zavřený v kanceláři úplně sám, takže bych se rád k někomu připojil nebo našel někoho, kdo se připojí ke mně. Jsem programátor, takže k práci potřebuji klid na soustředění. Potřebuji také dobré světlo, aby […]

C# Coding conventions

These coding conventions were originally written by my colleagues Filip Kassovic and Michal Třešňák in ST-Software. I have only made slight updates and published it on my blog. Do not use “var” keyword when not necessary var response = SomeClass.SomeMethod(input); Reason we don’t see the type of “response” “Find Usages” or “Find all references” doesn’t find […]

Download files via POST request in AngularJs

There are times when you need to download file but the download is initiated via POST request, because the request contains too much parameters to fit into limited GET request. In my case I needed to generate ZIP file. First you need to define custom method on your $resource which will handle the download method, like […]

How to write for-loop like code in SQL

I needed to dynamically generate missing items in database. I had a list of Sports and Categories, and I needed to generate items with all combinations of these two entities. But some of them already existed in database, so those should be skipped. My idea was to perform kind of for-each loop iterating over the […]