Skip to content

Instantly share code, notes, and snippets.

@eliquious
eliquious / README.md
Last active September 5, 2018 17:30
Concurrent Map - Golang

Readme

This is an example of a sharded map using spin locks. It is extremely fast.

Benchmarks

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
@eliquious
eliquious / main.go
Created November 9, 2018 22:36
Loan calculator and amortization schedule
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println("Loan calculator")
@eliquious
eliquious / README.md
Created January 4, 2016 05:06
Golang LZ4 compression and decompression

Building

go build -o lz4 main.go

Compressing

@eliquious
eliquious / main.go
Last active May 13, 2019 11:37
Simple command line experiment with BIP32/BIP39
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"
@eliquious
eliquious / main.go
Created September 28, 2019 23:26
Primes
package main
import (
"container/heap"
"fmt"
"math"
"math/big"
"sort"
"time"
)
@eliquious
eliquious / main.go
Last active June 16, 2020 21:13
Profit Analysis
package main
import "fmt"
import "math"
const (
costPerMille float64 = 4.8
clickThroughRate float64 = 0.04
conversionRate float64 = 0.05
@eliquious
eliquious / ADS1256.c
Created October 28, 2020 00:42 — forked from dariosalvi78/ADS1256.c
Simple library for ADS1256 to be used with Arduino. It does not implement the whole set of features, but can be used as a starting point for a more comprehensive library.
/* 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?)
@eliquious
eliquious / main.go
Created November 2, 2020 05:24
G3N testing
package main
import (
"time"
"github.com/g3n/engine/app"
"github.com/g3n/engine/camera"
"github.com/g3n/engine/core"
"github.com/g3n/engine/gls"
"github.com/g3n/engine/light"
@eliquious
eliquious / README.md
Last active September 24, 2021 08:56
Agnosteros ZSH Theme

Agnosteros Theme

This ZSH theme is a modification of agnoster theme. It looks best with the Solarized Dark or Base16 Solarized Dark iTerm2 themes.

asciicast

Features

  • Git branch and status has been moved to the right.
@eliquious
eliquious / README.md
Created January 4, 2016 05:01
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys