Acknowledgement
- https://support.mozilla.org/en-US/questions/1297983#answer-1381308
- https://twitter.com/dosyara/status/1428701970571878403
Honorable mention
// Backoff is a simple backoff implementation. | |
type Backoff struct { | |
MaxAttempts int | |
Backoff func(int) time.Duration | |
attempts int | |
err error | |
nextCh chan struct{} | |
} | |
var ErrMaxAttemptsReached = errors.New("max attempts reached") |
Acknowledgement
Honorable mention
#!/usr/bin/env sh | |
# Usage: | |
# > to_deploy.sh <branch> <base_branch> | |
branch=${1:-HEAD} | |
base=${2:-"origin/master"} | |
declare -r mains=$(go list -json ./... | jq --compact-output '. | select(.Name == "main") | {ImportPath: .ImportPath, Deps: .Deps}') | |
declare -r changed=($(git diff --name-only ${base}...${branch} \ |
package main | |
import ( | |
"context" | |
"flag" | |
"log" | |
"os" | |
"os/signal" | |
"syscall" | |
) |
# cloud-config | |
hostname: pi-4 | |
manage_etc_hosts: true | |
write_files: | |
- content: | | |
network: | |
ethernets: | |
eth0: |
// pkg/svc | |
type SettingsService struct { | |
db DB // DB is an interface | |
} | |
func (svc *SettingsService) IsProCustomer(token Token) bool { | |
v := svc.db.GetProCustomer(makeProPKFromToken(token)) | |
return v == "1" | |
} |
See https://github.com/narqo/aerospike-server/tree/make-arm64v8
sudo mkdir -p /opt/aerospike
sudo tar -C /opt/aerospike/ --strip-components=1 -xvf aerospike-server-community-4.5.3.14-6.aarch64.tar.gz
sudo mkdir -p /var/lib/aerospike/{data,smd,udf/lua}
/* jshint esnext:true */ | |
/** | |
* "Producer-Consumer" implementation using generators. | |
* @see http://en.wikipedia.org/wiki/Deterministic_concurrency#Comparison_with_generators | |
*/ | |
var SIZE = 3, | |
queue = newQueue(); |
package main | |
import ( | |
"net" | |
"net/http" | |
) | |
const addr = ":8080" | |
func main() { |