Our incident.io pkg/errors, as explained in:
This file contains hidden or 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
| #Should be a job too :-D | |
| # With xargs (on all namespaces) | |
| kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\t"}{.metadata.namespace}{"\n"}{end}' --all-namespaces | \ | |
| xargs -n2 sh -c 'kubectl delete jobs $0 --namespace=$1' | |
| # For loop (only in the current namespace) | |
| for i in $(kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\n"}{end}'); | |
| do kubectl delete jobs $i; done |
This file contains hidden or 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
| # See: https://olegk.dev/go-linters-configuration-the-right-version | |
| run: | |
| # Depends on your hardware, my laptop can survive 8 threads. | |
| concurrency: 8 | |
| # I really care about the result, so I'm fine to wait for it. | |
| timeout: 30m | |
| # Fail if the error was met. |
This file contains hidden or 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 ( | |
| "database/sql" | |
| "database/sql/driver" | |
| "fmt" | |
| "net" | |
| "os" | |
| "time" |
This file contains hidden or 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
| // ConsoleHandler formats slog.Logger output in console format, a bit similar with Uber's zap | |
| // ConsoleEncoder or Apex's CLI log | |
| // The log format is designed to be human-readable. | |
| // | |
| // Performance can definitely be improved, however it's not my priority as | |
| // this should only be used in development environment. | |
| // | |
| // e.g. log output: | |
| // • ./main.go:21 Debug message {"hello":"world","!BADKEY":"bad kv"} | |
| // ℹ ./main.go:217 Info message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}} |
This file contains hidden or 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 ( | |
| "context" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" |
This file contains hidden or 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 ( | |
| "context" | |
| "flag" | |
| "log" | |
| "net/url" | |
| "time" | |
| "cloud.google.com/go/compute/metadata" |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>D3-Dag</title> | |
| </head> | |
| <body> | |
| <div id="wrapper"></div> | |
| <script src="https://unpkg.com/d3@6.7.0"></script> | |
| <script src="https://unpkg.com/d3-dag@0.7.0"></script> | |
| <script src="./zchart.js"></script> |
This file contains hidden or 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 ( | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "golang.org/x/net/context" |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |