Skip to content

Instantly share code, notes, and snippets.

View SirYwell's full-sized avatar
🚀

Hannes Greule SirYwell

🚀
  • Karlsruhe, Baden-Württemberg, Deutschland
  • 00:15 (UTC +02:00)
View GitHub Profile
@SirYwell
SirYwell / Wither.java
Created January 22, 2024 19:20
Implementation of Withers using Babylon Code Reflection
import java.lang.reflect.RecordComponent;
import java.lang.reflect.code.analysis.Patterns;
import java.lang.reflect.code.Op;
import java.lang.reflect.code.Quotable;
import java.lang.reflect.code.Quoted;
import java.lang.reflect.code.descriptor.MethodDesc;
import java.lang.reflect.code.op.CoreOps;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SirYwell
SirYwell / RstTableReformatter.java
Created November 26, 2023 13:51
Because docutils is just terrible...
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class RstTableReformatter {
public static void main(String[] args) {
Table table = parse("Your table here");
System.out.println(print(table));
}
@SirYwell
SirYwell / Day02.java
Created December 4, 2022 18:30
AOC Day 02 Java Vector API solution
package de.sirywell.aoc2022.java.day02;
import jdk.incubator.vector.ByteVector;
import jdk.incubator.vector.ShortVector;
import jdk.incubator.vector.VectorMask;
import jdk.incubator.vector.VectorShuffle;
import jdk.incubator.vector.VectorSpecies;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
// The first formal parameter of an anonymous constructor of an anonymous class
// whose superclass is an inner class (not in a static context) (§15.9.5.1).
public class A {
class InnerA {
}
public void m() {
new InnerA() {};
}
@SirYwell
SirYwell / ModifierConstantsCollector.java
Last active September 12, 2021 18:47
Small tool to extract modifier bit info from JDT
package spoon.generating.jdt;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Arrays;
@SirYwell
SirYwell / TODO.md
Last active November 9, 2019 08:33
Raw draft oft Commandry

TODO

  • l10n
  • generating help messages
  • different arguments for one command (like teleport <playerTo> AND teleport <playerFrom> <playerTo>
  • context (for command issuer, language settings etc.)
  • aliases
  • async support