Skip to content

Instantly share code, notes, and snippets.

View marysaka's full-sized avatar
🍵

Mary Guillemard marysaka

🍵
View GitHub Profile
@marysaka
marysaka / BiomeRegistry.java
Created March 1, 2016 12:27
[Spigot 1.9 NMS] Biome Registry Hack
package eu.thog.base.utils.v1_9_R1;
import eu.thog.base.utils.IDRegistry;
import eu.thog.base.utils.IRegistry;
import eu.thog.base.utils.ReflectionUtils;
import net.minecraft.server.v1_9_R1.BiomeBase;
import net.minecraft.server.v1_9_R1.MinecraftKey;
import net.minecraft.server.v1_9_R1.RegistryID;
import net.minecraft.server.v1_9_R1.RegistryMaterials;
import org.apache.commons.lang3.Validate;
@marysaka
marysaka / ProgressLogger.java
Created August 20, 2016 10:43
Wrapper to the Gradle ProgressLogger internal API (Tested with version <= 2.14)
package eu.thog.gradle.util.progress;
import org.gradle.api.Project;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Wrapper to ProgressLogger internal API
* Created by Thog the 25/06/2016
package eu.thog.prometheus.core;
import com.google.common.eventbus.EventBus;
import net.minecraftforge.fml.common.*;
import net.minecraftforge.fml.common.versioning.ArtifactVersion;
import net.minecraftforge.fml.common.versioning.VersionRange;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import java.io.File;
import java.net.URL;
@marysaka
marysaka / puush.ex
Created July 17, 2017 17:38
Simple Puush Uploader in Elixir (httpc/crypto deps)
defmodule Puush do
def up(key, file_name), do: up(key, file_name, File.read!(file_name))
def up(key, name, data) do
boundary = "------#{:crypto.strong_rand_bytes(128) |> Base.encode16}"
payload = multipart_payload(boundary, [{"z", "waifu"}, {"k", key}], [{"f", name, data}])
case :httpc.request(:post, {'https://puush.me/api/up', [], 'multipart/form-data; boundary=#{boundary}', payload}, [], []) do
{:ok, {{_,200,_},_,body}} ->
case body |> to_string |> String.split(",") do
["0", url,_,_] -> {:ok, url}
data -> {:error, List.first(data)}
@marysaka
marysaka / decoder.ex
Created July 28, 2017 22:28
Simple RESP (REdis Serialization Protocol) decoder/encoder in Elixir
defmodule Redis.Protocol.Decoder do
def decode(<<"*", elem_count :: binary-size(1), "\r\n", rest :: binary>>) do
elem_count = elem_count |> String.to_integer
decode_array(rest, elem_count, [])
end
def decode(<<"+", rest :: binary>>), do: decode_simple_string(rest)
def decode(<<"-", rest :: binary>>), do: decode_error_string(rest)
def decode(<<"$", size :: binary-size(1), rest :: binary>>), do: decode_bulk_string(size |> String.to_integer, rest)
@marysaka
marysaka / switch_bct.py
Created October 3, 2017 19:01
Switch Simple BCT parser
#!/usr/bin/python3
from struct import *
import sys
def main():
args = sys.argv[1::]
if len(args) < 1:
print(sys.argv[0] + " boot.bct")
return
@marysaka
marysaka / pleroma_on_steamlink.md
Created November 16, 2017 12:30
Pleroma on the Steam Link
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)
{
// set 'loading idc file' mode
set_inf_attr(INF_GENFLAGS, INFFL_LOADIDC|get_inf_attr(INF_GENFLAGS));
GenInfo(); // various settings
Segments(); // segmentation
Enums(); // enumerations
/*----------------------------------------------------------------------------*/
/*-- blz.c - Bottom LZ coding for Nintendo GBA/DS --*/
/*-- Copyright (C) 2011 CUE --*/
/*-- --*/
/*-- This program is free software: you can redistribute it and/or modify --*/
/*-- it under the terms of the GNU General Public License as published by --*/
/*-- the Free Software Foundation, either version 3 of the License, or --*/
/*-- (at your option) any later version. --*/
/*-- --*/
/*-- This program is distributed in the hope that it will be useful, --*/
@marysaka
marysaka / psc-9.0.0.idc
Last active January 13, 2021 13:52
PSC 9.0.0
This file has been truncated, but you can view the full file.
// PSC 9.0.0 IDC by Thog, 2019/10/03
// main: 5e83dd40cbc929aa4073f087c90ee65e1ef517e787a8b5621f350f43920ee3aa
// Notes:
// - This currently only contains a full reversing of time.
// - Not all names are officials.
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)