Skip to content

Instantly share code, notes, and snippets.

View guygrigsby's full-sized avatar
💭
Thinking…

Guy J Grigsby guygrigsby

💭
Thinking…
View GitHub Profile
@guygrigsby
guygrigsby / proxy.go
Created November 14, 2015 00:32 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"

Keybase proof

I hereby claim:

  • I am guygrigsby on github.
  • I am guygrigsby (https://keybase.io/guygrigsby) on keybase.
  • I have a public key ASA-Xa39GPgI3L6Ad13M53HqSUHRrlZN259v82mwZdo4JAo

To claim this, I am signing this object:

package main
import (
"fmt"
"io"
"strings"
)
func main() {
jobs := []int64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
package main
func main() {
req, err := NewRequest(
http.MethodPost,
"localhost:443",
[]byte("this is the body"),
WithHeader("X-Powered-by", "Frontdoor"),
WithHeader("Content-Type", "application/json"),
WithCookie(&http.Cookie{}),
#!/bin/sh
set -euo pipefail
if [ $1 = "--help" ]; then
printf 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
exit 1
fi
exec "$@"
FROM guygrigsby/go-protoc AS build
RUN apk update && apk --no-cache add ca-certificates dep git && update-ca-certificates
RUN mkdir /go/src/app
ADD . /go/src/app/
WORKDIR /go/src/app
RUN go build -o app main.go
FROM alpine AS runtime
RUN adduser -S -D -H -h /app appuser
USER appuser
FROM alpine
package main
import (
"fmt"
"sync"
)
func main() {
queue := make(chan *data)
package main
import (
"fmt"
"sync"
)
func main() {
queue := make(chan *data)
package main
import (
"fmt"
"sync"
)
func main() {
queue := make(chan *data)
package main
import (
"fmt"
"sync"
)
const (
consumerCount = 3
)