Skip to content

Instantly share code, notes, and snippets.

View cuongdcdev's full-sized avatar
🔥
👷🔨🪚💻

Cuong DC cuongdcdev

🔥
👷🔨🪚💻
View GitHub Profile
@cuongdcdev
cuongdcdev / gist:55b7cff20ae00da38a0353e3fb27b936
Last active September 3, 2023 10:02
IframeEmbedExternal.js
window.addEventListener('message', function(event) {
console.log("test");
var links = document.querySelectorAll("a");
for( var i = 0; i < links.length ; i++ ){
links[i].addEventListener("click" , function(e){
if(event.data.iframeDisableLink){
e.preventDefault();
}
window.parent.postMessage({
url: this.href
@cuongdcdev
cuongdcdev / gist:1183339c36d84b6ce66b206960651c45
Last active June 16, 2024 10:46
NEAR validator config.json
{
"genesis_file": "genesis.json",
"genesis_records_file": null,
"validator_key_file": "validator_key.json",
"node_key_file": "node_key.json",
"rpc": {
"addr": "0.0.0.0:3030",
"prometheus_addr": null,
"cors_allowed_origins": [
"*"
@cuongdcdev
cuongdcdev / nginx-create-site.sh
Last active July 21, 2025 16:14
Automates the creation of an NGINX configuration for a virtual host that acts as a reverse proxy (Nginx as reverse proxy for Node js)
#!/bin/bash
# Introduction: This script automates the creation of an NGINX configuration for a virtual host that acts as a reverse proxy.
# It is useful for setting up an NGINX domain as a reverse proxy for your Node.js app on a self-hosted env instead of have to use Versuck or Netlifsuck.
# The script automatically configures the domain for your Node.js app with SSL, optimized to work with Cloudflare SSL.
# Before you run this script, make sure to have: Nginx + Certbot installed + configured the domain first so that Certbot can obtain the SSL certificate.
# Usage: nginx-create-site your.domain.com --proxy=127.0.0.1:3000
DOMAIN=$1
PROXY_ARG=$2