Pinterest-style visual bookmarking app with: - URL metadata extraction (OG/Twitter meta, oEmbed fallback) - Image caching in Postgres with 480px thumbnails - Multi-tag filtering with Ctrl/Cmd for OR mode - Fuzzy tag suggestions and inline tag editing - Browser console auth() with first-use password setup - Brutalist UI with Commit Mono font and Pico CSS - Light/dark mode via browser preference
37 lines
663 B
Go
37 lines
663 B
Go
package pgproto3
|
|
|
|
import (
|
|
"encoding/binary"
|
|
)
|
|
|
|
type BigEndianBuf [8]byte
|
|
|
|
func (b BigEndianBuf) Int16(n int16) []byte {
|
|
buf := b[0:2]
|
|
binary.BigEndian.PutUint16(buf, uint16(n))
|
|
return buf
|
|
}
|
|
|
|
func (b BigEndianBuf) Uint16(n uint16) []byte {
|
|
buf := b[0:2]
|
|
binary.BigEndian.PutUint16(buf, n)
|
|
return buf
|
|
}
|
|
|
|
func (b BigEndianBuf) Int32(n int32) []byte {
|
|
buf := b[0:4]
|
|
binary.BigEndian.PutUint32(buf, uint32(n))
|
|
return buf
|
|
}
|
|
|
|
func (b BigEndianBuf) Uint32(n uint32) []byte {
|
|
buf := b[0:4]
|
|
binary.BigEndian.PutUint32(buf, n)
|
|
return buf
|
|
}
|
|
|
|
func (b BigEndianBuf) Int64(n int64) []byte {
|
|
buf := b[0:8]
|
|
binary.BigEndian.PutUint64(buf, uint64(n))
|
|
return buf
|
|
}
|