Monads and JavaScript

There is a countless number of articles that try to describe what are monads. I can’t resist writing another one on my own.

Handle input from keyboard in Elm

Often we need to perform certain actions as a feedback to the input from the keyboard. For example, when we need to navigate within a list up and down or perform an action when the meta key (alt or shift) is pressed.

The implementation of function composition using spread operator and fat-arrow syntax

In this note, I would like to demonstrate code refactoring of my implementation of the function that does function composition. We’re going to use spread operator and fat-arrow functions.

One more way to implement carousel

There are lots of implementations of it: jQuery based, vanilla-js based, heavy and lightweight. Some even claim that their solution is the only one you might ever need. However, there will always be a situation when the existing solution simply doesn’t work.

Life is easier with partial application

Partial application is a powerful thing. A function can be applied partially when it is curried. For example,

Port forwarding for Docker on OSX

Sometimes you need to debug a mobile version of an app you’re working on that runs in docker virtual machine. Thus, you need a port forwarding. In this article I’d love to share a few simple steps of how to do this on OSX.

Reducing entropy with componentisation

Everybody talk about components now. WebComponents are gaining momentum, JS frameworks adopts the ideas of componentisation. But is it something really new? Let’s find out.

Abstractions and code

How do we know that we’re good programmers or not? Maybe we should collect statistics of feedbacks about our code? Maybe we should attend meet-ups and talk to our colleagues and make sort of self-judgment? Probably. But on the other hand, you may ask who cares whether I am a good programmer or not! At the end, we make money and business is happy about a products I build. To certain extent, it’s true. But what if you are something more than just a regular programmer who wants to have safe and stable profession? If you are really passionated and interested in producing high quality code - I’m all ears.

Flexbox advantures

Due to the fact that flexbox’ specification is quite stable nowadays, it’s cool to use it. Recently, I tried to use it for quite a complex UI.

Pseudo class selectors are tricky

Pseudo class selectors are great mean to simplify our life as front-end (and sometimes even back-end) developers. However, there is a trick that both sides should know about and it’s related to how the browser parse our CSS code.

How to generate documentation for your project

Keeping documentation up to date is always hard. Especially for young projects, when the API is unstable.

Architecture of big AngularJS applications

Building a domain-specific application can be tricky. Here I want to outline my thought about how to organise your AngularJS code in a way that helps to solve some common problems and help not to end up with unmaintainable code base in the future.

How to build components with AngularJS

First of all, I’d love to start with a small preface. Currently, I’m working on a big project. It is complicated. It renders a lot of data, it has a lot of business logic on client, it should work offline on mobile devices. We have a big feature upcoming and we faced a problem. Due to the fact, that the software we’re building is very specific, we couldn’t user any existing UI framework. Thus, our team decided to build our own framework. However, as it usually happens, the only first step has been made toward the thing that can be called a framework. Thus, we decided to build a library of UI Components and at the same time develop CSS framework for our needs.

Angular, CSP & Chrome Apps

If you want to develop a Chrome App using AngularJS, you would probably bump on an error related to CSP (Content Security Policy).

A small note about good & bad code

Currently, I am doing refactoring of a piece of JavaScript code. Actually, this is pure jQuery-style code. The idea is to have an input that will clone itself when user move focus in the input. The old code look like that:

Great refactoring

A couple of days ago, I have finished the great refactoring of JavaScript part of our project. In this post I want to share my experience.

Working environment & Linux

Currently, I am working in a post-Microsoft company. It means we have a lot of old PCs with Windows. However, I used to Mac. I asked about providing the me with Mac, but company simply said that we have tons of old hardware so we won’t buy you a Mac. Put it simply, keep calm and write code. So, they gave me the old PC with Windows 7. I tried virtual machine, but for some reason it crash all the time. So, I decided switch to Linux.

RequireJS & Bundles

Nice way to organise your code in bundles with RequireJS

Quick union and States hierarchy algorithms

Quick Union Implementation for an array of integers

parseBool in JavaScript

Once, my friends and I were kidding about functions in JS and one guy complained that there is no method to parse booleans. So I decided to fix this. Here is the link. :) The code is not perfect. But on the other hand this is only a start :)

Send assets via WebSockets

Recently I was watching a video about SPDY and later I got a nice idea about something similar. Why can’t we send assets via WebSockets? So, I decided to create an example. You can see it in my GitHub repo. It is build with help of

Howto: start with Grunt and Bower in your project

This note is about Grunt and Bower. For beginners. I use these cool tools every day and I can’t imagine my life without them. However, I remember myself when I was trying to understand how all this work together. Now, when it is done, I want to share my knowledge with other people. If you find Grunt or Yeoman or Mimosa hard, then this article might help you and save a lot of time in future.

Shared database between different development machines for Wordpress.

A few days ago I’he been asked to join a guy who works on WordPress-based project. We started think about how to work on in simultaneously. So what that is that we’ve got for that moment:

Nice menu effect with pure CSS3

We always struggle with menu and CSS and even try to use some jQuery plugins. However, recently I used nice solution for menu. The secret is very simple: you should expand menu items instead of menu box itself. Let me explain.

A small note about AngularJS

Recently I tried AngularJS. This framework is awesome! Now I want to write a small note of my vision of how an application with multiple controllers and services can work.

Live recalculation with KnockoutJS

I really love this framework. And here I want to present a very small sample of code for beginners. How to make my app recalculate values of form automatically in live? It is very easy with KnockoutJS!

Clone object with observables

I was tackling the problem of cloning objects within KnockoutJS App. The original task was to create two lists and make them able to move items from one to another (observable arrays). A user also may has a possibility to roll-back last action. The items in second list are editable copies of the items from the first list. The solution appears to be incredibly simple!

Simple view inheritance example with BackboneJS

Let’s imagine that we have two views in our Backbone.js app and we the first one to be inherited from the second one.