Skip to content

Instantly share code, notes, and snippets.

View Leo40Git's full-sized avatar
🙃
Java is a good language

ADudeCalledLeo Leo40Git

🙃
Java is a good language
View GitHub Profile
@Leo40Git
Leo40Git / Make-HRESULT-From-Win32.ps1
Created December 28, 2023 18:12
MAKE_HRESULT_FROM_WIN32 as a PowerShell function
function Make-HRESULT-From-Win32 {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[long] $ErrorCode
)
if ($ErrorCode -le 0) {
return $ErrorCode
} else {
@Leo40Git
Leo40Git / build.bat
Last active January 28, 2023 09:40
YouTube ReVanced Build Script
@echo off
setlocal
pushd %~dp0
set DEPLOY=1
set ADB=platform-tools\adb.exe
set DEVICE_NAME=988e9048305953523230
set JAVA=jre\bin\java.exe
set CLI_JAR=revanced-cli-all.jar
@Leo40Git
Leo40Git / quilt_powered_dark_resized.svg
Last active August 25, 2022 13:54
"Powered by Quilt Loader" signature banner (resized to be same width as Modfest: Singularity signature banner)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Leo40Git
Leo40Git / FileListener.java
Created June 19, 2022 18:04
File Watcher Service prototype
package adudecalledleo.filewatch;
import java.nio.file.Path;
@FunctionalInterface
public interface FileListener {
void onChange(Path path);
}
@Leo40Git
Leo40Git / BadThemeUpdater.java
Last active January 8, 2022 20:45
Bad Theme Updater
// Uses CorellanStoma#1996's Canary update mappings
// https://docs.google.com/spreadsheets/d/1rLm7KJInDfLVbdnnjxfOaFjwdr51vr7hZdGc61-iyy0/edit (download as CSV)
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.Paths;
@Leo40Git
Leo40Git / mkjre.bat
Last active November 7, 2021 20:33
Script to create JRE from Maven-style JAR folder
@echo off
setlocal EnableDelayedExpansion
:: these extra dependencies aren't picked up by jdeps
:: jdk.zipfs is required, presumably to access resources embedded in the JAR?
:: jdk.crypto.ec is required for internet communication with SSL
set EXTRA_DEPS=jdk.zipfs,jdk.crypto.ec
set JDK_PATH=%~1
set OUT_PATH=%~2