Inspired by An Alternative to npm Private Modules
./package.json:{| /** | |
| * Definition for a binary tree node. | |
| * type TreeNode struct { | |
| * Val int | |
| * Left *TreeNode | |
| * Right *TreeNode | |
| * } | |
| */ | |
| func sortedArrayToBST(nums []int) *TreeNode { | |
| length := len(nums) |
| package main | |
| import ( | |
| "fmt" | |
| "regexp" | |
| ) | |
| func main() { | |
| str := " -5 + 12 -3 " |
| ui := ctx.MustGet("user_info").(*model.UserInfo) | |
| atClaims := jwt.MapClaims{} | |
| atClaims["message"] = "hello" | |
| atClaims["userID"] = ui.UserID | |
| atClaims["now"] = time.Now().Add(time.Hour * 72).Unix() | |
| atClaims["exp"] = time.Now().Add(time.Minute * 15).Unix() | |
| var mySigningKey = "ASKS1298dn125568mJQ12=masd=09856nAnD=8J4" | |
| token := jwt.NewWithClaims(jwt.GetSigningMethod("HS256"), atClaims) | |
| tokenString, err := token.SignedString([]byte(mySigningKey)) |
| # Created by https://www.toptal.com/developers/gitignore/api/go,intellij,visualstudiocode,vscode | |
| # Edit at https://www.toptal.com/developers/gitignore?templates=go,intellij,visualstudiocode,vscode | |
| ### Go ### | |
| # Binaries for programs and plugins | |
| *.exe | |
| *.exe~ | |
| *.dll | |
| *.so |
| // init kafka | |
| kafkaURL := fmt.Sprintf("%v:%v", configData.Kafka.Host, configData.Kafka.Port) | |
| kafkaReader := kafka.NewReader( | |
| kafka.ReaderConfig{ | |
| Brokers: []string{kafkaURL}, | |
| Topic: configData.Kafka.Topic, | |
| GroupID: configData.Kafka.GroupID, | |
| MaxBytes: configData.Kafka.MaxBytes, | |
| }, | |
| ) |
| // initial array | |
| const a = [1, [2, 3], ["4", [5, 6, 7, [8, 9]]]]; | |
| // recursive function wich takes result array and inserts non-array items to it | |
| function rec(result, arr) { | |
| for (let i=0; i<arr.length; ++i) { | |
| if (Array.isArray(arr[i])) | |
| rec(result, arr[i]); | |
| else | |
| result.push(arr[i]); |
Inspired by An Alternative to npm Private Modules
./package.json:{| https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise | |
| Component lifecycle | |
| State, props | |
| https://getbootstrap.com/docs/4.0/getting-started/introduction/ | |
| https://codeburst.io/es5-vs-es6-with-example-code-9901fa0136fc |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-md-4 col-md-offset-4"> | |
| <div class="login-panel panel panel-default"> | |
| <div class="panel-heading"> | |
| <h3 class="panel-title">Please Sign In</h3> | |
| </div> | |
| <div class="panel-body"> | |
| <form role="form"> | |
| <fieldset> |