Skip to content

Instantly share code, notes, and snippets.

View NeyrowZ's full-sized avatar
🐳
Learning Networking

Nolan NeyrowZ

🐳
Learning Networking
View GitHub Profile
@NeyrowZ
NeyrowZ / FileUtils.java
Created February 22, 2026 15:52
Utility methods to manage File object manipulation with good error handling.
import java.io.*;
public class FileUtils {
public static void newFolder(File folder) throws Exception {
if (!folder.exists() && !folder.mkdirs()) throw new Exception("Unable to create folder : " + folder.getPath());
}
public static void newFile(File file) throws Exception {
if (!file.exists()) {
@NeyrowZ
NeyrowZ / publish.yml
Created January 30, 2026 23:02
Github workflow configuration to deploy maven package by version. Checkout & push a new branch with formated name (d/rYYYY.MAJOR.MINOR.PATCH) to deploy.
name: Publish
on:
push:
branches: ["*", "!master", "!*-*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
@NeyrowZ
NeyrowZ / PlayerOffHandEvents.java
Created March 15, 2025 22:57
PlayerOffHandEvents to block any interraction with off hand slot and use it as a keybind.
public class PlayerOffHandEvents implements Listener {
@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
if (e.getClick() == ClickType.SWAP_OFFHAND || e.getSlot() == 40) e.setCancelled(true);
}
@EventHandler
public void onInventoryDrag(InventoryDragEvent e) {
if (e.getRawSlots().contains(45)) e.setCancelled(true);