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 / loader.go
Created May 29, 2024 12:53
attempt at c-shared go plugins
package main
/*
#cgo LDFLAGS: -ldl
#include <dlfcn.h>
#include <stdlib.h>
typedef void (*initializeFunc)();
typedef void (*handleMessageFunc)(const char* message, char** response);
@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 / 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 / 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 / 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"`
}
@amlwwalker
amlwwalker / log.txt
Last active September 12, 2019 12:26
error on model reset
detected row inserted
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x63f8057]
runtime stack:
runtime.throw(0x4599bce, 0x2a)
/usr/local/go/src/runtime/panic.go:608 +0x72
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:374 +0x2f2
@amlwwalker
amlwwalker / stdout
Created September 11, 2019 14:14
log output of attempting to take a screen capture of the currently focused window with gorobot
version v0.90.0.896, Sierra Nevada!
{CgID:10453 AxID:73413584}
369
error <nil>
iTerm2
811008, 512, 48, 124
Assertion failed: (bitmap != NULL), function createPNGWriteInfo, file /Users/alex/go/src/github.com/go-vgo/robotgo/screen/../base/png_io_c.h, line 187.
SIGABRT: abort
PC=0x7fff68bc62c6 m=0 sigcode=0