Skip to content

Instantly share code, notes, and snippets.

View matrixik's full-sized avatar

Dobrosław Żybort matrixik

View GitHub Profile
@staltz
staltz / introrx.md
Last active July 30, 2026 16:15
The introduction to Reactive Programming you've been missing
@bodokaiser
bodokaiser / config.go
Created June 26, 2014 08:16
Simple example how to merge JSON files.
package main
import (
"log"
"fmt"
"encoding/json"
)
var conf1 = `
{
@momer
momer / grpc_with_reconnect.go
Last active February 7, 2024 00:44
A pattern I created to maintain connections to an RPC server in Go. Since net/rpc does not provide any methods for automatically reconnecting to an RPC server, I needed a work-around. Additionally, rpc.Client does not export any state variables (rpc.Client.shutdown and rpc.Client.closing) nor does it export the Client's Mutex. So, we wrap the rp…
package main
import (
"myapp/webserver/app/common"
"github.com/golang/glog"
"github.com/gorilla/mux"
"encoding/json"
"strconv"
"flag"
"fmt"
@kachayev
kachayev / concurrency-in-go.md
Last active September 23, 2025 16:12
Channels Are Not Enough or Why Pipelining Is Not That Easy

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@paulirish
paulirish / what-forces-layout.md
Last active July 26, 2026 09:05
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@0x3333
0x3333 / README.md
Last active February 1, 2022 22:45
Oh My Zsh plugin to colourize commands output

Oh My Zsh Colourize Plugin

This plugin uses CCZE to colourize some commands output.

Installation:

Copy ccze.plugin.zsh to ~/.oh-my-zsh/custom/plugins/ccze and logout and login again.

Usage:

anonymous
anonymous / mfp.sh
Created February 22, 2016 03:23
curl \
-O http://datashat.net/music_for_programming_0-manifesto.mp3 \
-O http://datashat.net/music_for_programming_1-datassette.mp3 \
-O http://datashat.net/music_for_programming_2-sunjammer.mp3 \
-O http://datashat.net/music_for_programming_3-datassette.mp3 \
-O http://datashat.net/music_for_programming_4-com_truise.mp3 \
-O http://datashat.net/music_for_programming_5-abe_mangger.mp3 \
-O http://datashat.net/music_for_programming_6-gods_of_the_new_age.mp3 \
-O http://datashat.net/music_for_programming_7-tahlhoff_garten_and_untitled.mp3 \
-O http://datashat.net/music_for_programming_8-connectedness_locus.mp3 \
@olih
olih / jq-cheetsheet.md
Last active July 25, 2026 09:44
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@h4cc
h4cc / Makefile
Last active May 7, 2025 06:20
Ubuntu 16.04 LTS Xenial Xerus - Basic packages i usually install
#
# Ubuntu 16.06 LTS (Xenial Xerus)
#
# Basic packages i usually install.
#
# Author: Julius Beckmann <github@h4cc.de>
#
# Upgraded Script from 14.04: https://gist.github.com/h4cc/7be7f940325614dc59fb
#