Skip to content

Instantly share code, notes, and snippets.

@michiel
michiel / How I Do PlantUML.md
Created November 18, 2019 23:28 — forked from jerieljan/How I Do PlantUML.md
PlantUML with Style -- How I do PlantUML

I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)

This gist details how I do my PlantUML workspace in a project.

  • The idea is to keep a globals directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent.
  • The stylesheet.iuml file keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors.
  • The style-presets.iuml file defines these colors so you can make "presets" or "themes" out of them.
  • As stated in the stylesheet.iuml, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly.
@michiel
michiel / example.sql
Created August 17, 2019 12:17 — forked from jcushman/example.sql
Store JSON history with the fast-json-patch library and Postgresql triggers
-- 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 November 28, 2018 03:17
PlantUML kubernetes sprites
#!/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 June 6, 2018 05:47
terminal world clock
#!/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 11:16
fluent-bit modify test data
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;

Nest/Lift

Nest 1

[INPUT]
    Name mem
    Tag  mem.local

[OUTPUT]

Name stdout

@michiel
michiel / pagination_example.sql
Created April 8, 2018 12:48 — forked from ssokolow/pagination_example.sql
Reasonably efficient pagination without OFFSET (SQLite version)
-- 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 April 7, 2018 03:28
graphql schema introspection query
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
...FullType
}
directives {
name
description
@michiel
michiel / commands-fluent-bit-dev.md
Last active February 6, 2018 02:45
fluent-bit dev

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 November 16, 2017 02:11 — forked from mbostock/.block
Minimap Demo
license: gpl-3.0