Skip to content

Instantly share code, notes, and snippets.

View kkm000's full-sized avatar
📆
Celebrating the first day of the rest of my life

Cy 'kkm' Katsnelson kkm000

📆
Celebrating the first day of the rest of my life
View GitHub Profile
@atedja
atedja / golang-json-stream-decoder
Last active November 2, 2018 10:00
Example of using JSON Stream Decoder from STDIN
package main
import (
"encoding/json"
"fmt"
"os"
)
func main() {
decoder := json.NewDecoder(os.Stdin)
@jtbr
jtbr / endianness.h
Last active October 11, 2024 19:08
cross-platform / cross-compiler standalone endianness conversion
/**
* @file endianness.h
* @brief Convert Endianness of shorts, longs, long longs, regardless of architecture/OS
*
* Defines (without pulling in platform-specific network include headers):
* bswap16, bswap32, bswap64, ntoh16, hton16, ntoh32 hton32, ntoh64, hton64
*
* Should support linux / macos / solaris / windows.
* Supports GCC (on any platform, including embedded), MSVC2015, and clang,
* and should support intel, solaris, and ibm compilers as well.