Skip to content

Instantly share code, notes, and snippets.

Michiel Kalkman michiel

Block or report user

Report or block michiel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@michiel
michiel / example.sql
Created Aug 17, 2019 — forked from jcushman/example.sql
Store JSON history with the fast-json-patch library and Postgresql triggers
View example.sql
-- Enable pl/v8:
CREATE EXTENSION plv8;
-- Create json history table:
CREATE TABLE json_history (id BIGSERIAL PRIMARY KEY, tstamp timestamp DEFAULT now(), table_name text, column_name text, target_id bigint, transform json);
-- Create test table:
CREATE TABLE test_json (id BIGSERIAL PRIMARY KEY, data JSON);
-- Enable history tracking on test_json.data:
@michiel
michiel / generate.sh
Last active Nov 28, 2018
PlantUML kubernetes sprites
View generate.sh
#!/bin/bash
git clone https://github.com/octo-technology/kubernetes-icons.git
cd kubernetes-icons/png
rm -rf tmp
rm *iuml
rm *uml
mkdir tmp
@michiel
michiel / clock.sh
Created Jun 6, 2018
terminal world clock
View clock.sh
#!/bin/bash
function clock() {
clear
TZ=US/Pacific date "+LA : %Y/%m/%d %a — %I:%M %p"
TZ=US/Eastern date "+New York : %Y/%m/%d %a — %I:%M %p"
TZ=Europe/Amsterdam date "+Amsterdam : %Y/%m/%d %a — %I:%M %p"
TZ=Asia/Bangkok date "+Bangkok : %Y/%m/%d %a — %I:%M %p"
TZ=Japan date "+Tokyo : %Y/%m/%d %a — %I:%M %p"
TZ=Australia/Melbourne date "+Melbourne : %Y/%m/%d %a — %I:%M %p"
@michiel
michiel / fluent-bit-modify-test-gen.js
Created May 14, 2018
fluent-bit modify test data
View fluent-bit-modify-test-gen.js
function genId(len) {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < len + 1; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
View fluent-bit-nest.md

Nest/Lift

Nest 1

[INPUT]
    Name mem
    Tag  mem.local

[OUTPUT]
    Name  stdout
@michiel
michiel / pagination_example.sql
Created Apr 8, 2018 — forked from ssokolow/pagination_example.sql
Reasonably efficient pagination without OFFSET (SQLite version)
View pagination_example.sql
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10
@michiel
michiel / schema-introspection.graphql
Last active Apr 7, 2018
graphql schema introspection query
View schema-introspection.graphql
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
...FullType
}
directives {
name
description
View commands-fluent-bit-dev.md

Manage and update remote branches

git remote add upstream https://github.com/fluent/fluent-bit.git
git checkout -b ffscl-master
git remote add ffscl https://github.com/ffscl/fluent-bit.git
git fetch -v ffscl master
git branch --set-upstream-to=ffscl/master
git remote -v

Dev

@michiel
michiel / .block
Last active Nov 16, 2017 — forked from mbostock/.block
Minimap Demo
View .block
license: gpl-3.0
@michiel
michiel / rust-update-docs-hook
Created Sep 21, 2017 — forked from Stebalien/rust-update-docs-hook
A post-commit hook to update a rust project's gh-pages.
View rust-update-docs-hook
#!/bin/bash
set -e
[[ "$(git symbolic-ref --short HEAD)" == "master" ]] || exit 0
msg() {
echo "> $@"
}
dir="$(pwd)"
tmp="$(mktemp -d)"
You can’t perform that action at this time.