This guide fixes Synology root storage issues, migrates Docker storage, and sets up a MinIO node for clustering.
- Root Filesystem (
/dev/md0):- Size: 2.3 GB
- Used: 1.7 GB
- Available: 483 MB (79% usage)
- Data Volume (
/volume1):- Size: 11 TB
- Used: 4.8 TB
| // from this article https://medium.com/@alonmiz1234/retry-dynamic-imports-with-react-lazy-c7755a7d557a | |
| export const retryImport = async (importer: () => Promise<any>) => { | |
| try { | |
| return await importer(); | |
| } catch (error: any) { | |
| // retry 5 times with 1 second delay and backoff factor of 2 (2, 4, 8, 16, 32 seconds) | |
| for (let i = 0; i < 5; i++) { | |
| await new Promise((resolve) => setTimeout(resolve, 1000 * 2 ** i)); | |
| // this assumes that the error message that the browser exception will contain this specific text. | |
| // if not, the url will not be able to parse and we'll get an error on that |
Whenever the topic of Bitcoin's energy usage comes up, there's always a flood of hastily-constructed comments by people claiming that their favourite cryptocurrency isn't like Bitcoin, that their favourite cryptocurrency is energy-efficient and scalable and whatnot.
They're wrong, and are quite possibly trying to scam you. Let's look at why.
There are plenty of intricate and complex articles trying to convince you that cryptocurrencies are the future. They usually heavily use jargon and vague terms, make vague promises, and generally give you a sense that there must be something there, but you always come away from them more confused than you were before.
This post was adapted from an earlier Twitter thread.
It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.
It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)
And then there's Rollup, which apparently requires ESM to be u
Welcome to step by step hands-on guide to setup webpack in your upcoming typescript project. Please follow the steps and you should be able to create your own webpack project. Please download the source code from github.
You will learn below things:
webpack.config.js file and modify webpack.config.js based on our need.| /* Basic example of saving cookie using axios in node.js and session's recreation after expiration. | |
| * We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js | |
| * Also, this example supports parallel request and send only one create session request. | |
| * */ | |
| const BASE_URL = "https://google.com"; | |
| // Init instance of axios which works with BASE_URL | |
| const axiosInstance = axios.create({ baseURL: BASE_URL }); |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.
gituser via Diskstation interface (with File Station and WebDAV privilages)git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.