Skip to content

Instantly share code, notes, and snippets.

Hypertext Brad Protocol -- HBP/1.1
Status of this Memo
This document specifies an Internet standards track protocol for the
Brad, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Brad Standards" (BSTD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
FROM scratch
COPY demo /
CMD ["/demo"]
{
"rewrites": [
{"source": "/", "destination": "/api/index"},
{"source": "/:splat*", "destination": "/api"}
]
}
package resume_test
import (
"context"
"log"
)
func ExampleBackup() {
backup := func(ctx context.Context, object string) error {
job, err := resume.Call(ctx, "start", backupStart, object)
# github.com/golangci/golangci-lint/pkg/golinters
../../pkg/mod/github.com/golangci/golangci-lint@v1.27.0/pkg/golinters/gomodguard.go:47:36: unknown field 'k' in struct literal of type gomodguard.BlockedModule
../../pkg/mod/github.com/golangci/golangci-lint@v1.27.0/pkg/golinters/gomodguard.go:51:43: cannot use m (type gomodguard.BlockedModule) as type map[string]gomodguard.BlockedModule in append
package question
func whatsTheEquivalentOfThisWithHandleCheckQuestionMark(w io.Writer) (rN int, err error) {
w = LimitedWriter{w, 23}
n, err := io.WriteString(w, "some data 1") // 11 bytes written
rN += n
if err != nil {
return err
}
<script>
function ready() {
function benchmark(n, f) {
var sum = 0.0;
var total = n;
while (n--) {
var u = 'https://google.com?q=1' + Math.random().toString(36).substring(7);
var s = performance.now();
f(u);
var e = performance.now();
<script>
var i = 100000
var r = []
var a = document.createElement('a')
while (i--) {
var s = performance.now()
a.href = 'https://www.google.com?q=asdf'
var h = a.hostname
var e = performance.now()
r.unshift(e - s)
Coreo (pronouced: core-e-o)
Coreai
Coreholes
??
@bmizerany
bmizerany / http.go
Last active December 22, 2015 16:39
Graceful shutdown example in regards to https://groups.google.com/forum/#!topic/golang-nuts/vLHWa5sHnCE
package main
func main() {
// ... setup ...
l, err := net.Listen("tcp", *laddr)
if err != nil {
log.Fatal(err)
}