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 / 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 / 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 / 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;
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 / 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 {
@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
}
}
}