Skip to content

Instantly share code, notes, and snippets.

View exu's full-sized avatar
🔨
forging testkube

Jacek Wysocki exu

🔨
forging testkube
View GitHub Profile
WITH RECURSIVE fizz_buzz (sequence, modulo_3, modulo_5) AS (
SELECT 1, CAST('' AS CHAR(4)), CAST('' AS CHAR(5))
UNION ALL
SELECT sequence + 1,
IF(MOD(sequence + 1, 3) = 0, 'Fizz', ''),
IF(MOD(sequence + 1, 5) = 0, 'Buzz', '')
FROM fizz_buzz
WHERE sequence < 100
)
@brendan-rius
brendan-rius / Dockerfile
Created June 13, 2018 22:19
DeamonSet for setting inotify config in each nodein k8s
FROM alpine
COPY configure-node.sh configure-node.sh
CMD ["/bin/sh", "configure-node.sh"]
@posener
posener / go-kit.md
Last active February 23, 2024 21:35
Why I Recommend to Avoid Using the go-kit Library

Why I Recommend to Avoid Using the go-kit Library

There is a trending 'microservice' library called go-kit. I've been using the go-kit library for a while now. The library provide a lot of convenience integrations that you might need in your service: with service discovery with Consul, distributed tracing with Zipkin, for example, and nice logic utilities such as round robin client side load balancing, and circuit breaking. It is also providing a way to implement communication layer, with support of RPC and REST.

@jezell
jezell / kubernetes-websocket.go
Created September 25, 2016 08:04
Connect to Kubernetes endpoint over websockets
package main
import (
"bytes"
"flag"
"golang.org/x/net/websocket"
"io"
"k8s.io/client-go/1.4/rest"
"k8s.io/client-go/1.4/tools/clientcmd"
"log"
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
"fmt"
"io"
@jpillora
jpillora / nginx-gitlab.conf
Created August 21, 2015 01:36
Gitlab go get via SSH
server {
listen {PUBLIC-GITLAB-HTTP-PORT}; #e.g. 80
server_name {PUBLIC-GITLAB-HOST}; #e.g. git.mycompany.com
# add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
location / {
## Hack to implement && - Concat two strings and compare result
if ($args ~* "^go-get=1") {
set $condition goget;
}
@jasich
jasich / gist:a1ea2f6a3d195fc57f01
Created July 22, 2014 19:35
Golang BasicAuth Middleware
package security
import (
"encoding/base64"
"net/http"
"strings"
)
// BasicAuth Middleware with next handler in chain
type BasicAuth struct {
@staltz
staltz / introrx.md
Last active May 20, 2024 14:59
The introduction to Reactive Programming you've been missing
@sukei
sukei / Router.php
Created February 19, 2014 15:21
A Router in a Tweet
<?php
/**
* The Router class is a fast and lightweight router (yes it is). It can handle
* a path and call the matching controller. If there is no match, then an
* exception will be throwned.
*
* ...and it fits in a tweet.
*
* @author Quentin Schuler aka Sukei <qschuler@neosyne.com>
@sukei
sukei / Container.php
Last active April 20, 2022 08:44
A Service Container in a Tweet
<?php
/**
* The Container class is a lightweight service container.
*
* ...and it fits in a tweet.
*
* @author Quentin Schuler aka Sukei <qschuler@neosyne.com>
*/
class Container{private $s;function set($k,$c){$this->s[$k]=$c;}function get($k){return(is_a($v=$this->s[$k],'Closure'))?$v($this):$v;}}