Package Management (link)
- leaf-keywords
- el-get
- hydra
- package-utils
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.
Description | Syntax |
---|---|
Get the length of a string | ${#VARNAME} |
Get a single character | ${VARNAME[index]} |
# 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") |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
# 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 ` |
// 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){ |
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) |
mybinary |
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 |
#/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 |