Posts

Showing posts from November, 2017

Fonts for intranet sites in IE8

Image
Can you believe that Internet Explorer in IE8 mode renders fonts differently for intranet and non-intranet addresses? Believe it or not but it's true. This simplistic html page will render differently depending on where it is hosted. The difference is subtle but for my team it is crucial because we are running automatic screenshot comparison to find regression in styles between IE8 and IE11(EdgeMode) and this little difference completely blows layout. If you have the same issue go to Tools -> Internet Options -> Security -> Local Intranet -> Sites and uncheck all options there. Also go to Advanced tab and remove sites from there as well. Good luck!

IISExpress: Relative paths in applicationhost.config

IISExpress which comes with Visual Studio only supports absolute paths to webroot in applicationhost.config. Visual Studio updates this file with actual path when you load web project. Basically you cannot use IISExpress if your web-site is hosted in a different folder other than original webroot. However in solutions with multiple web projects where they are linked to a single common webroot folder it may become a problem. In order to override Visual Studio behavior I wrote MSBUILD script which updates applicationhost.config with necessary path. You'll also need to include applicationhost.config into your web-project as a link to make sure Visual Studio doesn't skip build when file changed.

Overcoming Karma server case sensitivity

This post explains how to setup Karma + RequireJs. However it doesn't mention one important limitation of Karma. And that is case-sensitivity . Basically if your module name doesn't match actual folder/filename Karma will return 404 and test will fail. In order to overcome this issue I hooked up into require.load function and normalized module paths there to make sure they match those stored on the disk.

Bitcoin, Docker, Microservices, etc.

I've been hearing a lot of buzz words lately like Bitcoin, Docker, Microservices, EventBus, etc. And you know what... every time I hear it, it drives me nuts. Not because something is wrong with those technologies but because they seem to be always abused. People are trying to use them as a silver bullet to any problem even if it doesn't exist. Or in many cases people using those buzz words have little to no idea where the problem is. They don't realize that the majority of the issues in software are due to stupid things like copy-paste, over-engineering and lack of automation. And microservices and other buzz words are not going to fix that.

Ng-book 2. Is it worth it?

When I decided to learn Angular with some AngularJS background, buying ng-book 2 was a no-brainer for me. Man, was I wrong. If you are planning to read ng-book 2 check out angular.io web-site first. I bought paperback a while ago and spent a lot of time reading it. However it was really boring. I found angular.io tutorial to be more interesting and it didn't take as much time while covering the same topics or even more.

Is AMD dead?

I'm currently migrating AngularJS app to Angular 4. Build script generates AMD bundles which are then loaded using RequireJS. I didn't want to change long-established and stable bundling process therefore I decided to continue using RequireJS instead of migrating everything to WebPack. Everyting worked fine except for RxJS library. To my surprise RxJS does no longer ship AMD bundles ! Does it mean RequireJS/AMD is dead? I came across an interesting discussion on reddit  and looks like 'yes' it's dying but slowly because of how much it has been used before. If you get stuck with the same issue, you can use RequireJS Optimizer to convert CommonJS files to AMD and generate new bundle. npm install requirejs node_modules\.bin\r.js.cmd -convert node_modules\rxjs node_modules\rxjs node_modules\.bin\r.js.cmd -o out=Libs\rxjs\bundles\Rx.min.js baseUrl=node_modules name=rxjs/Rx

TypeScript interfaces in Angular

After reading  Angular Fundamentals  I got to know that you cannot use Typescript interfaces as a dependency injection token. This is because interfaces has no representation in runtime i.e. Javascript therefore Angular has no means to determine the type of dependency. However I found a quick workaround that worked for me like a charm most of the time. Simply convert interface to an abstract class! It's as simple as renaming interface to abstract class . The only downside is that abstract classes don't support multiple inheritance but in many cases it's not needed.

Looking for an interesting place to go over the weekend?

Image
Looking for an interesting place to go over the weekend? Check out my opensource project http://where2gonow.com . It shows interesting places on the map within given distance and popularity rating. You can also filter search results by category if you want. Basically it lists travel destinations from TripAdvisor but it's geared towards their geographical location and travel distance. I built this web service for myself but I'll be glad if you find it useful as well. Source code is located in my githib repository: https://github.com/zhilich/where2gonow