One common type of problems reappearing over and over again on stackoverflow.com is “reusing” a single instance of any of the Subject classes and then being surprised that it doesn’t work as one might expect.

Let’s start by talking about Subjects and their internal state and why is it so important to be aware of complete and error notifications. Then we’ll move to more interesting examples with ReplaySubject and BehaviorSubject classes.

All Subjects have an internal state that reflects the most basic principle of Rx. Every Observable emits zero or more next notifications and one complete or error notification but…


In 2015 I worked on a web app in AngularJS that seemed to be very simple but over time it evolved into a quite large project and I was hit by Angular’s performance soon and really hard.

I realised how little information is available apart from the most basic recommendations and since I’ve spent some time optimising our AngularJS app to run well even with 100 000 rendered expressions at once I thought it would be worth sharing it with others.

Everything in this article is related to AngularJS 1.4 and the later part to Polymer 0.5 but I belive…


Node.js is a brilliant product. It gives you so much freedom and I think it’s ideal for single purpose web servers.

Another great thing is WebSocket. Nowadays it’s widely supported and its usage is mostly in very specific applications such as games or Google Docs. So I wanted to try to make some very simple real world application.

WebSocket requires it’s own backend application to communicate with (server side). Therefore you have to write single purpose server and, in my opinion, in this situation Node.js is much better than writing your server in Java, C++, PHP or whatever.

Btw, if…


if you’re trying to use libwebsockets you probably want to build your own awesome WebSocket server.
I’ve already made a tutorial on how to make a web server using libwebsocket and finally now I’m going to make a very simple WebSocket server. At first, I wanted to make just a “port” of my previous tutorial on Node.js but this would be I think much more complicated and I wanted to keep this as simple as possible.

But still I recommend you to read the first tutorial about building a web server because there are some insight of how does libwebsocket…


I was quite surprised that there aren’t many WebSocket libraries for C. I made a small research and found this nice list of various implementations on wikipedia. It says that there are only 2 implementations of Web Sockets in pure C (not C++) so I made a quick look at both of them and they look pretty complicated but because I didn’t have any other option I stayed with libwebsockets which seems to be up to day (according to the git log) and it can be easily used as a web server as well. …


In my previous work I spent a lot of time programming automatic parsers for sport results from various websites. I found it quiet hard to find a useful tutorial on parsing HTML pages so I decided to write one. In this short tutorial I’m going to write parser that will crawl pages with English soccer league results using XPath and traversing DOM.

BTW, if you’re looking for some more complicated examples on parsing in PHP using XPath, try look at this PHP Documentation Parser. It’s a parser that I used for PHP Ninja Manual.

You can see full source code…


I like TinyMCE, I think it’s the best wysiwyg editor you can get. There’s just one thing that bothers me quite a lot. By default TinyMCE outputs really messy HTML code. For instance imagine you want to make an ordinary unordered list.

The output is following:

<ul>
<li>
<span style="font-size: x-small;">
<span style="font-size:10px; line-height:16px;">first</span>
</span>
</li>
<li>
<span style="font-size: x-small;">
<span style="font-size:10px; line-height:16px;">second</span>
</span>
</li>
<li>
<span style="font-size: x-small;">
<span style="font-size: 10px; line-height: 16px;">third</span>
</span>
</li>
</ul>

Why the hell so many spans and styles?

Fortunately there is a simple solution (it just took me 3 hours to find it)…

Martin Sikora

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store