Check out "Do you speak JavaScript?" - my latest video course on advanced JavaScript.
Language APIs, Popular Concepts, Design Patterns, Advanced Techniques In the Browser

Pairify - how to match balanced string pairs

posted in JavaScript on 2020-03-11   pairify balanced matches javascript pairs decided type stack line starter token code const position function category https

I'm now actively working on a VSCode extension. I started it as a theme but then decided to add some more features. Like for example a tin line on the left side of the editor marking the current function scope. In order to do that I had to analyze the current file's code and find the lines that are included in that scope. The obvious approach will be to translate the code to AST and then traverse the tree finding the information that I need. This however will require the usage of a language server which now I don't want to deal with. So I decided to explore a brute force approach. Looping over the string characters and finding balanced matches. I quickly wrapped it into a library. I called it Pairify. It consumes text and returns an array of pairs. This blog post will show you how it works.

read more

Webpack/TypeScript/React starter kit as of 2020

posted in JavaScript on 2020-02-23   webpack typescript starter react eslint beginning krasimir beginning npm run watch components app tsx src components app beginning https github

I just started using TypeScript. I did couple of React projects and noticed a pattern in the setup. I decided to export that to a starter kit 👉 beginning. It is based on Webpack with Babel and TypeScript loader.

read more

README driven development

posted in Architecture on 2017-09-06   library readme driven development api code writing make documentation started helped

I was doing a podcast episode with Kent C. Dodds when he mentioned README-driven development. And so I decided to try it out with a new library which I just started. Here’s what I found.

read more

Book review: Getting Started with Grunt: The JavaScript Task Runner

posted in Nodejs on 2014-04-21   book grunt experience free javascript task runner helpful started

I just finishing reading Getting Started with Grunt: The JavaScript Task Runner. The same book that we (I and Packt publishing) run a contest for. You could still joint it here and win a free copy.

read more

To all devs out there

posted in Architecture on 2013-11-26   good code don t project make end css server start things

There are few things which I'm thinking about last few months. I summarize them here. Initially, I started writing this article for the company which I'm working for - East Interactive. The material is not meant to teach. It just contains few thoughts of main and I hope that my colleagues will find it helpful.

read more

A bad side effect of the aspect oriented programming

posted in JavaScript on 2013-08-15   thing result function thing prototype dosomething start prototype dosomething function aspect oriented programming problem original class

I just read this very interesting article published on know.cujojs.com. It's about aspect oriented programming. At the beginning I thought "Oh, that's kinda cool", but when I start thinking about how I'll use it in practice I notice something bad. The blog post itself is well written and informative, but doesn't include any cons of the used technique.

read more

Javascript string replace and regular expression

posted in JavaScript on 2013-06-15   word git replace string innerhtml text replace element innerhtml text changetext function word creator linus torvalds linux creator linus source project started

The replace method in JavaScript is pretty much the same as in the other languages. Replace part/s of a string with something else. However, there are some tricky moments and I wanted to write this article, because I met this problem several times in the past. Actually, very often I use my blog as a documentation for myself and this is one of those cases. Probably I'll be in the same situation after week or so and I'll just check here for the proper solution.

read more

A short review of ExpressionEngine framework

posted in PHP on 2013-05-20   short review expressionengine framework s capabilities tech pro account article made project start

I'm going to start a new project with ExpressionEngine. So, I made a short review of the framework's capabilities. The article is available at my account in tech.pro.

read more

AS3: dynamic text field to curve (TextField on an arcing path)

posted in ActionScript on 2011-05-04   text var curvedtext textformat number radius tf direction endangle startangle

[2]Most of the articles here are tightly connected to my daily work. As you probably know from one of my latest posts (runtime font loading/embedding) I worked a lot with texts these days. There was a request for producing curved text from a dynamic field. Of course it wasn't so easy to create such a feature. I wrote a simple class that did the job and I decided to share it.

read more

Create your own tween manager class in AS3

posted in ActionScript on 2010-08-07   arr ease startpos calcendpos steps var calcendpos steps break object steps break case properties start public function

There are some features in Flash that we can't work without. Tween classes are among the most used ones. They give you ability to animate objects without using the timeline, to change the animation fast and easy. The idea of these classes is very simple. That's why I think that it is a good idea to have your own tween manager that you can modify to fit into your needs.

read more