Skip to content

Instantly share code, notes, and snippets.

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

Cuong DC cuongdcdev

🔥
👷🔨🪚💻
View GitHub Profile
@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
@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 / 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
This file has been truncated, but you can view the full file.
// modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles
(function (modules, entry, mainEntry, parcelRequireName, globalName) {
<div id="theme-1">
<div class="np_avatar"></div>
<div class="np_title"></div>
<div class="np_description"></div>
<div class="np_social_links"></div>
<div class="np_social_extra"></div>
</div>
<div id="theme-1">
<div class="np_avatar"></div>
<div class="np_title"></div>
<div class="np_description"></div>
<div class="np_social_links"></div>
<div class="np_social_extra"></div>
</div>
jQuery(document).ready(function(a){backwpup_htmlspecialchars=function(t){return jQuery("<span>").text(t).html()},a.fn.backwpupDelayKeyup=function(t){var i=0;return a(this).keyup(function(){clearTimeout(i),i=setTimeout(t,200)}),a(this)},backwpup_tb_position=function(){var t=a("#TB_window"),i=a(window).width(),e=a(window).height(),n=720<i?720:i,h=525<e?525:e,o=0;return a("body.admin-bar").length&&(o=28),0<t.length&&(t.width(n-50).height(h-45-o),a("#TB_iframeContent").width(n-50).height(h-75-o),t.css({"margin-left":"-"+parseInt((n-50)/2,10)+"px"}),void 0!==document.body.style.maxWidth&&t.css({top:20+o+"px","margin-top":"0"})),a("a.thickbox").each(function(){var t=a(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),a(this).attr("href",t+"&width="+(n-80)+"&height="+(h-85-o)))})},a(window).resize(function(){backwpup_tb_position()}),backwpup_tb_position()});
<?php
/**
* BackWPup_Destination_Downloader
*
* @since 3.6.0
* @package Inpsyde\BackWPup
*/
use Inpsyde\Restore\Api\Controller\DecryptController;
use Inpsyde\Restore\Api\Module\Decryption\Exception\DecryptException;
@cuongdcdev
cuongdcdev / class-jobtype-wpexp.php
Last active July 22, 2020 15:34
class-jobtype-wpexp.php
<?php
/**
*
*/
class BackWPup_JobType_WPEXP extends BackWPup_JobTypes {
/**
*
*/
public function __construct() {
<?php
/**
* Class in that the BackWPup job runs
*/
final class BackWPup_Job {
const ENCRYPTION_SYMMETRIC = 'symmetric';
const ENCRYPTION_ASYMMETRIC = 'asymmetric';