Skip to content

Instantly share code, notes, and snippets.

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

alexniver

🏠
Working from home
View GitHub Profile
@alexniver
alexniver / rust connect.md
Created November 12, 2022 06:49
rust cargo 科学上网
~/.cargo/config
[http]
proxy = "socks5h://127.0.0.1:7891"
[https]
proxy = "socks5h://127.0.0.1:7891"
@alexniver
alexniver / git connect.md
Last active December 21, 2022 07:34
git 科学上网

install connect

yay -S connect

vi ~/.ssh/config

Host github.com
 User git
@alexniver
alexniver / sum.go
Last active June 14, 2019 15:20
calculate sum use all cpu core
package main
import (
"fmt"
"runtime"
)
func Sum(start, end int) chan int {
c := make(chan int)
s := 0
  1. 首先根据官方文档安装spf13.vim
  2. 执行下面的语句
echo "let g:spf13_bundle_groups=['general', 'youcompleteme', 'programming', 'go', 'javascript', 'html', 'misc', 'writing' ]" >> ~/.vimrc.before.local 
vim +BundleInstall! +qall
  1. 将下面的配置加入到 .vimrc.local
" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
@alexniver
alexniver / .md
Created February 13, 2019 18:12
spf13-vim + vim-go
  1. Install spf13-vim
sh <(curl https://j.mp/spf13-vim3 -L)
  1. Install Go bundle
echo "let g:spf13_bundle_groups=['general', 'neocomplete', 'programming', 'ruby', 'python', 'go', 'javascript', 'html', 'misc', 'writing' ]" >> ~/.vimrc.before.local 
@alexniver
alexniver / go交叉编译ubuntu to windows.md
Created January 20, 2019 11:26
如何在ubuntu上编译出windows的可执行文件
sudo apt-get install mingw-w64
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build main.go
@alexniver
alexniver / vimrc for windows
Last active December 27, 2018 06:20
windows下使用的vim简易配置
" General {{{
set nocompatible
set nobackup
set noswapfile
set history=1024
set autochdir
set whichwrap=b,s,<,>,[,]
set nobomb
set backspace=indent,eol,start whichwrap+=<,>,[,]
" Vim 的默认寄存器和系统剪贴板共享
@alexniver
alexniver / 遍历生成所有中文.md
Created November 12, 2018 11:20
生成范围内unicode的中文
package main

import (
    "fmt"
    "strconv"
)

func main() {
 startUnicodeStr := "4E00"
@alexniver
alexniver / init.vim
Last active April 29, 2018 17:33
my neovim config
let mapleader = ","
set nocompatible " Disable compatibility to old-time vi
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set mouse=v " middle-click paste with mouse
set hlsearch " highlight search results
set tabstop=4 " number of columns occupied by a tab character
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set expandtab " converts tabs to white space