I hereby claim:
- I am ribice on github.
- I am ribice (https://keybase.io/ribice) on keybase.
- I have a public key ASClwYeNkzBrC3mcLbp7Lc4Uf7DIo_SKsbbIQ1FGHi2nQgo
To claim this, I am signing this object:
// Change these to suit your case! | |
const config = { | |
dataset_url: "polymer/flixgem", | |
cf: { | |
cf: { | |
// Always cache this fetch regardless of content type | |
// for a max of 5 seconds before revalidating the resource | |
cacheTtl: 1800, | |
cacheEverything: true | |
} |
// NewWrapResponseWriter wraps an http.ResponseWriter, returning a proxy that allows you to | |
// hook into various parts of the response process. | |
func NewWrapResponseWriter(w http.ResponseWriter, protoMajor int) WrapResponseWriter { | |
_, fl := w.(http.Flusher) | |
bw := basicWriter{ResponseWriter: w} | |
if protoMajor == 2 { | |
_, ps := w.(http.Pusher) | |
if fl && ps { |
func removeNulls(m map[string]interface{}) { | |
val := reflect.ValueOf(m) | |
for _, e := range val.MapKeys() { | |
v := val.MapIndex(e) | |
if v.IsNil() { | |
delete(m, e.String()) | |
continue | |
} | |
switch t := v.Interface().(type) { | |
// If key is a JSON object (Go Map), use recursion to go deeper |
go func() { | |
for { | |
err = rmq.Stream(cancelCtx) | |
if errors.Is(err, rabbitmq.ErrDisconnected) { | |
continue | |
} | |
break | |
} | |
}() |
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
var countryCities = map[string][]string{} | |
var mutex = &sync.RWMutex{} |
package log | |
import ( | |
"context" | |
"net/http" | |
"net/http/httptest" | |
"net/http/httputil" | |
"os" | |
"time" |
package httpresp | |
import ( | |
"context" | |
"fmt" | |
"net/http" | |
"github.com/go-chi/render" | |
"github.com/go-pg/pg/v9" |
I hereby claim:
To claim this, I am signing this object: