Skip to content

Instantly share code, notes, and snippets.

View daog1's full-sized avatar
🏠
Working from home

xiaodao daog1

🏠
Working from home
View GitHub Profile
@daog1
daog1 / README.org
Created December 29, 2023 04:30 — forked from Ladicle/README.org
Emacs Configuration ver. 2022

Ladicle’s Emacs Configuration ver.2022

https://user-images.githubusercontent.com/1159133/156761456-4be104ae-4cb3-420e-81c7-8abd00497d51.png

Outline

Package Management (link)

  • leaf-keywords
    • el-get
    • hydra
  • package-utils

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@daog1
daog1 / bootstrap.sh
Created August 31, 2023 00:29 — forked from Bwc9876/bootstrap.sh
NuShell Bootstrap
# Bootstraps all tools
cargo install nu ripgrep starship bat
export PATH="$PATH:~/.cargo/bin"
NU_VERSION=$(nu --version)
CONF_PATH=$(nu -c "echo \$nu.config-path")
ENV_PATH=$(nu -c "echo \$nu.env-path")
CONF_DIR=$(dirname "$CONF_PATH")
@daog1
daog1 / instructions.md
Created August 9, 2023 12:06 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@daog1
daog1 / .tmux.conf
Created August 1, 2023 11:11 — forked from Godsing/.tmux.conf
Tmux 配置文件(保姆级注释,含部分插件)
# 1. 安装tpm: mkdir -p ~/.tmux/plugins && cd ~/.tmux/plugins && git clone https://github.com/tmux-plugins/tpm
# 2. 按 prefix + I(大写) 来安装插件
# 3. 安装 vim-obsession, 用 vundle 安装或: cd ~/.vim/bundle && git clone git://github.com/tpope/vim-obsession.git --depth 1 && vim -u NONE -c "helptags vim-obsession/doc" -c q
##### 以上需手工执行 #####
## 修改 tmux-prefix 键: ctrl+b --> ctrl+a
set -g prefix C-a
unbind C-b
bind a send-prefix
#set-option -g prefix2 `
@daog1
daog1 / Greeter.sol
Created November 22, 2022 05:18
合约调用合约
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
contract Greeter is Test {
string private name = "DMZ";
function greet(uint256 num) public {
emit log_named_uint("greet",num);
}
function greet2(uint256 num) public returns( string memory){
@daog1
daog1 / destr.py
Created October 1, 2022 09:12
move debug string
import sys
import re
while True:
line = sys.stdin.readline()
if len(line) == 0:
break
ms= re.match(r'.*\[(.*[\d])\]', line)
if ms == None:
print(line)
@daog1
daog1 / .gitignore
Created May 5, 2022 07:11 — forked from awalterschulze/.gitignore
compile git version inside go binary
mybinary
@daog1
daog1 / proxy.sh
Created April 30, 2022 13:05 — forked from Akagi201/proxy.sh
[proxy]
function proxy(){
#export ALL_PROXY=socks5://127.0.0.1:1086;
export http_proxy=http://127.0.0.1:1087;
export https_proxy=http://127.0.0.1:1087;
echo -e "芝麻开门了"
}
function unproxy(){
#unset ALL_PROXY
unset http_proxy
unset https_proxy
@daog1
daog1 / alternatives.sh
Created January 2, 2022 04:04 — forked from mpusz/alternatives.sh
Ubuntu scripts
#/bin/bash
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --remove-all clang
sudo update-alternatives --remove-all clang++
sudo update-alternatives --remove-all cc
sudo update-alternatives --remove-all c++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7