Skip to content

Instantly share code, notes, and snippets.

View mniak's full-sized avatar
🌵
Nothing is happening

Mniak mniak

🌵
Nothing is happening
View GitHub Profile
package main
import (
"fmt"
"path/filepath"
"strconv"
"github.com/dave/jennifer/jen"
"github.com/samber/lo"
"golang.org/x/text/cases"
package duplicomp
type PessimisticCallerback struct {
succeded bool
successCallbacks []func()
failureCallbacks []func()
}
func (self *PessimisticCallerback) Callback() {
if self.succeded {
package utils
import "sync"
type SyncMap[K comparable, V any] struct {
inner sync.Map
}
func (m *SyncMap[K, V]) convertValue(anyval any) V {
if anyval == nil {
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
)
@mniak
mniak / fake_random.go
Last active August 5, 2022 15:13
Golang utils
package crypto
import (
"bytes"
"crypto/md5"
"encoding/binary"
"io"
)
type fakeRandom struct {
[Intro] G7(4/9) G7
[Primeira Parte]
C7M F#º
Eu sei que vou te amar
Dm7 G7(b9)
Por toda a minha vida eu vou te amar
Gm7 A#7(b5) ou C7(9)
Em cada despedida eu vou te amar
package utils
import "encoding/json"
type Optional[T any] struct {
explicit bool
hasValue bool
value T
}
@mniak
mniak / README.md
Last active March 31, 2022 18:13
Run Jaeger and OpenTelemetry Collector
@mniak
mniak / run-go-as-script.sh
Last active March 29, 2022 21:40
Go bash runner - Add this to the beginning of the file
#!/bin/bash
# Check out the latest version at https://gist.github.com/mniak/09e5e46425ced7e3fe1c1661c24a0d8c
## CUSTOMIZATION SECTION: Type your own code below. You can add or remove lines if you need/want