hello.js

var please = require('share');
console.log('thank you');

Thursday, 7 December, 2017 UTC

Simple JavaScript API wrapper

Simple JavaScript API wrapper

For handling API calls I have a small snippet I’m copying from project to project. I decided to clean it up, make more generic and share it. It is intended to be a starting point, so you might want to customize it to your custom needs. What it does? ... more


Saturday, 2 December, 2017 UTC

React Window decorators

React Window decorators

Two days ago I released two npm packages, window-scroll-manager and react-window-decorators. Scroll manager Scroll manager Plx uses the same scroll manager so I extracted it to the standalone package. is just a simple wrapper around scroll event, that ... more


Tuesday, 24 October, 2017 UTC

Animate between two react components

Animate between two react components

Just a quick proof of concept I made for transitioning between two react components. It animates height (of the parent) and fades components into each other. See the Pen React transition between two components by Stanko (@stanko) on CodePen. In componentWillReceiveProps ... more


Saturday, 7 October, 2017 UTC

Setting up Webpack, Babel and React from scratch, revisited

Setting up Webpack, Babel and React from scratch, revisited

Last summer I wrote this post which quickly became my most popular one to day. With webpack 2 and 3 it got outdated, so I decided to write a new one. Before we start I’ll assume you have a basic knowledge of unix terminal, npm and JavaScript. You did ... more


Wednesday, 27 September, 2017 UTC

My blog setup

My blog setup

Few days ago I got a following message on LinkedIn. Hi Stanko! I’m a junior front-end web developer and I recently found your amazing blog and fell in love with it. Since you don’t have any other social media, I decided to contact you trough here even ... more


Saturday, 2 September, 2017 UTC

How to update npm using nvm

How to update npm using nvm

If you are JavaScript developer and not using nvm you might want to look at it. Node Version Manager is easy way to install, manage and work with multiple node versions. And I recently got npm update notification, that looks like this: This is image ... more


Saturday, 2 September, 2017 UTC

React Image Filter

React Image Filter

On the project I’m currently working on, client’s logo is displayed in two versions, black on the white background and vice versa. To make their life easier, so they don’t have to upload two assets, I suggested SVG. Alas they can’t use SVGs (kinda long ... more


Wednesday, 26 July, 2017 UTC

Get element offset in JavaScript

Get element offset in JavaScript

When we left jQuery behind and embraced modern JavaScript frameworks, we thought we would never touch DOM directly again. Well that is not entirely true. There are a lot of cases when you need to get some DOM element size. For element’s dimensions .offsetWidth ... more


Monday, 24 July, 2017 UTC

Plx - React parallax component

Plx - React parallax component

I’m becoming predictable. Again, I haven’t found component I like, so I wrote my own. This time, I’ve build React component for parallax (on scroll) effects. Check the live demo. It is called Plx , it is open source and available on GitHub and npm. What ... more


Friday, 23 June, 2017 UTC

Animate React component by calling 'setState' in 'componentDidMount'

Animate React component by calling 'setState' in 'componentDidMount'

On the frontend, we do a lot of animations. Most of the simple animations I create by using CSS transitions. Either I will change class or inline style of the element, and define transitions in CSS file. Easiest way to do this in React is to render initial ... more


Wednesday, 17 May, 2017 UTC

React scroll decorator

React scroll decorator

I love JavaScript decorators. One that I copy to every React project is scroll decorator. It is fairly simple way of injecting scroll position to react components. This way you can handle scroll using react lifecycle. This decorator is not listening ... more


Tuesday, 9 May, 2017 UTC

Work&Co Tech Meetup Vol 6

Work&Co Tech Meetup Vol 6

Another tech meetup coming up. This time we have three great talks about engineering and project planning. We also have a special guest - IT girls team . The IT Girls team will share their advances in promoting the professional development of women in ... more


Monday, 6 March, 2017 UTC

React animate height (slide up/down) component

React animate height (slide up/down) component

Most JavaScript developers used jQuery’s .slideUp() and .slideDown() methods, and got used to them. As component based frameworks usually do not include such functionality, the first logic choice is to turn to CSS. But alas, CSS transitions do not work ... more


Sunday, 5 March, 2017 UTC

Couple of talks I really liked

Couple of talks I really liked

In this post you can find seven talks I really liked in no particular order, most of them development related. I’ll explain why I liked them, and why I should recommend watching every single one of them. Every talks is embedded, but link to a website ... more


Saturday, 21 January, 2017 UTC

Mobile Chrome vh units fix

Mobile Chrome vh units fix

If you ever used vh units and tested your work on mobile Chrome (iOS and Android), you probably were annoyed by page jumping when you scroll. As you probably know vh units are based on the window height. When you scroll, Chrome’s address bar disappears ... more


Wednesday, 18 January, 2017 UTC

Deploying React (Router) app to the subfolder on server

Deploying React (Router) app to the subfolder on server

If you ever had to deploy React Router app to the subfolder on the server, you know what the problem is. Dev server will always launch app on the server root. And routes will get messed up once you upload it to the server. Here are two solutions I use ... more


Thursday, 12 January, 2017 UTC

Winter Tech Meetup Vol 5

Winter Tech Meetup Vol 5

We prepared another tech meetup, this time with four presentations. There will be a break after the second one. This should be the biggest one so far, with two guest speakers. It will happen on February the 4th, at Belgrade Youth Centre. Hope to see ... more


Wednesday, 28 December, 2016 UTC

Counting sheep

Counting sheep

Just something to cheer you up for the holidays :) I got this idea while I was sick in bed, and had nothing smarter to do. Pure CSS, no JavaScript at all. Hope you like it, I may add some more details. See the Pen Counting sheep by Stanko (@stanko) on ... more


Wednesday, 21 December, 2016 UTC

Looking forward to the 2017

Looking forward to the 2017

2016 was quite a ride. I just want to write a couple of random things, to close this year with one last post. Work & Co Big news here, my ex-company became a part of Work & Co. We’re really excited about that, and I’m looking forward to the great ... more


Thursday, 24 November, 2016 UTC

Setting up Webpack, Babel and React from scratch - Part 3

Setting up Webpack, Babel and React from scratch - Part 3

Part three - also the last part Other parts: Part 1 - Webpack, Babel, React, Router, ESLint Part 2 - SASS, more ES6 goodness (Static props, decorators, deconstruction…) Part 3 - Where to go from here Where to go from here I really wanted to continue this ... more


Thursday, 24 November, 2016 UTC

React and Redux, Webpack 2 boilerplate

React and Redux, Webpack 2 boilerplate

Currently, I’m working on a relatively small pet project. While setting it up, I decided to extract a webpack boilerplate from it. As whole JS community is moving really fast, I found very hard to set everything up using Webpack 1.x. One package would ... more


Thursday, 20 October, 2016 UTC

Blog redesign and new features

Blog redesign and new features

As you probably noticed I redesigned my blog and added some new features. This is a list of the new stuff. New design Category pages Comments Search Reading time Share buttons New design My friend Nikola, from MIDA digital agency, helped me a lot with ... more


Wednesday, 28 September, 2016 UTC

Plain JavaScript animated window scroll function

Plain JavaScript animated window scroll function

Before modern frameworks, I always used jQuery’s scrollTo method. At some point, not every project included jQuery, so I wrote simple function to animate window scroll. I have kept copying that function from project to project. Finally I took some time, ... more


Monday, 29 August, 2016 UTC

Setting up Webpack, Babel and React from scratch - Part 2

Setting up Webpack, Babel and React from scratch - Part 2

Part two Update: Part two is pretty much done. Part three will cover redux and production builds. Other parts: Part 1 - Webpack, Babel, React, Router, ESLint Part 2 - SASS, More ES6 goodness (Static props, decorators, deconstruction…) Part 3 - Where to ... more


Tuesday, 23 August, 2016 UTC

Setting up Webpack, Babel and React from scratch

Setting up Webpack, Babel and React from scratch

Update, October 2017 I just released updated tutorial right here. So feel free to skip this one, and read a new one. It uses updated tools, and hopefully it will grow into a new series of webpack/react posts. Update, March 2017 Webpack 2 is out, so this ... more


Wednesday, 29 June, 2016 UTC

Sektor - draw and animate SVG sectors

Sektor - draw and animate SVG sectors

For a current project I’m on, we needed both circular timer, and progress bar. Again, I wasn’t able to find small library to do that. But I found awesome answer on Stack Overflow, decided SVG is way to go, and wrote Sektor. Sektor is a plain JavaScript ... more


Saturday, 7 May, 2016 UTC

Highlight variables in Atom, Babel template strings

Highlight variables in Atom, Babel template strings

Atom Babel plugin doesn’t highlight variables in ES6 (ES2015) template strings. You’ll need to add this snippet to your Atom’s style.less atom-text-editor::shadow .variable.js { color: #F8F8F2; } In general, you can just inspect stuff in Atom, find out ... more


Monday, 18 April, 2016 UTC

Switching to Atom, this time for good

Switching to Atom, this time for good

I’m a big fan of Sublime Text editor, which I was using for years now. Minimal, fast, reliable. But there is one big problem with it. Only one man is working on it’s development and community really slowed down. JavaScript ecosystem is going forward ... more


Monday, 21 March, 2016 UTC

Custom scroll bars

Custom scroll bars

Generally when comes to replacing native UI components, I’m strongly against it. But, we’ve all been there, when the client insists on it. You’ll see how to style it via CSS (webkit only), apply pure JavaScipt plugin with native scrolling or apply simple ... more


Saturday, 12 March, 2016 UTC

Simple React slider with touch support

Simple React slider with touch support

I needed simple React slider component, as we are building our new website as a universal React application. But I did not find anything lightweight. There is a crazy trend in JavaScript world - add gazillion dependencies. So again, I made something ... more