Skip to content

Instantly share code, notes, and snippets.

@ivajloip
ivajloip / phy_bench_test.go
Created April 26, 2020 20:02
Lorawan bench code
package lorawan
import (
"bytes"
"testing"
)
func BenchmarkDecode(b *testing.B) {
data := []byte{0x40, 0x04, 0x03, 0x02, 0x01, 0x80, 0x01, 0x00, 0x01, 0xa6, 0x94, 0x64, 0x26, 0x15, 0xd6, 0xc3, 0xb5, 0x82}
b.ResetTimer()
@ivajloip
ivajloip / send-sms.go
Created August 31, 2017 15:37 — forked from BizarroDavid/send-sms.go
Sending an SMS Text Message using AWS SNS service in GoLang
//assumes you have the following environment variables setup for AWS session creation
// AWS_SDK_LOAD_CONFIG=1
// AWS_ACCESS_KEY_ID=XXXXXXXXXX
// AWS_SECRET_ACCESS_KEY=XXXXXXXX
// AWS_DEFAULT_REGION=us-east-1
package main
import (
"fmt"
var privateKey *rsa.PrivateKey
var err error
if autogenerate {
if privateKey, err = rsa.GenerateKey(rand.Reader, 4096); err != nil {
log.Fatal("No jwt secret provided for token generation and auto-generation failed")
}
} else if privateKey, err = jwt.ParseRSAPrivateKeyFromPEM(privateKeyBytes); err != nil {
log.Fatal("Could not parse data from jwt secret")
}
publicKey := &privateKey.PublicKey
language: python
python:
- 3.4
build_image: shippableimages/ubuntu1404_python
install:
- pip install -r requirements.txt
before_script: