Skip to content

Instantly share code, notes, and snippets.

@ingo-eichhorst
ingo-eichhorst / Makefile
Created June 14, 2025 11:57
Image Resizer for Portfolio Website
# Image processing with ImageMagick
# Usage: make resize-images
# Define directories
ASSETS_DIR = assets
SMALL_HEIGHT = 360
LARGE_HEIGHT = 1080
# Find all image files but exclude _small and _large versions
ORIGINAL_IMAGES := $(shell find $(ASSETS_DIR) -type f \( \
@ingo-eichhorst
ingo-eichhorst / animated-flowchart-dotted.html
Last active May 4, 2025 22:18
Mermaid Animated Dotted Line
<!DOCTYPE html>
<html>
<head>
<style>
.flowchart-link {
stroke-dasharray: 4, 4 !important;
animation: flow 1s linear infinite;
stroke-width: 2px !important;
}
@ingo-eichhorst
ingo-eichhorst / fitness_functions_2_0.csv
Last active March 26, 2024 14:27
Examples for Software 2.0 Fitness Functions
Quality Attribute Software 1.0 Software 2.0
Maintainability Cyclometric Dependencies & Sotograph Interpretability and Explainability
@ingo-eichhorst
ingo-eichhorst / recursively-calculate-prime-factor.js
Last active March 26, 2019 09:59
Calculating prime factors of a given number recursively @ Software Craftsmanship Berlin Meetup (2019-03-25)
/**
* Calculates the prime factors for a given number.
* - Note: Currently the function will chrash with numbers greater than ~2000 because of the recursive nature.
* - This could potentially be optimized with e.g. proper tail calls
*
* @param {number} number - number used to calculate the prime factors
* @returns {array} primeFactors
*/
function calculatePrimeFactor (number, prime = 2, results = []) {
if (number >= prime && number % prime === 0) {
@ingo-eichhorst
ingo-eichhorst / X-Callback HTTP header parse regex
Last active May 24, 2016 08:05
A regex (regular expression) to parse the HTTP header X-Callback
// http://progrium.com/blog/2012/11/26/x-callback-header-an-evented-web-building-block/
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec
// input
var input = <http://example.com/callback/>; method="post"; secret="123"; secret2="123"
// regex deliver url and method:
// <(http:\/\/\S*)>.*method="(\w*)"
var matches = /<(http:\/\/\S*)>.*method="(\w*)"/.exec(input);