Skip to content

Instantly share code, notes, and snippets.

View amlwwalker's full-sized avatar
💭
Just keep coding, just keep coding...

Alex Walker amlwwalker

💭
Just keep coding, just keep coding...
View GitHub Profile
@amlwwalker
amlwwalker / stream.go
Last active March 2, 2024 23:31
Golang VAD and Google Speech To Text
package main
import (
"bytes"
"context"
"flag"
"io"
"path/filepath"
"fmt"
@amlwwalker
amlwwalker / example.js
Created October 30, 2018 11:50
compiling and sending ehter to a payable function from nodejs
import ethers, {
Contract,
providers as Providers,
utils as Utils,
Wallet,
ContractFactory
} from "ethers"
import path from "path"
import fs from "fs"
@amlwwalker
amlwwalker / emailheader.go
Last active July 20, 2023 10:57
check spf, dmarc, dkim
package main
import (
"fmt"
"net"
"regexp"
"encoding/base64"
"crypto/x509"
"crypto/rsa"
// "math/big"
@amlwwalker
amlwwalker / createContainer.go
Last active March 18, 2023 16:27
helpers for greenfinch api
package main
import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
client2 "github.com/configwizard/gaspump-api/pkg/client"
container2 "github.com/configwizard/gaspump-api/pkg/container"
@amlwwalker
amlwwalker / client.go
Created March 16, 2019 18:00
Golang Multipart upload to S3 over HTTP using tusd
package main
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
@amlwwalker
amlwwalker / glossary.json
Created September 21, 2021 12:52
some static json
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
@amlwwalker
amlwwalker / encryption.go
Created July 25, 2021 16:31
Encrypting and decrypting with Go
package encryption
import (
"bytes"
"crypto"
"fmt"
"github.com/alokmenghrajani/gpgeez"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/packet"
@amlwwalker
amlwwalker / compressor.go
Last active January 15, 2020 21:26
Taking a struct, converting it to a byte array, gob encoding that, compressing it, decompressing it and converting back to a byte array/struct
package compressor
import (
"bytes"
"compress/gzip"
"encoding/gob"
"fmt"
"io"
"io/ioutil"
)
@amlwwalker
amlwwalker / main.go
Created January 11, 2020 16:36
konsorten/go-xdeta encode/decode/apply
package main
import (
"context"
"fmt"
"os"
"github.com/dustin/go-humanize"
"github.com/konsorten/go-xdelta"
)
@amlwwalker
amlwwalker / objects.go
Created November 28, 2019 16:28
Validating Nexmo Signatures on incoming webhooks
package nexmo
// Config holds any values required for dispatching SMS messages to Nexmo
type Config struct {
Creds *Credentials
NexmoWorkers int `env:"NEXMO_WORKERS" envDefault:"5"`
NexmoURL string `env:"NEXMO_URL" envDefault:"https://rest.nexmo.com/sms/json"`
NexmoSecretFile string `env:"NEXMO_CONFIG_FILE" envDefault:"/secrets/nexmo/nexmo.json"`
}