Skip to content

Instantly share code, notes, and snippets.

View Byteflux's full-sized avatar
☂️

Matthew Harris Byteflux

☂️
View GitHub Profile
@Byteflux
Byteflux / ForceLogout.ahk
Created September 27, 2024 23:14
A simple TCP logout macro for Path of Exile using Autohotkey 2 and CurrPorts
#Requires AutoHotkey v2.0
#SingleInstance Force
LogoutHotkey := "``" ; Keybind used to trigger the logout action
ClientProcessName := "PathOfExileSteam.exe" ; Should be "PathOfExile_x64.exe" or "PathOfExileSteam.exe"
CurrPortsName := "cports.exe"
CurrPortsDownloadURL := "https://www.nirsoft.net/utils/cports-x64.zip"
TestCurrPortsPath(Path)
@Byteflux
Byteflux / ShiftClickHelper.ahk
Created June 3, 2024 07:27
AHK script for Diablo 4 to enable basic skills to be performed by shift-click despite left-click being bound to Move or Move/Interact. Additionally prevents stutter stepping when spamming shift-click attacks.
; For my personal use, this script slightly changes how shift-clicking
; works in Diablo 4.
;
; The script requires a couple of key binding changes:
; 1. Move or Move/Interact must be bound to the Left Mouse Button.
; 2. Basic Skill must be bound to Mouse Button 5 (M5).
;
; After key bindings have been set, as you'd expect you can no longer
; perform a basic skill with left click.
;
@Byteflux
Byteflux / README.md
Last active November 1, 2021 17:26
Install Docker Engine on Debian and Ubuntu

Install Docker Engine on Debian and Ubuntu

$ curl -sL https://git.io/JPaRT | sudo sh
@Byteflux
Byteflux / life.py
Created July 16, 2021 01:03
Conway's Game of Life (in Python)
#!/usr/bin/env python3
"""Conway's Game of Life"""
STEPS = 100
STEPS_PER_SECOND = 3
# Pulsar
SEED = ('0 0 0 0 0 0 0 0 0 0 0 0 0 0 0',
'0 0 0 1 1 1 0 0 0 1 1 1 0 0 0',
<repositories>
<repository>
<id>byteflux</id>
<url>https://repo.byteflux.net/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.byteflux</groupId>
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index b5f318c00..f3c73b0de 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -215,11 +215,12 @@ public class PaperCommand extends Command {
}
private void dumpHeap(CommandSender sender) {
- File file = new File(new File(new File("."), "dumps"),
- "heap-dump-" + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss").format(LocalDateTime.now()) + "-server.hprof");
diff --git a/pom.xml b/pom.xml
index 4bfafb88..89a147c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,7 +101,7 @@
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
- <shadedPattern>me.glaremasters.guilds.libs.commons-io</shadedPattern>
+ <shadedPattern>me.glaremasters.guilds.libs.commonsio</shadedPattern>
@Byteflux
Byteflux / Library.java
Last active June 7, 2019 19:32
LibraryLoader example
package net.byteflux.core.library;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import static java.util.Objects.requireNonNull;
func getFlags(desiredHeap int64) string {
asKb := desiredHeap / units.KiB
// the following is specific to OpenJ9 and is based on Aikar's flags:
// https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
// The equivalent of -XX:G1NewSizePercent/-XX:G1MaxNewSizePercent in OpenJ9's gencon policy is -Xmns/-Xmnx.
// We have to manually compute these values ourselves. By default, the gencon policy assumes 25% of Xms, which is
// simply not sufficient for Minecraft (and Aikar can tell you).
xmns := asKb / 2
@Byteflux
Byteflux / clean-gists.php
Last active October 25, 2018 10:21
Gist Cleaner Script
<?php
// Your GitHub username goes here.
$user = $_ENV['GITHUB_USER'] ?? '';
// If using 2FA, you must create a Personal Access Token at https://github.com/settings/tokens
// The access token can be used in place of the password and should be revoked when no longer needed.
$password = $_ENV['GITHUB_PASSWORD'] ?? '';
// This is the base URL to the GitHub API.