Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Rittmeister DRSchlaubi

View GitHub Profile
@DRSchlaubi
DRSchlaubi / kotlin.xml
Last active May 27, 2022
Proper kotlin inspections
View kotlin.xml
<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 Feb 5, 2022
Exposed support for arrays
View Arrays.kt
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 Nov 27, 2021
Update keys in java files using gradle
View Info.java
public class Info {
public static final String VERSION = "@VERSION@";
}
View GoogleFuture.kt
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
View why_its_better.java
// 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 Mar 31, 2021
Package-lists
View jda
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
View main.dart
fun main() {
print("hi");
}
@DRSchlaubi
DRSchlaubi / package-list
Created Sep 28, 2020
Spigot mc api package list
View 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
View DateUtil.java
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;