Skip to content

Instantly share code, notes, and snippets.

View DRSchlaubi's full-sized avatar

Michael Rittmeister DRSchlaubi

View GitHub Profile
@DRSchlaubi
DRSchlaubi / kotlin.xml
Last active May 27, 2022 01:34
Proper kotlin inspections
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Kotlin Inspection Pack" />
<inspection_tool class="AddOperatorModifier" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="AddVarianceModifier" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="ConvertLambdaToReference" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ConvertPairConstructorToToFunction" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="Destructure" enabled="true" level="SERVER PROBLEM" enabled_by_default="true" />
<inspection_tool class="FromClosedRangeMigration" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="ImplicitThis" enabled="true" level="SERVER PROBLEM" enabled_by_default="true" />
@DRSchlaubi
DRSchlaubi / Arrays.kt
Created February 5, 2022 18:21
Exposed support for arrays
import org.jetbrains.exposed.sql.Column
import org.jetbrains.exposed.sql.ColumnType
import org.jetbrains.exposed.sql.CustomStringFunction
import org.jetbrains.exposed.sql.EqOp
import org.jetbrains.exposed.sql.Expression
import org.jetbrains.exposed.sql.ExpressionWithColumnType
import org.jetbrains.exposed.sql.Table
import org.jetbrains.exposed.sql.statements.api.PreparedStatementApi
import org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl
import org.jetbrains.exposed.sql.stringLiteral
@DRSchlaubi
DRSchlaubi / Info.java
Created November 27, 2021 04:03
Update keys in java files using gradle
public class Info {
public static final String VERSION = "@VERSION@";
}
@DRSchlaubi
DRSchlaubi / GoogleFuture.kt
Created September 21, 2021 16:19
GoogleFutureUtil
package dev.schlaubi.util
import com.google.api.core.ApiFuture
import com.google.common.util.concurrent.MoreExecutors
import kotlinx.coroutines.CancellableContinuation
import kotlinx.coroutines.suspendCancellableCoroutine
import java.util.concurrent.ExecutionException
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
@DRSchlaubi
DRSchlaubi / why_its_better.java
Created April 11, 2021 20:01
Java 8 is outdated ;)
// alt
void onCommand(CommandSender sender) {
if (sender instanceof Player) {
Player player = (Player) sender;
}
}
// neu
void onCommand(CommandSender sender) {
if (sender instanceof Player player) {
@DRSchlaubi
DRSchlaubi / jda
Created March 31, 2021 16:37
Package-lists
net.dv8tion.jda.annotations
net.dv8tion.jda.api
net.dv8tion.jda.api.audio
net.dv8tion.jda.api.audio.factory
net.dv8tion.jda.api.audio.hooks
net.dv8tion.jda.api.audit
net.dv8tion.jda.api.entities
net.dv8tion.jda.api.events
net.dv8tion.jda.api.events.channel.category
net.dv8tion.jda.api.events.channel.category.update
@DRSchlaubi
DRSchlaubi / main.dart
Created January 17, 2021 16:22
dasdsa
fun main() {
print("hi");
}
@DRSchlaubi
DRSchlaubi / dsa
Last active March 11, 2021 15:16
dsa
sdadsa
@DRSchlaubi
DRSchlaubi / package-list
Created September 28, 2020 19:29
Spigot mc api package list
org.bukkit
org.bukkit.advancement
org.bukkit.attribute
org.bukkit.block
org.bukkit.block.banner
org.bukkit.block.data
org.bukkit.block.data.type
org.bukkit.block.structure
org.bukkit.boss
org.bukkit.command
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jetbrains.annotations.NotNull;