Apr 24, 2023 by Jordi Bassaganas
Let Crawlers Index Plain React Pages Without Next.js
By writing the static content in the public folder
A reason why Next.js is often preferred over plain React is for SEO purposes. Unlike the single page application (SPA) paradigm where the server sends all of the application's code in one single HTTP request, with Next.js the HTML code of the page is generated on each request.Read more...
Sept 12, 2022 by Jordi Bassaganas
Storing Multiple Refs in an Array With React's useRef() Hook
Let's store the refs in an associative array
Sept 8, 2022 by Jordi Bassaganas
How to Share State Variables Between React Components
Stop writing the same thing over and over again
When developing React apps, it's quite common to write reusable functional components which internal state will be shared by other Hooks. I had to do this recently while working on React Chess, a React Redux chessboard connected to a chess server.Read more...
Jul 18, 2022 by Jordi Bassaganas
Playing Chess Against Stockfish in a Linux Terminal
Here's how the UCI protocol works
Stockfish is a powerful, widely-used open-source chess engine. Its initial release dates back to 2008 and since then has become stronger and stronger to the point that today virtually no human can defeat it.Read more...
Aug 21, 2021 by Jordi Bassaganas
How to Rate-Limit a WebSocket Server
This is how I hardened a WebSocket server on Ubuntu
Rate limiting is about implementing security policies to control how much network traffic a particular service will receive. One of its purposes is to mitigate DoS (Denial of Service) attacks by cybercriminals. It is a crucial part of any hardening strategy and can be implemented in several different layers of the OSI and TCP/IP architecture stacks.Read more...
Jan 10, 2021 by Jordi Bassaganas
Why You Shouldn't Use Real Data for Development Purposes
It is not the right thing to do
You may end up using real production data instead of sample data because of a number of reasons among them tight deadlines or budget constraints. In a worst-case scenario, the data is at risk of being sent over email in a rush or even shared on Slack or Discord.Read more...