Skip to content

Instantly share code, notes, and snippets.

View quanhieu's full-sized avatar
🌊
challenge

Hieu Quang quanhieu

🌊
challenge
View GitHub Profile
@mynamebvh
mynamebvh / index.js
Last active January 13, 2026 07:15
Generate QR Banking
const VietQR = require("./vietQR");
const vietQR = new VietQR();
vietQR
.setBeneficiaryOrganization("970423", "mynamebvh")
.setTransactionAmount("50000")
.setAdditionalDataFieldTemplate("test");
console.log(vietQR.build());
@Phathdt
Phathdt / docker-compose.yaml
Created January 22, 2022 16:14
healthcheck
version: "3.9"
services:
db:
image: bitnami/postgresql:14.1.0
ports:
- '5433:5432'
environment:
POSTGRESQL_USERNAME: postgres
POSTGRESQL_PASSWORD: 123123123
POSTGRESQL_DATABASE: abc
@dongnguyenltqb
dongnguyenltqb / pg-try-advisory-xact-lock.js
Last active July 26, 2021 10:34
pg try advisory xact lock with retry
const { Pool } = require("pg");
const connectionString = process.env.db_uri || "postgres://localhost:5432/postgres";
const pool = new Pool({ connectionString });
function Locker(key, timeout, retryCount) {
this.key = key;
this.timeout = timeout || 200;
this.retryCount = retryCount || 5;
this.getClient = getClient;
this.aquireLock = aquireLock;
@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active January 1, 2026 14:33
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@paulnguyen-mn
paulnguyen-mn / reactjs-interview-tips.md
Last active October 11, 2025 20:28
Bí kíp cho buổi phỏng vấn ReactJS thành công 🎉

Bí kíp cho buổi phỏng vấn ReactJS thành công 🎉

From unplash.com

AGENGA:

  1. Một vài lưu ý chung
  2. Ôn tập kiến thức JS/ReactJS
  3. Cày thuật toán, giải thuật
  4. Tìm hiểu về công ty mà mình xin ứng tuyển
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active February 24, 2026 02:10
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@jastisriradheshyam
jastisriradheshyam / rsa_oaep_decrypt.js
Created August 17, 2019 19:06
RSA OAEP, encryption with Golang and decryption with NodeJS (node-rsa)
const nodeRSA = require('node-rsa');
/**
* return the decrypted Data (RSA OAEP Encryption)
* @param {string} RSAPrivateKey
* @param {string} EncrypteDataBuffer
* @returns {string} Data decrypted data
*/
var RSA_OAEP_Decrypt = function(RSAPrivateKey, EncrypteDataBuffer){
@duynguyenhoang
duynguyenhoang / nodejs_es.js
Created February 20, 2019 09:57
nodejs + ES
// Demonstrate https://stackoverflow.com/questions/54781538/node-elasticsearch-bulk-index-fails-silently
const elasticsearch = require('elasticsearch');
const elastic = new elasticsearch.Client({
host: `localhost:9200`
});
const inputArray = [
{
"index": {
"_index": "test-2019.02.19"
@utek
utek / wildcard-ssl-certificate.md
Created August 31, 2018 06:25 — forked from talyguryn/wildcard-ssl-certificate.md
How to get a wildcard ssl certificate and set up Nginx.

Request a new certificate

Get certbot

Go to any directory and clone repo with sources.

cd ~
git clone https://github.com/certbot/certbot
@miguelmota
miguelmota / rsa_util.go
Last active March 11, 2026 17:55
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)