Installing Node.js 18+ on CentOS 7: Fix glibc Compatibility Issue
Recently I had to install node 18 on an old CentOS 7 machine. Upgrading was not possible. Considering node 18 is relatively old, I didn’t expect any issues.
Turns out, node 18+ is not officially supported in CentOS 7.
CentOS 7 doesn’t have the necessary glibc library version for me to install newer node versions. If you try to install node 18 you get the following error:
node:…
Every now and then I need to work on a front end project that has large amount of image assets. In this article I’ll give you my go to list with MacOS apps I use to reduce the file size and speed up loading times.
Continue reading Reduce image assets size on MacOS
I’ve been a Firefox user for a long time (since version 1.5). I still use Firefox every day.
Last year I tried Arc for couple of weeks.
What I liked about Arc is its approach to browser design. Spaces really help you separate your work streams, and the nature of vertical tabs helps with many tabs when doing research. If I was a Chrome user this is probably the browser I would’ve picked.…
One issue I hit with Claude Desktop app was getting MCP integrations working locally with npx. I tried the examples from the documentation:
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}
No matter which MCP server I tried I was getting the same error again and again.
MCP puppeteer: Server disconnected. For troubleshooting…
If you are an Angular developer, you’ve probably noticed that since Angular 2+ they break with almost every release. After wasting many hours in futile attempts to fix them and going through numerous report on Angular GitHub page I finally got to a setup that works.
Fixing dependencies (vendor) sourcemaps
Open angular.json and find targets->build->configurations
Mac Terminal comes with several color schemes but non catches the eye like SMYCK. The pastel colors it comes with are easy on the eye and you’ll appreciate the theme the more you use it.
Download the theme ZIP archive.
Install it by running Smyck.terminal
Open Terminal → Preferences from any Terminal window
Select Profiles tab and scroll to Smyck theme at the bottom.
Windows built in Command Prompt is ugly and dated. It also lacks proper Git integration. Git for Windows comes with a configured Git Bash you can use instead. Combine that with Mintty and you now have a full featured themeable terminal rivaling the built in Mac OS Terminal. In the Git for Windows installer choose Use MinTTY when asked to configure the default emulator. This will allow you to…
Adding predefined actions to Firefox 57 address bar
Adding actions to Firefox 57 address bar
One of the first things I’ve noticed in Firefox 57 was the Pocket button in the address bar and the additional actions in the menu on the right. Then, while using Pocket I right clicked and selected Remove from Address Bar. Good, this removed Pocket from there but, ugh, how do I return it back? And what about placing other buttons will I use often like the new Take a Screenshot action? Turns out…
With the rise of Bitcoins, Ethereum and cryptocurrencies everyone are talking about mining again. Video cards price has skyrocketed in the last 2 months. If you are late for the mining ride, you don’t have the knowledge or time to build your own mining rigs or you just don’t like risking it there are others risk free ways to obtains cryptocurrencies. You can use faucets. Faucets are websites or…
IntelliJ IDEA (Webstorm) comes with many live templates but it has none for Vuejs 2. I’ve created a few simple templates to use for my projects. All the templates assume you’re using a transplier for ECMAScript 2015. Vue components template is setup for usage with SASS but you can easily modify it and use Stylus instead. You can find the templates at idea-vue-templates. Installation Download…
Twitter have changed variables names in Bootstrap 4 so the original SASS files that come with Select 2 bootstrap theme won’t work. Until there is a BS 4 compatible theme for Select 2 you can use the variables overrides below for your project. NOTE: Import order is important. Theme variables are marked with !default. Declare those variables before the select2 theme import or your SASS compilation…
Several months have passed since Angular 2 was released. Then came Angular CLI promising easier scaffolding and better integration. It’s still in beta and as expected there are things to improve. One thing that confused me was ng serve and the lack of support. It’s easy when using ng build with the -bh flag and same feature for serve would’ve been great. Unfortunately the CLI team doesn’t plan on…
Twitter Bootstrap 3 is great for creating responsive websites. It comes with many components and features that are easy to use and has a great documentation. That’s not always enough. Sometimes you need additional JavaScript functionality or custom CSS. You might even want to add additional jQuery plugins. Sooner or later you’ll hit an issue with some plugin or your code breaking stuff. In this…
One of the things I hate about Phonegap (Cordova) is the audio support. Every time I worked on a project that required heavy audio usage not a single plugin worked fine Cordova Media plugin is good for recording audio but when you try to play multiple audio files it leaks into memory and the OS stops your app. It also tends to break after using the recording feature. I’ve also tried the Native…
Many of you have probably wondered which format is better or which should be used. You might have even participated in a full blown nerd rage war on the matter.
Both formats are good when you want to describe a hierarchical structure.
Differences
XML is a markup language and is good for documents description or text documents with formatting information.
JSON syntax is light. It's much easier to parse from JavaScript and that's why it's preferred for browser-based and Phonegap mobile applications.
If you are creating a web service which will be used with a JavaScript driven front-end then it's better to go with JSON. It's native for JavaScript so you'll be spending less time on parsing.
If, for some reason, your web service returns XML and the front-end is written with JavaScript then you can just use the default DOM parser. If, however, you are not familiar/comfortable with it or you are using some cool fancy `XML to JSON` scripts then you are doing it wrong and should probably change your server code to return JSON. This will improve the parsing performance of your code and will reduce the total JavaScript libraries that get loaded at startup.
If your front-end is an Apache Flex app or a Starling game then XML is the right choice. Action Script 3 XML parser is really powerful and nicely working.
XML is great when your data contains styling information like text style or formatting.
If you need a really really complex data structure with information coming from lots of sources then the XML format together with namespaces is the best choice. This way you'll also avoid naming clashes.
XML is slightly more readable from human beings than JSON. If the content will be static and edited by Muggles (not programmers) then go with XML. But if, and only if, you have a bunch of Muggles who are well trained in the art of magic basics, you can also choose JSON.
If the bandwidth is of high importance for you then the XML with its close/open tags (container tags) will take up unnecessary resources. JSON on the other hand is just a simple key/value pairs which will lead to less traffic.
Conclusion
Both formats have their pros and cons. The choice really depends on the technologies you'll be using and the specifics of the data. My guess is that in most cases you'll be working with JSON, but there are still some XML islands here and there.
I, personally, am secretly obsessed with using the XML plus XSLT combo, so rejoice fellow elderly orcs! XML is still alive...ish.
How to read an HTML page with UTF8 encoding using PowerShell
Yesterday I was working on a project that requires heavy HTML pages content scraping.
What I wrote were several PowerShell files which were scraping the content using Invoke-WebRequest and Invoke-RestMethod. And everything was great and smooth... until I got to an HTML page with some Greek letters inside. To my surprise both PowerShell built in functions failed miserably when I tried to retrieve those UTF8 encoded pages. In short, I was bombarded with â and ¢ here and there.
So, after I lost several hours trying to figure out what's going on and experimenting with all kinds of options it turned out It's impossible to read properly a UTF8 encoded page without BOM with Invoke-WebRequest.
Here is a simple function I wrote which uses .NET classes to tackle the problem.
Note that this is just a simple example and it lacks the extensible functionality you get with Invoke-WebRequest.