Recently, I stumbled upon a couple of insightful blog posts that delve into a subtle yet significant issue in JavaScript: memory leaks caused by nested functions and closures. This topic is crucial, if you’re a React developer as it explains the drawbacks in useCallback hooks. Original example I was reading Jake Archibald’s post where he discusses how nested functions can inadvertently retain references, leading to memory leaks. The following code snippet illustrates this scenario:...
3D printed screws
My main reason for buying a 3D printer was to print mechanical parts - both for learning and creating home projects. Unfortunately, it took a while to start printing my own threads and screws. The main reason was the printer accuracy, which was insufficient for small threads for the early printers. Today’s printers have much better accuracy, so we are able to print screws and threads. On my MK4, I was able to print reasonable threads down to M4 diameter (I believe M3 is achievable too)....
Automate home appliances
Smart home and Internet of Things (IoT) devices are more present in our homes today. This process started several years ago and will continue with the old devices being changed. TLDR: Smart sockets and power consumption analysis. This is not a silver bullet and needs adjustments. Non-smart appliances As I’ve already automated half of my home, I look at my 3 years old dishwasher with sadness, knowing a year later a “smart” version was released....
Native tests for iOS expo modules
Problem You want to test the native code you’ve written for your React Native app using expo modules. Custom native functions are great candidates for unit testing (if you still haven’t started writing them) as often they are separated from the view layer. Simple approach The simplest solution is to use the React Native Testing Library or other tools to test it directly from the React Native. But this approach introduces some additional issues you need to consider:...
Anti-vibration mats
If you’re a 3D printing enthusiast, you know how noisy these machines can be. The constant whirring, beeping, and vibrating can quickly become a nuisance, especially if you’re working in a shared space. Fortunately, there can be an easy solution to reduce the noise generated by your 3D printer: anti-vibration mats. How do they work Anti-vibration mats are made of materials that absorb vibrations, reducing the amount of noise that the printer generates....
Port is already in use issue on the macOS
TLDR lsof -i:<port> | awk 'NR==2{print $2}' | xargs kill Replace <port> with your port number. Why do you need it? Many things happen on the computer during coding. Your favourite IDE wants to restart and update, the system requires a security update, or you already run that process, but you cannot find it in the crowd on the screen. The best idea is to restart the computer then, but there are cases you cannot afford to do that....
How to create your own resin cofiguration for the Lychee Slicer
I have to admit that filament printing with Prusa MK3s is way better than printing using resin. Unfortunately, It is hard to print quality miniatures on a filament printer. I bought a cheap Anycubic Photon Mono 4K printer with Anycubic Eco Resin Gray to achieve that. Today I also want to share my thoughts on converting the STL file to a printer file on resin. Let’s say we already have an STL file that we want to print....
Calathea movement
How many times have you noticed that your plant is in a slightly different pose than a day before? Calathea is one of the plants that move quickly. With the help of my wife, I recorded its movement for 10 hours and made a timelapse of that.
Hello world!
Introduction This is the first post!