Skip to content

Instantly share code, notes, and snippets.

@alexniver
alexniver / sum.go
Last active Jun 14, 2019
calculate sum use all cpu core
View sum.go
package main
import (
"fmt"
"runtime"
)
func Sum(start, end int) chan int {
c := make(chan int)
s := 0
View 使用spf13-vim 写golang.md
  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 Feb 13, 2019
spf13-vim + vim-go
View .md
  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 Jan 20, 2019
如何在ubuntu上编译出windows的可执行文件
View go交叉编译ubuntu to windows.md
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 Dec 27, 2018
windows下使用的vim简易配置
View vimrc for windows
" 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 Nov 12, 2018
生成范围内unicode的中文
View 遍历生成所有中文.md
package main

import (
    "fmt"
    "strconv"
)

func main() {
    startUnicodeStr := "4E00"
@alexniver
alexniver / init.vim
Last active Apr 29, 2018
my neovim config
View init.vim
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
View 7dtd by steamcmd
quick'n'dirty for linux:
./steamcmd.sh
login anonymous
force_install_dir yourdirectoryhere
app_update 294420 -beta latest_experimental
如果报错