Skip to content

Instantly share code, notes, and snippets.

View vanduc1102's full-sized avatar
πŸ›
πŸ’― πŸ’― πŸ’© πŸ˜† 🐒

Duke Nguyen vanduc1102

πŸ›
πŸ’― πŸ’― πŸ’© πŸ˜† 🐒
View GitHub Profile
// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract ERC20_Token_Sample is ERC20, ERC20Burnable {
constructor() ERC20("ERC20 Token Sample1", "Sample 1") {
@vanduc1102
vanduc1102 / content.js
Last active December 26, 2020 06:37
Jest testing DOM in Node
const fetch = require('node-fetch');
async function getContent(url, originRequest) {
console.log('Getting content from: ', url);
const { redirectUrl } = originRequest.query;
const { host, ...remainingHeaders } = originRequest.headers;
return fetch(url, {
method: originRequest.method,
headers: { ...remainingHeaders},
rejectUnauthorized: false
@vanduc1102
vanduc1102 / git_rebase.bash
Created September 12, 2020 15:42
Git rebase, assumed that you are working on branchA
BranchA : // Commit verything
BranchA : git fetch origin master:master
BranchA : git rebase master
// If no conflicts, you are lucky
// possible there are some conflicts ==> RESOLVE theme
BranchA : git add all_conflicts_files
BranchA: git rebase --continue
@vanduc1102
vanduc1102 / tut.md
Last active August 28, 2020 17:26
Add missing AMP scripts to Wordpress HTML HEAD

ISSUE

The tag 'amp-accordion extension .js script' appears more than once in the document. This will soon be an error.

The tag 'amp-carousel extension .js script' appears more than once in the document. This will soon be an error.

Reason

AMPforWP is using AMP as dependencies, AMP will add amp-scripts base on the Post content somehow at some senarios, it cant add the amp-scripts, so missing script error will appear on the AMP validator.

@vanduc1102
vanduc1102 / install.md
Last active August 17, 2020 04:45
Install .NET on MAC
@vanduc1102
vanduc1102 / site-ground.sh
Last active July 23, 2020 03:23
Site Ground Git Command to deploy
git remote add deploy-sit ssh://[email protected]:18765/home/your_username/public_html/test.yoursite.com/
git push deploy-sit your_local_branch:master -f
<?php
require __DIR__ . '/vendor/autoload.php';
# https://github.com/phpseclib/phpseclib
use phpseclib\Crypt\RSA;
$update_cache_url = $_GET['url'] ?? $_GET['link'] ?? '';
if( empty ($update_cache_url) || strpos($update_cache_url, 'https://www.sample.com.au/') === false ) {
die("Please provide a valid url, given: " . $update_cache_url);
}
# track this file .gitignore (i.e. do NOT ignore it)
!.gitignore
# ignore compiled / system files
*.com
*.class
*.dll
*.exe
*.o
*.so
setInterval(() => {document.querySelector(".invitation-card__action-btn").click()} , 3000);