Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘
Enjoying Golang

Michal Jemala michaljemala

🤘
Enjoying Golang
  • Bratislava, Slovakia
View GitHub Profile
@michaljemala
michaljemala / todo-tester.go
Created Sep 7, 2020
Zero-downtime deployment tester
View todo-tester.go
package main
import (
"fmt"
"log"
"os"
"os/exec"
"time"
"golang.org/x/sync/errgroup"
@michaljemala
michaljemala / pgpool.yaml
Created Aug 14, 2020
Postgres cluster with streaming replication and pgpool
View pgpool.yaml
version: '3.8'
services:
pgmaster:
image: bitnami/postgresql:latest
ports:
- 5432
volumes:
- pgmaster_data:/bitnami/postgresql
View kubernetes_commands.md
View slow_client.go
package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
"time"
)
View unordered_slice.go
package main
import (
"fmt"
"hova.dzia.poliev.ka/slice"
)
func main() {
x := slice.Unordered{1, 2, 3}
View docker-aliases.sh
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@michaljemala
michaljemala / graphql_desc.go
Created Apr 5, 2019
Descriptions not properly set
View graphql_desc.go
package main
import (
"log"
"net/http"
"github.com/graph-gophers/graphql-go"
"github.com/graph-gophers/graphql-go/relay"
)
@michaljemala
michaljemala / expression.go
Created Oct 9, 2018
Mongo-like expressions
View expression.go
package graphql
import (
"fmt"
"strings"
"github.com/aintu/api-go-poc/orm"
)
const (
View to_uuid.sql
CREATE OR REPLACE FUNCTION uuid_from(oid bigint) RETURNS uuid AS $$
BEGIN
RETURN (
lpad(to_hex(oid::bit(64)::bit(32)::integer), 8, '0') ||
'-0000-4000-8000-0000' ||
lpad(to_hex((oid::bit(64)<<32)::bit(32)::integer), 8, '0')
)::uuid;
END;
$$ LANGUAGE plpgsql;
@michaljemala
michaljemala / environment
Created Mar 23, 2018
systemd multi-line issue
View environment
TEST_KEY='{"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-nu6oq%40ringring-dev-98877.iam.gserviceaccount.com", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5ymYTJeVxAi5s\niu0TXEd/5+pnneNLH8Wlu7DUq9SYVTifvoUpxYU6VfLMmVPPoqxSZeTeXmqewmKZ\n2LlVEs06zgxvSwAUdn2hAfaB8E/+p2qUHFdgIGK0c5tt7WMdHf2s3g87kCZ+RmHi\nDYesYwUR/v19vRSeCNyjKC0o3QXUmeoePUkupnO3o7FAXBSVpuAINzd4cKYmcpny\nCBbjsd/x5RmiKiDCwJcaaErYA4KgXLh7bw5y8DlOTnC5Zu531Fc5EAfkJ6vk/az2\nSnjxtSsQjV3bO4k0UnkRiBOKzPgDdK+SeFrw1Ac+7seqvQTSASVMM4jqa6PAwPJI\nhGNLptRNAgMBAAECggEAEuVge1sT2moP4a9BjIIKrZofT5mR1/6rwf70bbTqQvIL\n98dPUN/LfJLoRmHj0c7oOtstK2ar7miz0ZTmyJ3IbM4vGpSktfAVN+50rWONJ0fM\nwbKeOmMg1tyZNtV5iqkVt2LAZtzy5U3wP6cDoQdTKTDnhEXaVnZtRlTcPvc31BcF\nB4x8FQOtVi3D1gVKnn8L/mwmmM+hTDJffW/S+ia+l7Wy6Pv8+7F3R0pQ/wzkZhBo\nAcyOQI+7bxLRePXW3uBj/HGrgQMxF2jMnO/lu9doUest9x8jA1EEmHTSQa4xC+xO\nS2p18NRNupycB+MR1u4WEq2xGIxq8LyioZnitR0