Angular 2, Webpack and lazy loaded routing modules boilerplate

Hi i’m currently working on my IOT service called IOTSpeak, I will get back to more details about it when it’s launched.

In this project i’m developing an Angular 2 app using TypeScript. The web app connects to the service using an Web Api that in the future could be used by different native phone apps.

In the past weeks i have been thinking of how I should package the web app for production. And I also went to a local Meetup (UppsalaJS) where i saw a talk about Webpack and HMR (Hot Module Replacement) which inspired me to look into using Webpack. The talk was made by Emil Öberg, you can find the talk on YouTube.

In  the process of truly learning a bit of Webpack I created a repository at GitHub: Angular2 Webpack Lazyloading Boilerplate which utilize lazyloaded modules that serves in chunks when required. And creates a nicely production package for deployment. Right now this repository is not using HMR. paywall remover

I got tired of the paywall introduced a while ago. They allow non paying readers to read a limited number of posts per week or so, thereafter you will be shown a paywall instead of the content of the article.

I came up with a idea that I possibly could write a Tampermonkey script to remove the paywall. After a short investigation i found out that the paywall was just some client-side scripts that blocked the visibility of the articles. I guess the obvious reasons for this is that they try to make google and other bots think the paywall doesn’t exist. I guess that google could possible give some SEO penalties for this, google is getting better and better in running javascript. I wonder how they think about that on DN.

So if you use Tampermonkey in Google Chrome you can add the following script.

  1. Open Tampermonkey dashboard
  2. Press the add button
  3. Paste the following script and press save
// ==UserScript==
// @name DN remove ads
// @namespace
// @version 0.2
// @description Remove Paywall that hides the artcicle
// @author Mattias Andersson
// @match*
// @grant none
// ==/UserScript==

(function() {
 'use strict';
 function lookForPaywall() {
   // Check if paywall is visble
   if($('.js-paywall:visible').length > 0){
     // Remove paywall
     // Show hidden content
     // Remove fading mask
     $('.article__body ').removeClass('article__body--mask');
     // If paywall is not yet shown, check in a while if it have      appeared (it normally appears a couple of seconds after page load)
     setTimeout(lookForPaywall, 500);


Padjelanta national park

One of last summers highlights was definitely a trip to Padjelanta national park in north of Sweden. We spent 4 nights in tents and did some hiking during the days. Padjelanta offered som magnificant views. Here follows some photos:

padjelanta helicopter
After 20 minutes in helicopter we landed i the middle of Padjelanta national park.
Padjelanta Virrijaure
We put our tents by the big gorgeous lake called Virrijaure
Padjelanta Virrijaure Sunset
Beutiful sunset first night

Internet of Things (IoT)

As i wrote in my previous post about Ardunio one of my hobbies are programming micro controllers. This have led me to get in touch of the term Internet of Things (IoT)

What I’m currently working with are internet connected NodeMCU ESP8266 modules that read temperature and humidity and reports it to my IOT web api.

The IoT web api i’m talking about it’s called and thats a web api that can be used by IoT developers to store data, toggle functions on connected devices, show historical values and more. The service will allow users to manage their dashboard and configure it as they want.

You can read more about Internet of Things here.

I will write more about this service and topic further on, stay tuned. 🙂


I got into the world of programming Arduino micro controllers after a colleague showed me his poker blind machine we used in a small poker “tournament” at work.

I bought some arduinos and competed a lot of different electrical laboratories where I learned a lot about handling electronics.

This have further led me to programming of other micro controllers and systems such as ESP8266, ARM Cortex M0 and other as my requirements of the hardware changed.

More about Arduino



Programming are as well one of my biggest hobbies but also part of my work as software developer.

I’m preferring the to code C# on the server side in frameworks such as Web Api and MVC. At work I also work with Web Forms.

On the client side i’m experienced in javascript frameworks such as Angular, Knockout, jQuery and more.

Stay tuned., i will write more under the category called programming 🙂


Ingress is a game i’m found of, I play it on my android phone. You can read more about ingress here.

I’m currently developing an app/web-page for supporting the community of Ingress. Users will be able to share their statistics, see progress and predictions of achievements.

The app will be called ICF Stats, Ingress Cross Faction Stats and will hopefully be launched within a couple of months as a public beta.

I will get back to this. 🙂