Skip to content

Instantly share code, notes, and snippets.

@dashaw92
dashaw92 / PanamaMain.java
Created March 2, 2024 17:03
Testing Project Panama in JDK 22
package me.daniel.panama;
import java.lang.foreign.*;
import java.lang.invoke.MethodHandle;
public class PanamaMain {
public static void main(String[] args) throws Throwable {
Linker linker = Linker.nativeLinker();
SymbolLookup libc = linker.defaultLookup();
@dashaw92
dashaw92 / TST - userChrome.css
Created February 25, 2024 20:40
Hide native tab bar + TST header
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/hide_tabs_toolbar.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */
/* Hides tabs toolbar */
/* For OSX use hide_tabs_toolbar_osx.css instead */
/* Note, if you have either native titlebar or menubar enabled, then you don't really need this style.
* In those cases you can just use: #TabsToolbar{ visibility: collapse !important }
*/
@dashaw92
dashaw92 / chorded actions.kt
Last active March 12, 2023 00:33
Chorded inventory actions
package me.danny.shop.inv
import org.bukkit.event.inventory.InventoryClickEvent
import java.util.function.Supplier
//Built with ChordBuilder for convenience
//Represents a "chorded" action in a menu that keeps state between clicks
class Chord<T>(
//The actions to take at each step
//Actions increment by one when the previous action
@dashaw92
dashaw92 / settings.json
Created December 8, 2020 08:12
VSCode settings
{
"terminal.external.windowsExec": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"editor.fontFamily": "Cascadia Code, Consolas, 'Courier New', monospace",
"rust.wait_to_build": 10,
"rust.show_hover_context": false,
"workbench.colorTheme": "Base16 Dark Google",
"launch": {
"version": "0.2.0",
"configurations": [{
@dashaw92
dashaw92 / start 1.8.bat
Last active June 11, 2020 06:06
Paper + Kotlin server loader script (batch and bash)
:: This version is for 1.8.8
:: If you're using a modern version of paper, use the other scripts
:: Changes:
:: patched_%mc_ver%.jar -> patched.jar
:: paper main class changed to com.destroystokyo.paperclip.Paperclip
@echo off
setlocal enabledelayedexpansion
:: Paper + Kotlin loader by Danny
@dashaw92
dashaw92 / gen.sh
Last active August 20, 2019 21:46
9txCore potion effect generator
#!/bin/bash
while read LINE; do
IFS=',' read -ra ARR <<< "$LINE"
filename="${ARR[0]}.js"
effect="${ARR[2]}"
duration="${ARR[3]}"
amp="${ARR[4]//$'\r'}"
cat > "$filename" << EOF
var DonorPlayer = Java.type('org.realcodingteam.plan9.data.DonorPlayer');
@dashaw92
dashaw92 / 0001-Updated-to-1.14.patch
Created July 28, 2019 23:43
Patch to update VanishNoPacket to Paper 1.14
From 103003e73788d85c14d9491eaad6d3b50a75278d Mon Sep 17 00:00:00 2001
From: dashaw92 <dashaw92@gmail.com>
Date: Sun, 28 Jul 2019 19:41:33 -0400
Subject: [PATCH] Updated to 1.14
---
.gitignore | 4 +
pom.xml | 391 +++++++-----------
.../vanish/VanishAnnounceManipulator.java | 23 +-
.../java/org/kitteh/vanish/VanishManager.java | 17 +-
@dashaw92
dashaw92 / profiles.json
Last active December 8, 2020 06:42
My Windows Terminal profile
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs" : true,
"defaultProfile" : "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"initialCols" : 120,
"initialRows" : 35,
"initialPosition" : "450, 250",
"tabWidthMode": "titleLength",
"keybindings" :
[
@dashaw92
dashaw92 / build.gradle
Created March 23, 2019 07:02
Skeleton Kotlin/Spigot build.gradle
plugins {
id 'idea'
id 'org.jetbrains.kotlin.jvm' version '1.3.0'
id 'com.github.johnrengelman.shadow' version '2.0.4'
}
group 'me.daniel'
version '1.0'
//vars (CHANGE ME)
@dashaw92
dashaw92 / Commandsell.patch
Created March 9, 2019 16:18
Modification to EssentialsX Commandsell.java to provide hooking into when people sell items to the server
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index e6c41a98..8897b6b5 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -11,6 +11,9 @@ import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;