Skip to content

Instantly share code, notes, and snippets.

View vkorbes's full-sized avatar

V Körbes vkorbes

View GitHub Profile
project:
name: go3dprint
environments:
- name: local
providers:
- name: local-kubernetes
defaultHostname: garden.local
FROM golang:1.11.9-alpine3.9
WORKDIR /go/src/app
RUN apk add --no-cache entr git gcc musl-dev
ENV GO111MODULE=on
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["./app"]
ONBUILD COPY go.mod ./
ONBUILD COPY *.go ./
ONBUILD RUN go build .
@vkorbes
vkorbes / Dockerfile
Created April 25, 2019 12:01
Dockerfile
FROM golang:1.11.9-alpine3.9
WORKDIR /go/src/app
RUN apk add - no-cache entr git gcc musl-dev
ENV GO111MODULE=on
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["./app"]
EXPOSE 8080
COPY go.mod hotreload.sh ./
RUN go mod vendor
COPY *.go ./
import (
"github.com/ellenkorbes/memdec/db"
"github.com/ellenkorbes/memdec/models"
mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
type Deck struct {
DeckID bson.ObjectId `json:"id" bson:"_id,omitempty"`
LastShownIndex int `json:"lastshownindex" bson:"lastshownindex"`
Cards []Card `json:"cards" bson:"cards"`
}
type Card struct {
Suit string `json:"suit" bson:"suit"`
Number string `json:"number" bson:"number"`
}
package main
import (
"fmt"
"k8s.io/kubectl/pkg/framework/resource"
"flag"
"path/filepath"
"sync"
Number of bytes Bits for code point Byte 1 Byte 2 Byte 3 Byte 4
1 7 0xxxxxxx
2 11 110xxxxx 10xxxxxx
3 16 1110xxxx 10xxxxxx 10xxxxxx
4 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
01100001 11000011 10100011 11101001 10100110 10011001 11110000 10011111 10100100 10010100
a~
211 32 111 32 97 117 234 32 97 237 44 32 244 33
Ó → 211 → Size: 2 byte(s).
[…]
ê → 234 → Size: 2 byte(s).
[…]
í → 237 → Size: 2 byte(s).
[…]
ô → 244 → Size: 2 byte(s).
[…]