Skip to content

Instantly share code, notes, and snippets.

View orbyfied's full-sized avatar
🥶

orbyfied orbyfied

🥶
View GitHub Profile
@orbyfied
orbyfied / Tuple.java
Created December 12, 2021 17:16
Simple tuple class.
/**
* Simple tuple class.
* @author orbyfied
*/
public class Tuple {
/**
* Marks a field in a layout class as
* a unpackable field.
*/
@orbyfied
orbyfied / Bench.java
Last active December 17, 2021 10:41
Primes Benchmark Java (JDK 17 w/ Gradle)
public class Bench {
static boolean isPrime(int n) {
float f = (float)Math.sqrt(n) + 1;
int i = 2;
while (i < f) {
if ((n % i) == 0)
return false;
i++;
}
@orbyfied
orbyfied / distributor.gradle
Last active March 1, 2022 08:33
Distributes any module builds to servers in the parent directory of the root build.gradle
/*
Copyright 2022 - orbyfied (https://www.github.com/orbyfied)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@orbyfied
orbyfied / shuffle.py
Last active March 3, 2022 13:27
Generates all possible variations of a word or sentence without duplicate elements.
#
# By orbyfied, (C) 2022 L
#
from abc import abstractmethod
import time
import math
# utility class for building strings
class StringBuffer:
@orbyfied
orbyfied / eraser.py
Last active March 2, 2022 13:48
Erases a specified file.
import sys
import os.path
# get file to erase
fn = input("file to erase: ")
# open file'
try:
# check if it exists
if not os.path.exists(fn):
@orbyfied
orbyfied / Opbd.java
Last active November 26, 2023 15:33
Minecraft backdoor I spent too much time on.
/*
Copyright 2022 orbyfied <https://www.github.com/orbyfied>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@orbyfied
orbyfied / shuffle.hpp
Last active March 15, 2022 17:05
C++ program that generates all possible shuffled variations of a word without duplicates. Single header file.
/*
Copyright 2022 orbyfied <https://www.github.com/orbyfied>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@orbyfied
orbyfied / StringInputValidationBenchmark.java
Created June 18, 2022 16:40
Java openjdk-17 - String Input Validation Benchmark
package test;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
@orbyfied
orbyfied / objects.lua
Last active September 4, 2022 12:30
Simple library for aid in object oriented programming in Lua.
---@diagnostic disable: undefined-field
-- Check if the library has already been loaded
if _G.LIB_OBJECTS_LOADED then
return "already loaded"
end
------------------------------------------------
----- Utilities
------------------------------------------------
@orbyfied
orbyfied / Benchmarks.java
Created June 2, 2023 21:14
Scuffed Benchmark Runner
import java.io.PrintStream;
import java.util.function.Consumer;
import java.util.function.IntConsumer;
public class Benchmarks {
public static record BenchmarkResult(String name, int maxPasses, long maxTime,
int passes, long totalTime, double averagePassTime) {
public BenchmarkResult print(PrintStream stream) {
long tms = totalTime / 1_000_000;