Skip to content

Instantly share code, notes, and snippets.

View dcb9's full-sized avatar

Du, Chengbin dcb9

View GitHub Profile
  1. 安装 docker 和 docker-compose
  2. 创建一个名为 wp-demo 的目录
  3. cd wp-demo
  4. vim docker-compose.yml

填写以下内容

version: '3.1'
@dcb9
dcb9 / clash-for-asus-merlin-ac-5300.md
Last active November 15, 2024 00:45
ASUS Merlin AC-5300 使用 Clash 搭建透明代理
redis.replicate_commands();
local delayBucket = "dq_delay_bucket";
local readyQueuePrefix = "dq_ready_";
while true do
local first = redis.call("ZRANGE", delayBucket, 0, 0, "WITHSCORES");
local currTime = redis.call("TIME");
if first[2] == nil then
@dcb9
dcb9 / vscode-rmate.md
Last active January 4, 2021 02:47
VSCode rmate:使用本地 VSCode 访问和修改远程计算机文件

1. [本地] VSCode 安装 Remote VSCode

2. [服务器] 安装 https://github.com/aurora/rmate

sudo wget -O /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
sudo chmod a+x /usr/local/bin/rmate

3. [本地] VSCode 运行

@dcb9
dcb9 / 00-windows-daily-apps.md
Last active December 19, 2024 06:38
My Daily Apps
@dcb9
dcb9 / ANSI.md
Created July 5, 2023 15:27 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@dcb9
dcb9 / .pdbrc
Created August 30, 2023 03:55
My .pdbrc file
# autocompletion
import rlcompleter
import pdb
pdb.Pdb.complete=rlcompleter.Completer(locals()).complete
# show source code context before and after current line
alias n next ;; l
alias s step ;; l
alias u up ;; l
@dcb9
dcb9 / parseCustomError.js
Last active October 7, 2023 13:51
hardhat ethers parse custom error
const txHash = '0x...';
const contract = await hre.ethers.getContractAt(FIXME);
const tx = await hre.ethers.provider.getTransaction(txHash)
try {
let code = await hre.ethers.provider.call(tx, tx.blockNumber)
} catch (err) {
const code = err.data.replace('Reverted ','');
console.log(code);
console.log(contract.interface.parseError(code));
}