Skip to content

Instantly share code, notes, and snippets.

@GivenZeng
GivenZeng / README.md
Last active November 16, 2017 03:21
node test code

this is some code about node test,we use suptertest,chai,mocha,so you should use "npm install xxx" before you use the following code

@GivenZeng
GivenZeng / gist:bef26019798220cdc9259fd4a6cb0a9c
Created December 11, 2017 08:29
golang 运行shell脚本
package main
import (
"bytes"
"fmt"
"log"
"os/exec"
)
@GivenZeng
GivenZeng / python
Last active December 19, 2017 09:37
各开发语言的.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
@GivenZeng
GivenZeng / vim
Last active September 30, 2018 01:53
vim
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@GivenZeng
GivenZeng / .tmux.conf
Last active April 17, 2022 06:47
tmux
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"
set -g @plugin 'tmux-plugins/tmux-yank'
set -g mouse on
#禁止 rename window
set-option -g allow-rename off
set -g status-keys vi
set -g history-limit 10000
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection;
@GivenZeng
GivenZeng / util or framwork
Last active March 4, 2018 13:56
golang grpc
// grpc
go get github.com/golang/protobuf/proto
go get github.com/gogo/protobuf/protoc-gen-gofast
go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/gogoproto
go get google.golang.org/grpc
// usual
go get github.com/golang/glog
@GivenZeng
GivenZeng / my.cnf
Created March 11, 2018 14:13
mysql
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
@GivenZeng
GivenZeng / golang_continue.go
Created June 21, 2018 06:41
golang contine
package main
import "fmt"
func main() {
LOOP_TEST:
for j := 1; j < 3; j += 1 {
fmt.Println("loop1")
for i := 1; i < 3; i = i + 1 {
fmt.Println("loop2")
@GivenZeng
GivenZeng / outtime.go
Created July 9, 2018 14:36
golang 定时器
package main
import "time"
import "fmt"
func main() {
// 在这个例子中, 假设我们执行了一个外部调用, 2秒之后将结果写入c1
c1 := make(chan string, 1)
go func() {
time.Sleep(time.Second * 2)
c1 <- "result 1"
}()
@GivenZeng
GivenZeng / .gitlab-ci.yml
Created November 13, 2019 11:46
golang ci
image: golang:1.11
# before_script:
# 代码格式化
fmt:
script:
# 代码格式化
- diff -u <(echo -n) <(gofmt $(find . -type f | grep -v vendor/ |grep -v /clients/ |grep -v /thrift_gen/ |grep -v kite.go|grep .go) )
- diff -u <(echo -n) <(goimports $(find . -type f | grep -v vendor/ |grep -v /clients/ |grep -v /thrift_gen/ |grep -v kite.go|grep .go) )