Setup SonarQube for Android
Intro
Sonarqube is static code analyzer tool on server side. It is very useful to write clean and quality code.
Quick note for future me
Sonarqube is static code analyzer tool on server side. It is very useful to write clean and quality code.
This tutorial will be using chromefy to generate the Chrome OS image.
Use recover() inside a defer function.
https://docs.fluentd.org/v1.0/articles/install-by-deb
https://play.golang.org/p/cyM-wLmJBNA ``` package main
``` go get github.com/gin-gonic/gin go get github.com/shopspring/decimal
CREATE VIEW CharacterWithAccount
AS
SELECT a.id aid,
c.id cid,
c.name name,
a.country country,
s.name servername
FROM character c
INNER JOIN account a
ON c.accountid = a.id
INNER JOIN server s
ON a.serverid = s.id
sudo apt install golang
First, convert your data to a .csv file.
Then, use LOAD DATA INFILE
to import your data.
``` // Setup f, _ := os.OpenFile(“output.log”, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644) defer f.Close() log.SetOutput(f)
Example: calling sql.Scanner.Scan
git ls-files | xargs wc -l
To concat two slice you can ``` s1 := []int{1, 2} // [1, 2] s2 := []int{3, 4} // [3, 4]
func myFun(model interface{}){
// Get type
m := reflect.Indirect(reflect.ValueOf(model))
type := m.Type()
// Get Child type, create and append
if t.Kind() == reflect.Slice{
childType := t.Elem()
newChild = reflect.ValueOf(reflect.New(reflect.TypeOf(childType)).Interface()).Elem()
newChild.Field(i).SetInt(0)
m.Set(reflect.Append(m, newChild))
}
}
To make the middleware call a function after the response, all you need is defer
func AnySlice(objType reflect.Type) {
// create slice
objArr := reflect.MakeSlice(reflect.SliceOf(objType), 0, 1)
// create object
obj := reflect.ValueOf(reflect.New(objType).Interface()).Elem()
obj.Field(0).SetString("Ming")
obj.FieldByName("Age").SetInt(18)
// append to slice
objArr.Set(reflect.Append(objArr, obj))
Step: ``` yum groupinstall ‘Development tools’ yum install ncurses ncurses-devel lua-devel
export PATH=/opt/bin
PATH=$PATH:$HOME/bin:$HOME/go/bin
``` // Set Cookie func (c *Context) SetCookie( name string, // Cookie Name: “Auth” value string, // Value: “f561b193165a076d8a9970dfd4e1a34ddb54ec36” maxAge int, // Second: 3600 path string, // URL Path: “/” domain string, // Domain name: “MyDomain.com” secure bool, // Secure cookie: true httpOnly bool, // non-javascript cookie: true )
Next you can update your site name, avatar and other options using the _config.yml file in the root of your repository (shown below).