Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Developing sqlc

Kyle Conroy kyleconroy

⌨️
Developing sqlc
View GitHub Profile
View web-components-go.html
<!-- Input Go template -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pop-up info box — web components</title>
<script src="main.js" defer></script>
</head>
<body>
<h1>Pop-up info widget - web components</h1>
View stdout
github.com/go-redis/redis/v8 github.com/cespare/xxhash/v2@v2.1.1
github.com/go-redis/redis/v8 github.com/dgryski/go-rendezvous@v0.0.0-20200624174652-8d2f3be8b2d9
github.com/go-redis/redis/v8 github.com/onsi/ginkgo@v1.10.1
github.com/go-redis/redis/v8 github.com/onsi/gomega@v1.7.0
github.com/go-redis/redis/v8 go.opentelemetry.io/otel@v0.7.0
github.com/go-redis/redis/v8 golang.org/x/exp@v0.0.0-20200513190911-00229845015e
github.com/go-redis/redis/v8 golang.org/x/net@v0.0.0-20190923162816-aa69164e4478
github.com/go-redis/redis/v8 golang.org/x/sys@v0.0.0-20191010194322-b09406accb47
github.com/go-redis/redis/v8 golang.org/x/text@v0.3.2
github.com/go-redis/redis/v8 gopkg.in/yaml.v2@v2.2.7
@kyleconroy
kyleconroy / go.sum
Created Jul 15, 2020
go get github.com/go-redis/redis/v8
View go.sum
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
@kyleconroy
kyleconroy / 01_existing.go
Last active Mar 15, 2021
Go 2 - Error Handling Proposals
View 01_existing.go
func CopyFile(src, dst string) error {
r, err := os.Open(src)
if err != nil {
return err
}
defer r.Close()
w, err := os.Create(dst)
if err != nil {
return err
@kyleconroy
kyleconroy / chroma.go
Last active Sep 24, 2017
Syntax highlight fenced code blocks in Markdown
View chroma.go
package main
import (
"io"
"github.com/alecthomas/chroma/formatters/html"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
"github.com/russross/blackfriday"
)
View chroma.go
type Renderer struct {
html *blackfriday.HTMLRenderer
}
func (r *Renderer) RenderHeader(w io.Writer, ast *blackfriday.Node) {}
func (r *Renderer) RenderFooter(w io.Writer, ast *blackfriday.Node) {}
func (r *Renderer) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus {
switch node.Type {
case blackfriday.CodeBlock:
lexer := lexers.Analyse(string(node.Literal))
@kyleconroy
kyleconroy / Gopkg.lock
Created Jul 15, 2017
example import from govendor
View Gopkg.lock
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/lib/pq"
packages = [".","oid"]
revision = "2704adc878c21e1329f46f6e56a1c387d788ff94"
source = "github.com/lib/pq"
[solve-meta]
View foo.go
package foo
type Foo struct {
Bar string `json:"bar"`
}
View Makefile
all: blob_pb2.py blob.pb.go
blob.pb.go: blob.proto
protoc blob.proto --go_out=plugins=grpc:.
blob_pb2.py: blob.proto
protoc --python_out=. --grpc_out=. \
--plugin=protoc-gen-grpc=`which grpc_python_plugin` blob.proto
View search.proto
syntax = "proto3";
message SearchRequest {
int32 page_number = 2;
int32 result_per_page = 3;
}