Skip to content

Instantly share code, notes, and snippets.

@nemoinho
nemoinho / version-control-history.svg
Last active January 27, 2026 20:33
Version Control Systems 1970 - 2020 rough overview
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nemoinho
nemoinho / AddressParser.ts
Last active January 10, 2026 15:37
A demonstration of a test-suite for an AddressParser. The purpose is to split German street-housenumber address lines correctly into a tuple of street and housenumber.
export class AddressParser {
splitStreetAndHouseNo(streetWithHouseNo: string): string[] {
// No number means we only have a street
if (/^(Straße \d+|[A-Z]\d)$/.test(streetWithHouseNo)) {
return [streetWithHouseNo, ''];
}
// If the input contains " Nr." use markter to split the line
const noMatcher = streetWithHouseNo.match(/\sNr\./i);
if (noMatcher) {
@nemoinho
nemoinho / nemoinho.setxkbmap
Last active August 27, 2024 00:17
My fixes for the german keyboard layout on Comexr-Laptops
// My fixes for the german keyboard layout
// Put this at: /usr/share/X11/xkb/symbols/nemoinho
// And apply via: setxkbmap nemoinho
// Thanks to: https://niklasfasching.de/posts/custom-keyboard-layou
default
xkb_symbols "nemoinho" {
include "de(basic)"
key <AE12> {[ dead_acute, dead_grave, apostrophe ]};
@nemoinho
nemoinho / .inputrc
Created May 27, 2024 20:50
My inputrc for macos
# HOME (fn+left)
"\e[H": beginning-of-line
"\e[1~": beginning-of-line
# END (fn+right)
"\e[F": end-of-line
"\e[4~": end-of-line
# Alt+right
"\e\e[C": forward-word
# Alt+left
"\e\e[D": backward-word

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;

Error in Spring Cloud + Logback

Spring Cloud program uses logback error

Let me start with the conclusion

For Spring Cloud programs that do not use Spring Cloud Context, it is best to disable Spring Cloud Context, because if it is not disabled, it will cause some configuration loading errors. Disable method: add in the main SpringBoot function System.setProperty("spring.cloud.bootstrap.enabled", "false");

@nemoinho
nemoinho / Struktur.md
Last active August 3, 2020 22:55
Orderstruktur-Beispiel einer React-Anwendung
root/
├─ assets/
│  └─ favicon.ico
└─ src/
   ├─ App.js
   ├─ services/
   │  └─ play─client/
   │     ├─ PlayClient.js
 │ ├─ PlayLocalStorageClient.js
@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