Skip to content

Instantly share code, notes, and snippets.

View michaljemala's full-sized avatar
🕵️‍♂️
Looking for a passionate engineering team lead

Michal Jemala michaljemala

🕵️‍♂️
Looking for a passionate engineering team lead
  • Bratislava, Slovakia
View GitHub Profile
@michaljemala
michaljemala / todo-tester.go
Created September 7, 2020 12:43
Zero-downtime deployment tester
package main
import (
"fmt"
"log"
"os"
"os/exec"
"time"
"golang.org/x/sync/errgroup"
@michaljemala
michaljemala / pgpool.yaml
Created August 14, 2020 13:47
Postgres cluster with streaming replication and pgpool
version: '3.8'
services:
pgmaster:
image: bitnami/postgresql:latest
ports:
- 5432
volumes:
- pgmaster_data:/bitnami/postgresql
@michaljemala
michaljemala / kubernetes_commands.md
Created September 14, 2019 22:29 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@michaljemala
michaljemala / slow_client.go
Created September 12, 2019 08:03
A slow HTTP client
package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
"time"
)
package main
import (
"fmt"
"hova.dzia.poliev.ka/slice"
)
func main() {
x := slice.Unordered{1, 2, 3}
@michaljemala
michaljemala / docker-aliases.sh
Created September 5, 2019 08:00 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- 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 April 5, 2019 10:09
Descriptions not properly set
package main
import (
"log"
"net/http"
"github.com/graph-gophers/graphql-go"
"github.com/graph-gophers/graphql-go/relay"
)
@michaljemala
michaljemala / expression.go
Created October 9, 2018 09:27
Mongo-like expressions
package graphql
import (
"fmt"
"strings"
"github.com/aintu/api-go-poc/orm"
)
const (
@michaljemala
michaljemala / to_uuid.sql
Created April 12, 2018 12:21
OID to UUID
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 March 23, 2018 11:25
systemd multi-line issue
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