Skip to content

Instantly share code, notes, and snippets.

View Quackster's full-sized avatar

Quackster

View GitHub Profile
@Quackster
Quackster / LambdaJsonConverter.java
Created December 1, 2025 11:52
LambdaJsonConverter.java
package asm.predicate;
/**
* A library for converting Java lambda predicates to JSON and back using ASM bytecode analysis.
*
* Due to JVM limitations with dynamically generated lambda classes, this library works best with:
* 1. SerializablePredicate lambdas (recommended for runtime lambda conversion)
* 2. PredicateBuilder for programmatic predicate construction
* 3. Static method references that can be analyzed
*
@Quackster
Quackster / BoxExamples.java
Created October 28, 2025 03:37
Java Lazily Load Library
// Value.java
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.function.Supplier;
/**
* A container that holds a value and supports both eager and lazy transformations.
* Provides synchronous and asynchronous computation capabilities.
*
* @param <T> the type of the contained value
import java.time.LocalDateTime;
import java.time.DayOfWeek;
import java.util.*;
import java.util.stream.Collectors;
public class CronParser {
private final String expression;
private final Set<Integer> minutes;
private final Set<Integer> hours;
private final Set<Integer> daysOfMonth;
@Quackster
Quackster / FiguredataConverter.java
Created September 5, 2025 04:19
Avatara4j figuredata conversion
package net.h4bbo.avatara4j.figure.converter;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.h4bbo.avatara4j.figure.readers.FiguredataReader;
import net.h4bbo.avatara4j.figure.types.FigureColor;
import org.json.JSONObject;
import org.json.XML;
import org.json.XMLParserConfiguration;
@Quackster
Quackster / gist:3245fe2117964857372a4278f21cc932
Last active April 16, 2025 05:28
Flash C# class generation from Habbo.swf
class MessageClassGenerator {
static void Main() {
string input = @ "
_events[1] = com.sulake.habbo.communication.messages.incoming.handshake.SecretKeyEvent;
_events[277] = com.sulake.habbo.communication.messages.incoming.handshake.InitCryptoMessageEvent;
_events[0x0101] = com.sulake.habbo.communication.messages.incoming.handshake.SessionParamsMessageEvent;
_events[2] = com.sulake.habbo.communication.messages.incoming.handshake.UserRightsMessageEvent;
_events[3] = com.sulake.habbo.communication.messages.incoming.handshake.AuthenticationOKMessageEvent;
_events[50] = com.sulake.habbo.communication.messages.incoming.handshake.PingMessageEvent;
_events[5] = com.sulake.habbo.communication.messages.incoming.handshake.UserObjectEvent;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from subprocess import call
import sys, os, getopt
import struct
@Quackster
Quackster / vending.java
Created May 17, 2020 14:11
classichabbo vending machine
package org.alexdev.havana.game.item.interactors.types;
import org.alexdev.havana.game.GameScheduler;
import org.alexdev.havana.game.item.Item;
import org.alexdev.havana.game.pathfinder.Position;
import org.alexdev.havana.game.pathfinder.Rotation;
import org.alexdev.havana.game.player.Player;
import org.alexdev.havana.game.room.Room;
import org.alexdev.havana.game.room.enums.StatusType;
import org.alexdev.havana.game.triggers.GenericTrigger;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FurniAlias
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FurniAlias
{
@Quackster
Quackster / pathfinder.c
Last active January 19, 2018 06:34
Pathfinder port from C# to C11
#include "stdafx.h"
#include "stdlib.h"
#include "PathfinderTest.h"
#include <limits.h>
#include <windows.h>
typedef struct coord_s {
int x;