Skip to content

Instantly share code, notes, and snippets.

View ineiti's full-sized avatar

Linus Gasser ineiti

View GitHub Profile
// All known channels
var channels map[reflect.Type]interface{}
// RegisterChannel stores a channel and the message-type
func RegisterChannel(c interface{}) error {
if channels == nil {
channels = make(map[reflect.Type]interface{})
}
cr := reflect.TypeOf(c)

Keybase proof

I hereby claim:

  • I am ineiti on github.
  • I am ineiti (https://keybase.io/ineiti) on keybase.
  • I have a public key whose fingerprint is 529D 5B27 276D 66AC A362 DE8D D836 2CB7 4719 337E

To claim this, I am signing this object:

@ineiti
ineiti / tlskc.go
Last active October 10, 2016 14:15
package network
import (
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"

After getting used to GOPATH

When first encountering Golang, usage of GOPATH was really hard: why should everything be in the same directory structure? What about versioning? How can I stop making it break?

Using gopkg.in was a very good band-aid that worked very well for 3 years. Over time we got used to the GOPATH, even when it disappeared into go env GOPATH. We got so used to it, that we started using it in bash scripts, like this:

@ineiti
ineiti / GoogleSpreadsheetGetLink.gs
Created April 4, 2023 08:28
Getting the link from a google spreadsheet with a richtext link