Skip to content

Instantly share code, notes, and snippets.

View patoi's full-sized avatar
👀
...

István Pató patoi

👀
...
View GitHub Profile
@patoi
patoi / list-binary-git.sh
Created May 9, 2023 10:15
List binary git files for Markdown (or others)
View list-binary-git.sh
git ls-files --eol | grep -E '^(i/-text)' | grep "\.md"
View react+ts+vite+pnpm.md

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
@patoi
patoi / gist:79f35edc05e73f423db12fd8ef64158f
Last active January 21, 2020 15:22 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
View gist:79f35edc05e73f423db12fd8ef64158f
# 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
@patoi
patoi / haproxy.cfg
Created January 21, 2020 15:16
haproxy configuration: SSL termination of the local server – haproxy running in docker container
View haproxy.cfg
# 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
@patoi
patoi / signing-commits.md
Last active December 28, 2019 13:23
Signing commits
View signing-commits.md

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

@patoi
patoi / docserver.service
Last active August 10, 2023 13:52
Using systemd for nodejs process with nvm
View docserver.service
[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
View class-w-private-fields.js
'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'
View cl-cfn-class-speed-test.js
'use strict'
const ITERATION = 1000
console.log(
process.version,
ITERATION,
'iteration',
'with Type and freeze – v2: prototype based constructor function'
)
View Oracle Docker Instant Client Basic
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} .
View async-test-pattern.js
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 {