Skip to content

Instantly share code, notes, and snippets.

@nemoinho
nemoinho / Software-Quotes.adoc
Last active December 8, 2023 10:17
Qutes regarding software-development

I have yet to see any problem, however complicated, which, when you looked at it in the right way, did not become still more complicated

— Poul Anderson
Anderson's Law

Over the last several decades we’ve seen a whole range of ideas regarding the architecture of systems. These include:

— Uncle Bob
Clean Architecture
@nemoinho
nemoinho / A_Readme.md
Last active May 10, 2023 12:43
Traefik mit docker-compose

Traefik via docker-compose

Hier ein Beispiel für Traefik, als selbstständiger Service in einer einzelnen docker-compose Datei und einem Service in einer anderen Datei.

Das externe Netz web wurde vorher einmalig erstellt mit dem Befehl:

docker network create web

Das macht das anschließende Arbeiten etwas leichter, weil der Name einfacher zu merken ist :)

@nemoinho
nemoinho / quick-docker-for-spring-and-angular.md
Last active November 4, 2022 19:04
A quick guide for spring+angular on docker

Docker für Spring und Angular

Docker für Spring (ich nehme gradle an, geht aber mit maven genauso) und Angular ist im Großen und Ganzen nicht schwer und kann easy-peasy mit Standard-Containern bewältigt werden.

Alles was man prinzipiell braucht sind 2 Dockerfiles für Frontend und Backend, sowie eine docker-compose um das alles zu organisieren.

Zum Verteilen kann man entweder eine Docker-Registry nutzen (docker-hub, quay.io, aws ecs), oder die Container packen und direkt auf die Server spielen.

Ich nehme hier an, dass das Projekt etwa so aufgebaut ist:

Enable css dark-mode in firefox on Linux

Go to about:config and add the property: ui.systemUsesDarkTheme=1

@nemoinho
nemoinho / dummy.ts
Created June 18, 2021 09:06
Branding and DTOs in typescript
declare const ___brand: unique symbol;
type Branded<A, B> = A & { readonly [___brand]: B };
type UID = Branded<number, User>;
interface User {
id: UID;
name: string;
lastLogin: Date;
@nemoinho
nemoinho / .gitconfig
Last active May 5, 2021 19:11
git configuration
[core]
# Use vim as commit-message editor
editor = vim
# Don't wrap lines on paged views such as diff or log
page = less -S
[diff]
# Use histogram to generate more readable diffs
algorithm = histogram
[pull]
@nemoinho
nemoinho / EqualsAndHashCodeDemo.java
Last active February 25, 2021 23:21
`equals()` and `hasCode()` are special in functions and their contract is easy to violate as this example shows.
import java.util.HashSet;
import java.util.Set;
import lombok.Data;
/**
* This is a simple demo how to implement equals and hashcode wrong, just because we don't understand it good enough
* It's is a very common mistake and easy to make wrong when you use lombok.
*/
@Data
@nemoinho
nemoinho / jira-board-size.user.js
Last active February 6, 2021 23:57
This script will enable resizing of the details on a board in jira.The script only runs in the latest versions of jira and only on domains which start with "jira." or on the atlassian-domain. -- Please click on "Raw" to install it via greasemonkey or tampermonkey
// ==UserScript==
// @name Jira Board Size
// @namespace info.nehrke.jira
// @author Felix Nehrke
// @description This script will enable resizing of the details on a board in jira. The script only runs in the latest versions of jira and only on domains which start with "jira." or on the atlassian-domain.
// @include /^https?:\/\/jira.[^\/]+\/secure\/RapidBoard.jspa.*/
// @include /^https?:\/\/[^\/]+?\.atlassian\.net\/secure\/RapidBoard.jspa.*/
// @downloadURL https://gist.github.com/nemoinho/70a176e73e2cbf14315772cc4e618516/raw/jira-board-size.user.js
// @updateURL https://gist.github.com/nemoinho/70a176e73e2cbf14315772cc4e618516/raw/jira-board-size.user.js
// @version 1.1.1