Skip to content

Instantly share code, notes, and snippets.

View holly-hacker's full-sized avatar
:shipit:

Variant9 holly-hacker

:shipit:
View GitHub Profile
@holly-hacker
holly-hacker / MGBA.hx
Created September 13, 2026 15:28
Haxe interop for MGBA, when compiling use `--define lua-vanilla`
package mgba;
import haxe.Int64;
import lua.Table;
/** Native mGBA scalar types. Haxe/Lua represents all 8/16/32-bit integers as
* Lua numbers; these aliases preserve the API's signedness in type signatures. */
typedef U8 = UInt;
typedef U16 = UInt;
typedef U32 = UInt;
@holly-hacker
holly-hacker / PROTOCOL.md
Created August 15, 2026 00:37
LLM-generated analysis of the Alientek's bluetooth protocol

Alientek ATK-XTOOL BLE Protocol

Wire protocol for Alientek's BLE test/measurement devices (DM40 multimeter, ND1 dosimeter, EL15 electronic load, HP15/HP20 hot plates, C2 USB tester), reverse-engineered from the official Android apps. Sufficient to implement a from-scratch client for all six devices; per-device sections note remaining gaps explicitly.

Sources: v1.8 (ATK-XTOOL 1.82.apk, .NET MAUI, IL-decompiled — exact) and v2.0.12 (atk-xtool 2.0.12.apk, Flutter/Dart AOT, decompiled via blutter +

#pragma author Variant9
#pragma description Parses SoundFont2 (v2.04) files
#pragma magic [52 49 46 46 ?? ?? ?? ?? 73 66 62 6B]
#pragma endian little
/*!
Describes the SF2 soundfont format.
For more info on SF2:
- Specification: https://www.synthfont.com/sfspec24.pdf
- alt: https://www.polyphone.io/doc/files/sf_specifications_v2.04.pdf
@holly-hacker
holly-hacker / settings.json
Last active March 30, 2025 00:34
Mhammed Talhaouy's "Theme" theme, converted to Zed using Zed's theme_importer
{
"experimental.theme_overrides": {
"editor.invisible": "#484848",
"panel.background": "#1d2228", // idk what this is and how it should convert from vsc
"syntax": {
"property": { "color": "#ef596f" } // probably converted wrong
}
}
}
@holly-hacker
holly-hacker / database.rs
Created March 9, 2023 11:38
Small ergonomic embedded rust database using json file as backing store
use std::{borrow::Cow, collections::BTreeMap};
use color_eyre::eyre::Context;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
pub struct DatabaseInstance {
content: DatabaseContent,
}
impl DatabaseInstance {
import json as json_lib
import os
import re
import sys
import requests
# find json link of latest version
game_url = "https://www.crazygames.com/game/bullet-force-multiplayer"
iframe_pattern = re.escape("https://www.crazygames.com/gameframe/bullet-force-multiplayer/CHANGE_ME/index.html").replace("CHANGE_ME", "\\d+")
@holly-hacker
holly-hacker / PokeApiDefinitionGenerator.cs
Last active November 4, 2020 13:42
Generates a TypeScript definition file for PokéAPI
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PokeApiDefinitionGenerator;
using QuickType;
@holly-hacker
holly-hacker / Translator.cs
Last active April 13, 2019 00:39
Private Google Translate API usage
namespace HoLLy.DiscordBot.Sandwich.Tools {
public static class GoogleTranslate
{
private const string TranslateEndpoint = "https://translate.google.com/translate_a/single";
private const string TtsEndpoint = "https://translate.google.com/translate_tts";
public static readonly Dictionary<string, string> Languages = new Dictionary<string, string> {
{"auto", "Automatic"}, {"af", "Afrikaans"}, {"sq", "Albanian"}, {"am", "Amharic"}, {"ar", "Arabic"}, {"hy", "Armenian"},
{"az", "Azerbaijani"}, {"eu", "Basque"}, {"be", "Belarusian"}, {"bn", "Bengali"}, {"bs", "Bosnian"}, {"bg", "Bulgarian"},
{"ca", "Catalan"}, {"ceb", "Cebuano"}, {"ny", "Chichewa"}, {"zh-cn", "Chinese Simp."}, {"zh-tw", "Chinese Trad."},
{"co", "Corsican"}, {"hr", "Croatian"}, {"cs", "Czech"}, {"da", "Danish"}, {"nl", "Dutch"}, {"en", "English"}, {"eo", "Esperanto"},
@holly-hacker
holly-hacker / khdownload.cs
Created December 19, 2018 11:49
KHInsider downloader
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace KHDownload
@holly-hacker
holly-hacker / TeachConvert.cs
Last active November 25, 2018 18:14
Converts Teach2000 files to CSV and Anki's APKG format.
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using AnkiSharp; // Import form NuGet package
namespace TeachConvert