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
| #setup commands | |
| gcloud config set project curtqueue | |
| gcloud config set compute/zone us-central1-f | |
| gcloud preview container clusters create nsqcluster | |
| #cleaup commands | |
| gcloud preview container clusters delete nsqcluster | |
| gcloud compute forwarding-rules delete nsqcluster | |
| gcloud compute target-pools delete nsqcluster |
So, I decided to keep it pretty light-weight tonight. Just wanted to vent a little on coding practices:
If you name your return types, what's the point in returning with those names?
- BAD
func GetAllTodos() (todos Todos, err eror){
db, err := sql.Open("mysql", database.ConnectionString())
if err != nil{
return todos, err //WHY?!!?!??!?!!?
}
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
| version: v1beta2 | |
| containers: | |
| - name: goqueue | |
| image: gcr.io/curtqueue/goqueue | |
| env: | |
| - name: CONSUMER_CONFIG_STRING | |
| value: W3siZXhjaGFuZ2UiOiJleGNoYW5nZSIsInJvdXRpbmdfa2V5IjoiR29BUEkiLCJxdWV1ZV9uYW1lIjoicXVldWUtZ29hcGkiLCJnYV90cmFja2luZyI6IlVBLTM0NzkyMzE3LTMifSx7ImV4Y2hhbmdlIjoiZXhjaGFuZ2UiLCJyb3V0aW5nX2tleSI6InYyTW9jayIsInF1ZXVlX25hbWUiOiJxdWV1ZS12Mk1vY2siLCJnYV90cmFja2luZyI6IlVBLTU5Mjk3MTE3LTEifV0= |
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 ( | |
| "html/template" | |
| "io" | |
| "net/http" | |
| "os" | |
| ) | |
| //Compile templates on start |
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
| func ImportPiesReport(result pies.Result) error { | |
| processChan := make(chan error) | |
| for _, item := range result.Items { | |
| go func(item pies.Item) { | |
| p := Part{} | |
| p.MapPiesData(item) | |
| processChan <- p.Add() | |
| }(item) | |
| } | |
| <-processChan |
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
| /** Resetting box model **/ | |
| .row, .column { | |
| box-sizing: border-box; | |
| } | |
| /** Clear fixes **/ | |
| .row:before, .row:after { | |
| content: " "; | |
| display: table; | |
| } |
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 ( | |
| "github.com/curt-labs/GoAdmin/helpers/slack" | |
| ) | |
| func main() { | |
| m := slack.Message{ | |
| Channel: "general", | |
| Username: "Security Man", |
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
| class Animal: | |
| def __init__(self): | |
| self.name = "" | |
| self.sound = "" | |
| def makeSound(self): | |
| if self.name != "" and self.sound != "": | |
| print self.name + " sounds '" + self.sound + "'" | |
| class Dog(Animal): |