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" | |
func main() { | |
mydict := map[string]int{ | |
"1": 1, | |
"2": 2, | |
"3": 3, | |
} |
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" | |
"html/template" | |
"os" | |
"time" | |
) | |
func buildTemplate(name string, leftDelim string, rightDelim string) *template.Template { |
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 Payload interface{} | |
// Job represents the job to be run | |
type Job struct { | |
Payload Payload `json:"payload"` | |
} | |
type WorkerHandler func(job Job) | |
// Worker represents the worker that executes the job |
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" | |
"log" | |
"time" | |
"github.com/gin-gonic/gin" | |
"github.com/jinzhu/gorm" | |
) |
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
function levelOrder (node, visit) { | |
'use strict' | |
let queue = [node] | |
while (queue.length > 0) { | |
node = queue.pop() | |
if (!node) { | |
continue | |
} |
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" | |
type Node struct { | |
Value string | |
Left *Node | |
Right *Node | |
} |
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 ( | |
"database/sql/driver" | |
"encoding/json" | |
"github.com/jinzhu/gorm" | |
_ "github.com/lib/pq" | |
) |
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
FROM golang:1.5.3 | |
EXPOSE 3000 | |
RUN mkdir -p /go/src/myapp | |
COPY . /go/src/myapp | |
RUN cd /go/src/myapp \ | |
&& go get -d \ | |
&& go install myapp | |
ENTRYPOINT /go/bin/myapp |