This is an example of a sharded map using spin locks. It is extremely fast.
BenchmarkCacheSet-8 30000000 52.6 ns/op 0 B/op 0 allocs/op
BenchmarkCacheGet-8 30000000 37.7 ns/op 0 B/op 0 allocs/op
This ZSH theme is a modification of agnoster theme. It looks best with the Solarized Dark or Base16 Solarized Dark iTerm2 themes.
| package httpmock | |
| import ( | |
| "errors" | |
| "net/http" | |
| ) | |
| // Responders are callbacks that receive and http request and return a mocked response. | |
| type Responder func(*http.Request) (*http.Response, error) |
| package main | |
| import ( | |
| "crypto/sha256" | |
| "encoding/hex" | |
| "fmt" | |
| "github.com/alecthomas/kingpin" | |
| "github.com/tyler-smith/go-bip32" | |
| "github.com/tyler-smith/go-bip39" | |
| "golang.org/x/crypto/ripemd160" |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| func main() { | |
| fmt.Println("Loan calculator") | |
| package main | |
| import "fmt" | |
| import "math" | |
| const ( | |
| costPerMille float64 = 4.8 | |
| clickThroughRate float64 = 0.04 | |
| conversionRate float64 = 0.05 |
| package main | |
| import ( | |
| "container/heap" | |
| "fmt" | |
| "math" | |
| "math/big" | |
| "sort" | |
| "time" | |
| ) |
| /* ADS1256 simple library for Arduino | |
| ADS1256, datasheet: http://www.ti.com/lit/ds/sbas288j/sbas288j.pdf | |
| connections to Atmega328 (UNO) | |
| CLK - pin 13 | |
| DIN - pin 11 (MOSI) | |
| DOUT - pin 12 (MISO) | |
| CS - pin 10 | |
| DRDY - pin 9 | |
| RESET- pin 8 (or tie HIGH?) |