This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired from https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322 | |
run: | |
timeout: 5m | |
modules-download-mode: readonly | |
linters: | |
enable-all: true | |
disable: | |
- bodyclose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"regexp" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can edit this code! | |
// Click here and start typing. | |
package main | |
import ( | |
"errors" | |
"fmt" | |
"time" | |
"github.com/cenkalti/backoff" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ go test -bench=. -v ./main_test.go | |
goos: darwin | |
goarch: amd64 | |
cpu: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz | |
BenchmarkAppendMake | |
BenchmarkAppendMake-8 17486152 67.63 ns/op 0 B/op 0 allocs/op | |
BenchmarkAppendMakeCap | |
BenchmarkAppendMakeCap-8 2189421 540.8 ns/op 2040 B/op 8 allocs/op | |
PASS | |
ok command-line-arguments 3.124s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:16 as builder | |
ENV NODE_ENV production | |
WORKDIR /usr/src/app | |
# Deps | |
COPY package.json yarn.lock ./ | |
RUN yarn install \ | |
--emoji false \ | |
--no-progress \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util | |
import ( | |
"errors" | |
"strings" | |
) | |
// Errs is an error that collects other errors, for when you want to do | |
// several things and then report all of them. | |
type Errs struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"math/rand" | |
"os" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, Request, make_response | |
def hello_http(request: Request): | |
"""HTTP Cloud Function. | |
Args: | |
request (flask.Request): The request object. | |
<https://flask.palletsprojects.com/en/1.1.x/api/#incoming-request-data> | |
Returns: | |
The response text, or any set of values that can be turned into a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"sync" | |
"time" | |
log "github.com/sirupsen/logrus" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"time" | |
log "github.com/sirupsen/logrus" | |
) | |
func main() { |
NewerOlder