Used to make https://vimeo.com/610805063
Original images: https://unsplash.com/s/photos/ground%2Bsoil?orientation=landscape
const allImageUrls = new Set()
// run this after each time you scroll
Used to make https://vimeo.com/610805063
Original images: https://unsplash.com/s/photos/ground%2Bsoil?orientation=landscape
const allImageUrls = new Set()
// run this after each time you scroll
const { performance } = require("perf_hooks"); | |
const start1 = performance.now(); | |
JSON.stringify({ emailAddress: "arnaud.renaud@gmail.com" }); | |
const end1 = performance.now(); | |
console.log( | |
`Time taken to execute JSON.stringify function is ${end1 - start1}ms.` | |
); | |
const start2 = performance.now(); |
const { readFileSync, writeFileSync } = require("fs"); | |
function getFormattedTime(timeMilliseconds) { | |
return new Date(timeMilliseconds).toISOString().substring(11, 23); | |
} | |
const REPLACEMENT_PROBABILITY = 0.01; | |
const REPLACEMENT_CHARACTERS = "✴⦧⦖"; | |
function getRandomlyReplacedText(text) { | |
if (REPLACEMENT_PROBABILITY === 0) { |
Before deploying your app, make sure it is ready for production (cheatsheet here).
With example commands for Ubuntu:
ssh ubuntu@<hostname>
For reference: https://www.webservertalk.com/ubuntu-firewall-how-to-configure-ufw/.
Run the following:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22 # ⚠️ Replace by your actual SSH port (22 by default) — otherwise, SSH access will be lost after reboot!
With examples for Node.js services managed with Docker Compose:
npm run build
followed by npm run start
instead of npm run dev
)NODE_ENV=production
)docker-compose.prod.yml
, use expose
for internal services and ports
only for the gateway)GATEWAY_PORT=8000
)docker compose -f docker-compose.prod.yml up --build --detach
)restart: always
so that Docker will restart them automatically (after a rebootconvert *.jpg -resize 50% -set filename:f '%t' smaller/'%[filename:f].jpg' |
Vérifiez si Postgres est installé sur votre ordinateur :
psql --version
Sinon, installez Postgres.
Lancez la console Postgres en tant que l'utilisateur postgres :
const parseDate = (year, fullDate) => { | |
if (!year) { | |
throw new Error('arg year is missing'); | |
} | |
if (!fullDate) { | |
return new Date(year); | |
} | |
return new Date(fullDate); | |
}; | |
module.exports = parseDate; |