Skip to content

Instantly share code, notes, and snippets.


Konstantin Ivanov logrusorgru

View GitHub Profile
logrusorgru /
Last active Jul 29, 2021
To string, or not to sting, that is the question...
logrusorgru / load.go
Last active May 11, 2020
Golang load HTML templates
View load.go
// Copyright (c) 2018 Konstanin Ivanov <>.
// All rights reserved. This program is free software. It comes without
// any warranty, to the extent permitted by applicable law. You can
// redistribute it and/or modify it under the terms of the Do What
// The Fuck You Want To Public License, Version 2, as published by
// Sam Hocevar. See below for more details.
View is_initialized.go
type MessengerFactory struct {
isInitialized bool
func (m *MessengerFactory) IsInitialized() bool { return m.isInitialized }
func (m *MessengerFactory) Connect(address string) (conn *Connection, err error) {
return m.ConnectWithConfig(address, nil)
logrusorgru / refs.go
Last active Oct 3, 2017
skyobject Refs API preview
View refs.go
Len(pack Pack) (ln int, err error)
// presence check
HasHash(pack Pack, hash cipher.SHA256) (ok bool, err error)
// short hand for HasHash + pack.Get(hash) + encoder.DeserializeRaw
ValueByHash(pack Pack, hash cipher.SHA256, obj interface{}) (err error)
// the IndexByHash is useful only if the Refs contains only unique
// elements
logrusorgru /
Last active Oct 17, 2021
golang functional options problems
logrusorgru / handle.go
Last active Aug 13, 2017
CXO update Root
View handle.go
// in this example the Event is an event, that requires updates in our Root
func startHandlingSomePack(events <-chan Event, pack *skyobject.Pack,
n *node.Node, wg *sync.WaitGroup) {
go handleSomePack(n, pack, events, n.Quiting(), wg)
func handleSomePack(n *node.Node, pack *cxo.Pack, events <-chan Event,
quit <-chan struct{}, wg *sync.WaitGroup) {
logrusorgru / gnetex.go
Last active Feb 18, 2017
gnet example app
View gnetex.go
package main
import (
logrusorgru / imgrsz.go
Created Nov 3, 2016
Golang resize png images using different interpolations
View imgrsz.go
package main
import (
logrusorgru / S.sublime-syntax
Created Aug 21, 2016
gnu assembler custom highlighting for sublime text 3
View S.sublime-syntax
%YAML 1.2
# See
- S
scope: source.S
# comment multiline
logrusorgru / bench_test.go
Last active Sep 19, 2018
go-mangos pools research
View bench_test.go
package pool
import (
// perform:
// go test -bench syncPool