Skip to content

Instantly share code, notes, and snippets.

View SoltauFintel's full-sized avatar
🏠
Home Office since March 2020

SoltauFintel

🏠
Home Office since March 2020
  • Niederrhein, Germany
View GitHub Profile
@SoltauFintel
SoltauFintel / fluent-api
Created December 11, 2023 08:26
Builder with Fluent API
https://medium.com/@hazraarka072/fluent-builder-and-powering-it-up-with-recursive-generics-in-java-483005a85fcd
@SoltauFintel
SoltauFintel / svelte.config.js
Last active December 17, 2023 18:37
Ärger nach Erstellung eines neuen Sveltekit Projekts
import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
@SoltauFintel
SoltauFintel / build.gradle
Created December 8, 2023 19:55
Gradle settings for Java 17
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
@SoltauFintel
SoltauFintel / ireplace.java
Created September 25, 2023 13:33
non case-sensitive replace
/**
* non case-sensitive replace()
* @param text to be changed text
* @param alt this text is to be replaced
* @param neu replace by this text
* @return text with replaced alt
*/
public static String ireplace(final String text, final String alt, final String neu) {
return text.replaceAll("(?i)" + alt.replace("{", "\\{").replace("}", "\\}"), neu);
}
@SoltauFintel
SoltauFintel / Smtp.java
Last active October 20, 2021 10:40
SMTP Java
/*Gradle:
implementation 'com.github.bbottema:simple-java-mail:5.0.1'
aktuellste Version ist mittlerweile: group: 'org.simplejavamail', name: 'simple-java-mail', version: '6.6.1'
Webseite: https://www.simplejavamail.org/features.html */
import java.time.LocalDateTime;
import org.pmw.tinylog.Logger;
import org.simplejavamail.email.EmailBuilder;
import org.simplejavamail.mailer.Mailer;
@SoltauFintel
SoltauFintel / date.md
Last active February 5, 2021 07:50
Datumsoperationen

Datum parsen

String str = line.substring(0, "05.02.2021 01:53:26".length());
DateTimeFormatter pattern = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss");
LocalDateTime date = LocalDateTime.parse(str, pattern);
@SoltauFintel
SoltauFintel / duplicateEmptyRows.md
Created October 9, 2020 06:56
Nach doppelten Leerzeilen suchen

regex: ^(\s*\r?\n){2,}

@SoltauFintel
SoltauFintel / Acrobat
Created August 10, 2019 15:55
Adobe Acrobat Reader
- Strg+K (Einstellungen) > Dokumente > Aktuellen Status des Werkzeugfenster speichern
- Werkzeugkasten am rechten Rand einklappen, ganz unten rechts kann man den ganz einklappen
- Strg+K > Seitenanzeige: Seitenlayout=Einzelne Seite, fortlaufend. Zoom: Fenstergröße
// Get subdir relative to given base dir
// Path base = ...
// Path file = ...
Path rel = base.relativize(file);
String subdir = rel.getParent() == null ? "" : rel.getParent().toString();
@SoltauFintel
SoltauFintel / classpathtoolong.gradle
Created March 17, 2018 13:01
Classpath too long problem with Gradle
startScripts {
doLast { // Remove too-long-classpath and use wildcard (works for Java 6 and above only)
windowsScript.text = windowsScript.text.replaceAll('set CLASSPATH=.*', 'set CLASSPATH=.;%APP_HOME%/lib/*')
}
}