Skip to content

Instantly share code, notes, and snippets.

@zorchp
zorchp / stats-conf.plist
Created November 14, 2024 04:37
stats app config
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BAT_mini_alignment</key>
<string>left</string>
<key>BAT_mini_color</key>
<string>utilization</string>
<key>Battery_barChart_position</key>
<string>1</string>
@zorchp
zorchp / .gdbinit
Created November 5, 2024 09:26
gdbinit config
set pagination off # 禁用分页模式,防止 gdb 在输出长信息时暂停
set print pretty on # 更好地打印结构体、数组等复杂数据结构
highlight-source on # 启用语法高亮
set print array on # 打印数组时自动显示所有元素
set print elements 0 # 显示所有数组元素,默认最多显示200个
@zorchp
zorchp / clang-format.yaml
Created August 23, 2024 07:40
clang-format
---
BasedOnStyle: Google
IndentWidth: 4
SortIncludes: false
AccessModifierOffset: -4
ContinuationIndentWidth: 4
AlignAfterOpenBracket: true
AlignOperands: true
AlignTrailingComments: true
MaxEmptyLinesToKeep: 2
alias vb='vi ~/.bashrc'
alias sb='source ~/.bashrc'
alias vv="vi ~/.vimrc"
alias ll="ls -alh --color=auto"
alias grep="grep --color"
alias cd='func() { cd $1; ls;}; func'
alias ccc="cd $HOME/code/cpp_code/test_cpp/"
alias pyy="cd $HOME/code/py_code/"
alias py=python3
@zorchp
zorchp / bash_prompt_PS1.sh
Created August 2, 2024 05:13
a full version bash prompt config
# in .bashrc
PS1_LINE='\[[\033[01;35m\]\d \t] \[\033[01;36m\]\u@\H\[\033[01;32m\] \w\[\033[00m\]\n\[\033[01;31m\]\$\[\033[00m\] '
PROMPT_COMMAND='
LAST_EXIT=$?;
if [ $LAST_EXIT -eq 0 ]; then
export PS1="\[\e[32m\]$LAST_EXIT\[\e[0m\] $PS1_LINE"
else
export PS1="\[\e[31m\]$LAST_EXIT\[\e[0m\] $PS1_LINE"
fi'
@zorchp
zorchp / run-in-vim.vim
Created August 1, 2024 09:26
one key to run in vim9
" use quick fix window to run
" use AsyncRun plugin
"for asyncRun
" open quickfix window auto,height
let g:asyncrun_open = 9
" bell when task done.
let g:asyncrun_bell = 1
@zorchp
zorchp / .latexmkrc
Last active December 1, 2023 08:29
latexmk conf for nvim and vimtex on mac
#
# General
#
# Needed for the dot2texi package which invokes GraphViz.
$latex = 'latex --shell-escape';
$xelatex = "xelatex -synctex=1 -no-pdf -interaction=nonstopmode --shell-escape %O %S";
$pdf_mode = 5;
$recorder = 1;
@zorchp
zorchp / macos-global.gitignore
Last active November 19, 2023 14:07
.gitignore file for MacOS
# ~/.gitignore_global
# Symlinked into ~/ as .gitignore
# written in ~/.gitconfig
# [core]
# excludesfile = /Users/zorch/.gitignore_global
# Compiled source
*.dll
*.exe
@zorchp
zorchp / run-in-nvim.lua
Last active November 19, 2023 15:23
one key to compile and run some code on nvim with lua
local function CodeRunner()
--[===[========================== Global ===========================]===]
vim.api.nvim_create_autocmd({ "InsertLeave" }, {
callback = function()
vim.fn.execute("silent! write")
-- vim.notify("Autosaved!", vim.log.levels.INFO, {})
end,
})
-- for generate doc with neogen
@zorchp
zorchp / sogou-trans.py
Last active July 9, 2024 08:38
command-line tool for call sogou translator with pure post request
#!/opt/homebrew/Caskroom/miniforge/base/envs/py3x/bin/python3
"""
ref to https://blog.csdn.net/m0_53342945/article/details/130240344
1. get cookies contains FQV
2. post with FQV
3. parse result
"""
import os