react+ts+vite+pnpm
pnpm init @vitejs/app app -- --template react-ts
cd app
pnpm install
git init && git add -A && git commit -m "initial commit"
#pnpm run build
pnpm run dev
pnpm init @vitejs/app app -- --template react-ts
cd app
pnpm install
git init && git add -A && git commit -m "initial commit"
#pnpm run build
pnpm run dev
# Generate a unique private key (KEY) | |
sudo openssl genrsa -out mydomain.key 2048 | |
# Generating a Certificate Signing Request (CSR) | |
sudo openssl req -new -key mydomain.key -out mydomain.csr | |
# Creating a Self-Signed Certificate (CRT) | |
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt | |
# Append KEY and CRT to mydomain.pem |
# If you already have an haproxy.cfg file, you can probably leave the | |
# global and defaults section as-is, but you might need to increase the | |
# timeouts so that long-running CLI commands will work. | |
global | |
ssl-default-bind-options ssl-min-ver TLSv1.2 | |
ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256 | |
maxconn 4096 | |
# log stdout local0 debug | |
defaults |
Generating GPG key
gpg --full-generate-key
Choose default RSA, set to 4096.
Setting git local repo config
gpg --list-secret-keys --keyid-format LONG
[Unit] | |
Description=Document Server Daemon | |
[Service] | |
Type=forking | |
Environment=NODE_VERSION=12 | |
WorkingDirectory=/home/your_user/your_node_app_dir | |
ExecStart=/home/your_user/.nvm/nvm-exec npm start | |
StandardOutput= | |
User=your_user |
'use strict' | |
// this is run only on v12, because private field | |
const ITERATION = 1000 | |
console.log( | |
process.version, | |
ITERATION, | |
'iteration', | |
'with Type and freeze – v2: v12 only, private field' |
'use strict' | |
const ITERATION = 1000 | |
console.log( | |
process.version, | |
ITERATION, | |
'iteration', | |
'with Type and freeze – v2: prototype based constructor function' | |
) |
FROM node:8-alpine | |
# the client version we will download from bumpx repo | |
ENV CLIENT_FILENAME instantclient-basic-linux.x64-12.1.0.1.0.zip | |
# work in this directory | |
WORKDIR /opt/oracle/lib | |
# take advantage of this repo to easily download the client (use it at your own risk) | |
ADD https://github.com/bumpx/oracle-instantclient/raw/master/${CLIENT_FILENAME} . |
it('your test', async function() { | |
let args = ... // your test data | |
let result, error // variables: test and guard in the finally block | |
try { | |
result = await testFunction(args) | |
} catch (err) { | |
error = err | |
} finally { |
it('is OK - better way', async function() { | |
let result, error | |
try { | |
result = await testFunction(true) | |
} catch (err) { | |
error = err | |
} finally { | |
expect(error).to.be.undefined() // guard: handling code flaw | |
expect(result).to.be.equal('OK') | |
} |