oleg_log
1.78K subscribers
1.86K photos
129 videos
9 files
2.77K links
Shelter for antisocial programmers "Oleg"

halp: @olegkovalov
web: https://olegk.dev
fov: @oleg_fov
chat: @oleg_log_blabla
podcast: @generictalks

about: https://xn--r1a.website/oleg_log/3200
Download Telegram
Gods Gophers gave you an arbitrary order of top-level definitions yet you still write code as if it were C :(

Or am I the one who prefers exported definitions first and unexported later?
Any good cloud-init configs for a small server for pet projects? Thanks in advance.

(links to blogs are also appreciated)
Cool one. Especially the name.

https://vitaut.net/posts/2025/faster-dtoa/
lol
>>> chr(sum(range(ord(min(str(not()))))))
'ඞ'
Oh no
Jokes aside. Any recommendations on image resizing in Go?

Ideally without CGO, might be a standalone service(systemd) or as a proxy.

Thanks in advance.
I was today years old when I have discovered Scala2 implicit parameters.

Absolutely disgusting. Like ultimately pro max disgusting.

The funniest thing (to me only?) it got redesigned in Scala 3 with „given” keyword.
Good interview question, happened to me once iirc.

Ok, to paraphrase: it’s was a good question to kick off a deep and thoughtful discussion about language and program design in general.

For someone senior level and higher with a different background, it’s a great topic to discuss.
Go ahead, self-host Postgres

Love this "The real operational complexity" paragraph.

https://pierce.dev/notes/go-ahead-self-host-postgres
> Remember, an LLM is a JPG of all the text of the internet.

😂
Okay, I outsmarted myself. It’s not that I’m in a deep trouble, but it’s something that adds more and more friction and I start hating that.

Here’s the code:

type BlobID uint64

func (id BlobID) MarshalJSON() ([]byte, error) {
return []byte(`"` + id.String() + `"`), nil
}

func (id *BlobID) UnmarshalJSON(b []byte) error {
idd, err := ParseBlobID(string(b[1 : len(b)-1]))
*id = idd
return err
}


BlobID values are stored in a JSONB column in Postgres, just for the context.

The problem is with String() and ParseBlobID() (the implementation isn’t important, but they’re obviously not just thin wrappers around strconv).
I want to get rid of these two functions and simply store the uint64 as a string (i.e. just use strconv).

The question is: how can I make such migration in the simplest way? I can see about 2-3 possible solutions, and I’m curious what you’d suggest and why.

Thanks in advance.