This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
db: | |
image: 'mysql:5.7' | |
container_name: mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=123456 | |
ports: | |
- '3306:3306' | |
volumes: | |
- './mysql/data:/var/lib/mysql' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
var ( | |
testString string | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strings" | |
"github.com/spf13/cobra" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import subprocess | |
# 不自动处理的规则 | |
ex = ("SA4006", "structcheck") # 不自动处理的规则 | |
# 忽略error返回白名单,白名单才处理 | |
errwl = { | |
"ymetrics": "_ = ", | |
"yalert": "_ = ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
// Int64Set int64类型的集合 | |
type Int64Set struct { | |
sync.RWMutex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
aa = add . | |
ag = reset HEAD^ # again | |
b = branch | |
bd = branch -D | |
br = branch | |
ca = commit --all | |
cb = checkout -b | |
changed = update-index --no-assume-unchanged # revert op of `git unchanged` | |
ci = commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# options for analysis running | |
run: | |
# timeout for analysis, e.g. 30s, 5m, default is 1m | |
timeout: 5m | |
# which dirs to skip: issues from them won't be reported; | |
# can use regexp here: generated.*, regexp is applied on full path; | |
# default value is empty list, but default dirs are skipped independently | |
# from this option's value (see skip-dirs-use-default). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
MIN_GIT_VERSION="2.9" | |
HOOKS_DIR="$HOME/.git-hooks" | |
function checkGitVersion() { | |
# check if git is installed | |
if ! command -v git &>/dev/null; then | |
echo "git could not be found" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
protected_branch='master' | |
remote_branch_prefix="refs/heads/" | |
protected_remote_branch=$remote_branch_prefix$protected_branch | |
while read local_ref local_sha remote_ref remote_sha | |
do | |
if [ "$protected_remote_branch" == "$remote_ref" ]; then | |
echo " git hooks: Do not commit to $protected_branch branch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
protected_branch='master' | |
current_branch=$(git rev-parse --symbolic --abbrev-ref HEAD) | |
if [ "$protected_branch" == "$current_branch" ]; then | |
echo "git hooks: Do not commit to $current_branch branch" | |
exit 1 | |
fi |
NewerOlder