Skip to content

Instantly share code, notes, and snippets.

@james-lawrence
james-lawrence / pingsec.go
Last active March 14, 2021 22:51
libp2p identify ID/PublicKey SecurityTransport
package p2pping
import (
"context"
"fmt"
"io"
"log"
"net"
"github.com/libp2p/go-libp2p-core/crypto"
@james-lawrence
james-lawrence / flutterlib.go
Last active September 9, 2018 16:00
flutter lib
package nflutter
import (
"encoding/json"
"image"
_ "image/png"
"log"
"os"
"runtime"
"time"
package example
//go:generate genieql map --natural-key=id github.com/soandso/example.Structure TableName
//go:generate genieql generate crud --output=structure_crud_gen.go github.com/soandso/example.Structure TableName
type Structure struct {
ID string
Email string
Created time.Time
Updated time.Time
# here is the initialize socket setup/accept.
socket(PF_BLUETOOTH, SOCK_STREAM, 3) = 31
bind(31, {sa_family=AF_BLUETOOTH, sa_data="]\277`p\363\\\v\0\0\0\0\0\0\0"}, 10) = 0
setsockopt(31, SOL_BLUETOOTH, 4, "\1\0", 2) = 0
fstat(31, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl(31, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(31, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
listen(31, 5) = 0
....
# here is the acceptance of a incoming connection.
package main
import "fmt"
type T [16]byte