JS Blog Software development, entertainment, lifestyle.

CategoryWeb development

Avtomatska rokometna lestvica (WordPress plugin)


Last weekend I developed for an acquintance a WordPress plugin which I’ve titled “Avtomatska rokometna lestvica” (translates to “Automatic handball league table” from Slovene). He’s a contributor to an official website of RK Trimo Trebnje, my local handball club and asked me if it’s possible to have a functionality which replaces the manual work of...

One-liner for serving static files in Go explained


Whenever I want to set up a server for serving static files in Go, which is not often, I always have to spend some time to figure out the following one-liner. http.Handle("/images/", http.StripPrefix("/images/", http.FileServer(http.Dir("./images")))) What confuses me probably the most here is all three strings being practically the same. So in this post I will explain what this does for my...

Input validation with Folktale


In this post I’ll show a way to do input validation in JavaScript using Folktale which is a library for functional programming. The beauty of this approach is having validation rules (is required, is email, is confirmed, etc) specified as a callbacks so they can be reused across different forms and also the absence of control flow structures associated when doing input validation...

The best way of rendering a collection of items in React/Redux


In short The best way to render a collection in React, backed by Redux or other similar library: store a collection as an object where key is item id and value is item itself. That way when rendering collection, pass only item’s id to the item component. Than in item’s connected component query a collection by item’s id you passed early. So something like this. //Item.js import...

Like/dislike content or remove vote


I’m building an app around YouTube iframe api (which I wrote about already), where user can like/dislike content (a type of video which is a compilation of songs that can be targeted by time) or removing vote if clicking on the same vote type again. For example if user clicks on like button for the second time in a row, vote gets removed and page appears as user haven’t voted yet. To...

JS Blog Software development, entertainment, lifestyle.

About me

Jernej Sila portrait
Hi, I'm Jernej, a software engineer from Slovenia. Welcome to my personal blog. For more about me, my work and hobbies, please visit my profile page.