Skip to content

Instantly share code, notes, and snippets.

@Ognian
Ognian / printMachine.js
Created December 27, 2019 13:07
a function returning in graphviz dot language the state machine from https://github.com/nickuraltsev/finity
const printMachine = stateMachineConfig => {
// decorate=true -> as attribute is also useful, but colors are far better
const edgeTimerAttributes = ', color="darkgreen", fontcolor="darkgreen"'
const edgeSuccessAttributes = ', color="blue", fontcolor="blue"'
const edgeFailAttributes = ', color="red", fontcolor="red"'
let result = 'digraph {\n'
result += Object.getOwnPropertyNames(stateMachineConfig.states).reduce((acc, stateName) => {
let res = `${acc}`
const stateObject = stateMachineConfig.states[stateName]
@Ognian
Ognian / test1.html
Created December 1, 2014 10:06
wkhtmltopdf test case
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--<link href="./report_template.css" rel="stylesheet" type="text/css">-->
<style>
thead, tfoot {display: table-row-group; }
/* avoid page breaks inside rows NONE OF THIS WORKS !!!!*/
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/laborvorschriften#",
"type": "object",
"title": "Laborvorschrift",
"name": "Laborvorschrift",
"required": ["_id", "name", "typ"],
"properties": {