Skip to content

Instantly share code, notes, and snippets.

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

HoLLy holly-hacker

:shipit:
View GitHub Profile
@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
@holly-hacker
holly-hacker / CytusChartDump.README.md
Last active February 2, 2021 03:09
Cytus2 chart dump

Cytus 2 chart dump

Explains how to dump decrypted chart data from Cytus 2.

Requirements

  • Rooted android device (or emulator) capable of running GameGuardian
  • IDA Pro 7.0+
  • RoslynPad or LinqPad for .csx scripts

Steps

  1. Dump libil2cpp from memory (.so in apk is packed) and open it in IDA Pro. You can use something like GameGuardian for this. Keep in mind that there are 2 memory regions that make up the full binary.
@holly-hacker
holly-hacker / Evaluator.cs
Created October 29, 2018 20:05
Mathematical expression parser
using System;
using System.Collections.Generic;
using System.Linq;
namespace test20181029_matheval {
public static class Evaluator
{
private static Dictionary<char, Func<double, double, double>>[] functions;
@holly-hacker
holly-hacker / nsm_player.user.js
Created October 14, 2018 16:11
NinSheetMusic MIDI player
// ==UserScript==
// @name NinSheetMusic MIDI player
// @version 1
// @grant none
// @include https://www.ninsheetmusic.org/browse/series/*
// ==/UserScript==
function injectJs(url, callback) {
script = document.createElement('script');
// Inspired by DiscordInjections, but written from scratch
// https://github.com/DiscordInjections/DiscordInjections/blob/ea8cd3bfcbe2d1bf233f5b002df1830d9eafd245/engine/plugins/hooks/index.js
declare interface Window {
webpackJsonp: WebpackHelper.WebpackJsonpObject[];
}
namespace WebpackHelper {
declare interface InputConditions {
conditions?: [(x: any) => boolean];