Vue.js – global event bus

Vue is very nice JavaScript framework – fast to use and with clean code. Most of rules are logical and easy to understand, but some limitations may be strange and problematic. One of them is one-way data flow. We can pass data from parents to child elements automatically, but in reverse, use only events data. Sometimes it may be an issue, because we have nested components structure and would like to send event to top level parent.

Continue reading “Vue.js – global event bus”

Why you should try Zwift

I really dislike cycling in winter, in bad weather. There are a lot of difficulties with this, which make me angry and discouraged. It’s cold, so we need more clothes and also more time to prepare. It’s dark, because days are much shorter. I have very good bicycle flashlight, but I don’t like it anyway. It’s a mess, because of conditions, rain, snow we must clean our bike every ride. Not only bike, but also ourselves and flat, if we don’t have special place for our bike. Finally, it’s dangerous, because of lack of light and weather conditions, we have more changes to accident – independently or with car. Solution? Use trainer. But trainer is boring… Really? Not with Zwift.

Continue reading “Why you should try Zwift”

USB-C hub for MacBook: difficult choice

Apple redesigned MacBooks in 2016 and since then, these notebooks offers only two types of ports: USB-C with Thunderbolt 3, and audio jack. Most of us have a lot of devices with older, but still great and just enough USB-A port. Also, we sometimes need to connect other devices like LAN for network, external display or SD card. Apple called their devices “Pro”, but it isn’t for professional with such limits in very important matter. I use MacBook Pro 15 2018 and also had troubles with that. Notebook offers four, very advanced and high-bandwitch Thunderbolt 3 ports (do you know, that it can be used to connect external graphics card called eGPU to computer?), but it’s not simple, because I would have to exchange all my devices. Bad a solution, so it’s time to looking for USB-C hub with additional ports like USB-A and Ethernet.

Continue reading “USB-C hub for MacBook: difficult choice”

A few words about minimalism

One professor from my studies asked group: what’s the difference between big and small house? This question was tricky, because all answers were… bad. Ha could refute all our arguments related to big, but also to small house. Conclusion was simple: we should looking for the golden mean, something best for our needs. It was few years ago, but I still remember this question, and it’s very good option to start new topic – few words about possible advantages of minimalism in our life.

Continue reading “A few words about minimalism”

Fabric.js – change uploaded image color

Fabric.js is amazing library – I know, that we have a lot of drawing possibilities using canvas element, but “vanilla version” is not very readable and difficult to use. With fabric.js, everyting is much simpler and cleaner, we can also use a lot of build-in tools. One of them is image filters. We can modify images in many ways, apply for example sepia filter, but also make other changes. Last time I must just change image color. Yep, user can upload image (or I load image using static url), and I want to force using color, not original. Diffucult? Not with fabric.js.

Continue reading “Fabric.js – change uploaded image color”