Custom hooks from the talk: https://youtu.be/J-g9ZJha8FE
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
type FleetVehicle interface { | |
MakeAndModel() string | |
} | |
type Vehicle struct { | |
Type string `json:"type"` | |
Make string `json:"make"` | |
Model string `json:"model"` | |
} |
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
$ TF_LOG=trace terraform validate (base) 13:02:24 2020-06-05 | |
2020/06/05 13:02:29 [INFO] Terraform version: 0.13.0 beta1 | |
2020/06/05 13:02:29 [INFO] Go runtime version: go1.14.2 | |
2020/06/05 13:02:29 [INFO] CLI args: []string{"/usr/local/bin/terraform", "validate"} | |
2020/06/05 13:02:29 [DEBUG] Attempting to open CLI config file: /Users/samir/.terraformrc | |
2020/06/05 13:02:29 Loading CLI configuration from /Users/samir/.terraformrc | |
2020/06/05 13:02:29 Loading CLI configuration from /Users/samir/.terraform.d/credentials.tfrc.json | |
2020/06/05 13:02:29 [DEBUG] checking for credentials in "/Users/samir/.terraform.d/plugins" | |
2020/06/05 13:02:29 [DEBUG] checking for credentials in "/Users/samir/.terraform.d/plugins/darwin_amd64" | |
2020/06/05 13:02:29 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins |
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
Copyright (c) 2019 DoorDash | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
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
CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french ); | |
ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING | |
FOR hword, hword_part, word WITH unaccent, french_stem; | |
CREATE TEXT SEARCH CONFIGURATION en ( COPY = english ); | |
ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING | |
FOR hword, hword_part, word WITH unaccent, english_stem; | |
CREATE TEXT SEARCH CONFIGURATION de ( COPY = german ); | |
ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING |
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" | |
"io/ioutil" | |
"net/http" | |
) | |
func uploadFile(w http.ResponseWriter, r *http.Request) { | |
fmt.Println("File Upload Endpoint Hit") |
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 ( | |
"encoding/json" | |
"fmt" | |
"github.com/google/uuid" | |
"gopkg.in/oauth2.v3/models" | |
"log" | |
"net/http" | |
"time" |
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" | |
// sem is a channel that will allow up to 10 concurrent operations. | |
var sem = make(chan int, 10) | |
func main() { | |
for { | |
sem <- 1 // will block if there is MAX ints in sem |
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
func MapVisitor(mapToVisit map[string]interface{}) { | |
for k, v := range mapToVisit { | |
switch val := v.(type) { | |
case string: | |
fmt.Println(k, "is string -> ", val) | |
case float64: | |
fmt.Println(k, "is float64 -> ", val) | |
case map[string]interface{}: | |
MapVisitor(v.(map[string]interface{})) | |
case []interface{}: |
NewerOlder