Skip to content

Instantly share code, notes, and snippets.

View Kraballa's full-sized avatar
🙂
looking for interesting things

Vinzent Brömauer Kraballa

🙂
looking for interesting things
View GitHub Profile
@Kraballa
Kraballa / serializer.cs
Last active June 9, 2025 15:52
Serializer class for serializing and deserializing any dictionary to xml
using System.Xml.Serialization;
namespace Program
{
public static class DictSerializer<K, V> where K : notnull
{
public static void Serialize<T>(T data, string filename) where T : IDictionary<K, V>
{
Tuple<K, V> pair = new();
pair.Keys = data.Keys.ToArray();
@Kraballa
Kraballa / server.py
Created December 3, 2024 18:27
Fully featured commonmark markdown rendering python flask server. Supports links, images and some extensions.
from flask import Flask, request, render_template, make_response, send_file
from markupsafe import Markup
from markdown_it import MarkdownIt
from mdit_py_plugins.footnote import footnote_plugin
from mdit_py_plugins.tasklists import tasklists_plugin
from mdit_py_plugins.front_matter import front_matter_plugin # parses header info
from mdit_py_plugins.texmath import texmath_plugin
import os
md = (
@Kraballa
Kraballa / render.py
Created September 5, 2024 16:30
jinja2 static website template renderer
import shutil
import os
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('.'))
def renderFile(filename):
origPath = "files/" + filename
newPath = "output/" + filename
template = env.get_template(origPath)
@Kraballa
Kraballa / acore_mods.sql
Created March 12, 2024 18:25
AzerothCore + Autobalance Solo Scripts
-- Solo Mods
-- The following details changes to be made to make AzerothCore instances more solo friendly.
-- Individual changes to spells and mobs are required to allow solo play where usually a group of people is required.
-- These changes are intended to be used with the autobalance module.
-- ###########
-- ## INDEX ##
-- ###########
-- 1. Explanation and Philosophy
-- 2. Dungeons
@Kraballa
Kraballa / cheatsheet.html
Last active February 6, 2024 15:48
Cheatsheet for a few things i keep forgetting. basic python and javascript syntax, css tricks, shell scripts for network namespaces
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: sans-serif;
--code-col: rgba(220, 220, 220, 0.511);
}
@Kraballa
Kraballa / SimplexNoise.cs
Created November 9, 2022 15:24
Simplex Noise generator
/// <summary>
/// from http://stephencarmody.wikispaces.com/Simplex+Noise
///
/// blind conversion to C#... let's see what blows up.
///
/// NOT THREADSAFE
/// </summary>
public class SimplexNoise
{
private const float onethird = 0.333333333f;
function build(chain) {
let fileData = "";
fileData += "Version 4\nSHEET 1 880 680\n";
//add all wires
fileData += "WIRE 32 -256 32 -272\n" +
"WIRE 32 -208 32 -256\n" +
"WIRE 32 -96 32 -128\n" +
"WIRE -128 -48 -128 -64\n" +
const NUM_STEPS = 1000;
const e24 = [1, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2, 2.2, 2.4, 2.7, 3, 3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5, 8.2, 9.1];
const e48 = [1, 1.05, 1.1, 1.15, 1.21, 1.27, 1.33, 1.4, 1.47, 1.54, 1.62, 1.69, 1.78, 1.87, 1.96, 2.05, 2.15, 2.26, 2.37, 2.49, 2.61, 2.74, 2.87, 3.01, 3.16, 3.32, 3.48, 3.65, 3.83, 4.02, 4.22, 4.42, 4.64, 4.87, 5.11, 5.36, 5.62, 5.9, 6.19, 6.49, 6.81, 7.15, 7.5, 7.87, 8.25, 8.66, 9.09, 9.53];
const e96 = [1, 1.02, 1.05, 1.07, 1.1, 1.13, 1.15, 1.18, 1.21, 1.24, 1.27, 1.3, 1.33, 1.37, 1.4, 1.43, 1.47, 1.5, 1.54, 1.58, 1.62, 1.65, 1.69, 1.74, 1.78, 1.82, 1.87, 1.91, 1.96, 2, 2.05, 2.1, 2.15, 2.21, 2.26, 2.32, 2.37, 2.43, 2.49, 2.55, 2.61, 2.67, 2.74, 2.8, 2.87, 2.94, 3.01, 3.09, 3.16, 3.24, 3.32, 3.4, 3.48, 3.57, 3.65, 3.74, 3.83, 3.92, 4.02, 4.12, 4.22, 4.32, 4.42, 4.53, 4.64, 4.75, 4.87, 4.99, 5.11, 5.23, 5.36, 5.49, 5.62, 5.76, 5.9, 6.04, 6.19, 6.34, 6.49, 6.65, 6.81, 6.98, 7.15, 7.32, 7.5, 7.68, 7.87, 8.06, 8.25, 8.45, 8.66, 8.87, 9.09, 9.31, 9.53, 9.76];
@Kraballa
Kraballa / Controller.cs
Last active August 10, 2022 06:21
main game class of a basic FNA project
using Microsoft.Xna.Framework;
namespace YourNamespace
{
internal class Controller : Game
{
private static string Title = "Title";
public const int WIDTH = 1280;
public const int HEIGHT = 720;
@Kraballa
Kraballa / encounter_checker.py
Last active October 19, 2020 18:50
pokecrystal encounter checker. check for pokemon without encounters and more
# made for people modifying pret/pokecrystal who want to
# check what pokemon need changes in their wild encounter
# rates. prints 2 tables, one containing a list of all
# pokemon without encounters, one containing all
# encounters sorted by their total overall probability
#
# 1. place this file in your ./tools folder
# 2. make sure the paths and encounter rates below are accurate (only if you changed them)
# 3. if you don't want to incorporate water encounters comment out the last 2 'parse_encounters' lines