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
40 lines
846 B
Go
40 lines
846 B
Go
package pgio
|
|
|
|
import "encoding/binary"
|
|
|
|
func AppendUint16(buf []byte, n uint16) []byte {
|
|
wp := len(buf)
|
|
buf = append(buf, 0, 0)
|
|
binary.BigEndian.PutUint16(buf[wp:], n)
|
|
return buf
|
|
}
|
|
|
|
func AppendUint32(buf []byte, n uint32) []byte {
|
|
wp := len(buf)
|
|
buf = append(buf, 0, 0, 0, 0)
|
|
binary.BigEndian.PutUint32(buf[wp:], n)
|
|
return buf
|
|
}
|
|
|
|
func AppendUint64(buf []byte, n uint64) []byte {
|
|
wp := len(buf)
|
|
buf = append(buf, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
binary.BigEndian.PutUint64(buf[wp:], n)
|
|
return buf
|
|
}
|
|
|
|
func AppendInt16(buf []byte, n int16) []byte {
|
|
return AppendUint16(buf, uint16(n))
|
|
}
|
|
|
|
func AppendInt32(buf []byte, n int32) []byte {
|
|
return AppendUint32(buf, uint32(n))
|
|
}
|
|
|
|
func AppendInt64(buf []byte, n int64) []byte {
|
|
return AppendUint64(buf, uint64(n))
|
|
}
|
|
|
|
func SetInt32(buf []byte, n int32) {
|
|
binary.BigEndian.PutUint32(buf, uint32(n))
|
|
}
|