Skip to content

Instantly share code, notes, and snippets.

View pkcpkc's full-sized avatar

Paul Hackenberger pkcpkc

View GitHub Profile
@pkcpkc
pkcpkc / tech-radar.html
Last active May 7, 2021 10:22
JavaScript: Tech Radar based on Zalandos code https://opensource.zalando.com/tech-radar/
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Tech Radar</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://opensource.zalando.com/tech-radar/release/radar-0.5.js"></script>
</head>
<body>
@pkcpkc
pkcpkc / index.html
Last active March 29, 2019 17:43
HTML/UML: Default setup for mermaidJS https://mermaidjs.github.io/
<html>
<head>
<!-- https://mermaidjs.github.io/sequenceDiagram.html -->
<script>
function generateTableOfContents(maxHeaderLevel = 3, styleItem = function (text, level, itemAnchor) {
var spaces = "&nbsp;".repeat(Math.max(0, (level - 1)) * 3);
var tocEntry = spaces + '• <a href="#' + itemAnchor + '">' + text + '</a><br/>';
return tocEntry;
}) {
@pkcpkc
pkcpkc / tableOfContents.js
Last active December 22, 2023 20:27
JavaScript: HTML heading Table of Contents: Generate a navigatable, stylable table of contents based on the heading structure of an html document
/*
Collect headers (h1, h2, ..., hx) from html and generates navigatable, stylable table of contents.
@param maxHeaderLevel int Define header level depth, defaults to 3.
@param styleItem function Function that accepts text:string, level:int and itemAnchor:string to style toc entry, default renderer is set already (check source for usage).
@return string HTML table of contents
*/
function generateTableOfContents(maxHeaderLevel = 3, styleItem = function (text, level, itemAnchor) {
var spaces = "&nbsp;".repeat(Math.max(0, (level - 1)) * 3);
var tocEntry = spaces + '<a href="#' + itemAnchor + '">' + text + '</a><br/>';
@pkcpkc
pkcpkc / strip-lib.sh
Last active March 29, 2019 17:55
iOS/sh: Extract sub-libraries from a given library without access to source code to avoid namespace clashes
#!/bin/zsh
# We at WeltN24 were facing the problem that two libraries that we integrated
# in our iOS project, used the same sub-library which resulted in naming
# conflicts due to the non-existing namespaces in Swift.
#
# If you know what you are doing you can try to solve this conflict by
# extracting the shared sub-library from one of the libraries you want to
# integrate. You can even do this if you don't have access to the source code
# using the lipo (create or operate on universal files) and ar (create and