June 16, 2023

develop an Express.js application using TypeScript

To develop an Express.js application using TypeScript, you need to follow these steps: npx tsc –init `npm install express @types/express –save `typescriptimport express from ‘express’; const app = express(); app.get(‘/’, (req, res) => {res.send(‘Hello, Express!’);}); app.listen(3000, () => {console.log(‘Server started on port 3000’);}); `npx tsc `node app.js npx tsc && node app.js“` This will start […]

May 28, 2023

Scaleway GLACIER class object storage with restic

I’m starting to use C14’s GLACIER storage class with restic, and until now it seems be working very well. I suggest to create the repository in the usual way with restic -r s3:s3.fr-par.scw.cloud/test-bucket init, which will create the config file and keys in the STANDARD storage class. For backups, I’m using the command: similar to what you did, […]

May 28, 2023

Parsing JSON with Unix tools

There are a number of tools specifically designed for the purpose of manipulating JSON from the command line, and will be a lot easier and more reliable than doing it with Awk, such as jq: You can also do this with tools that are likely already installed on your system, like Python using the json module, and so […]

May 28, 2023

Detect Route Change with react-router

react-router v6 In react-router v6, this can be done by combining the useLocation and useEffect hooks For convenient reuse, you can do this in a custom useLocationChange hook If you also need to see the previous route on change, you can combine with a usePrevious hook It’s important to note that all the above fire on the first client route being mounted, as well as […]