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 ` |
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 |
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
// Emitted when the DOM is parsed and ready (without waiting for resources) | |
page.once('domcontentloaded', () => console.info('✅ DOM is ready')); | |
// Emitted when the page is fully loaded |
/* ******************************************************************************************* | |
* PUPPETEER | |
* https://pptr.dev/ | |
* ******************************************************************************************* */ | |
// When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) | |
// that is guaranteed to work with the API. | |
npm install puppeteer |