Skip to content

Instantly share code, notes, and snippets.

View Jofairden's full-sized avatar

Jofairden Jofairden

View GitHub Profile
package net.tmodloader.modbrowser.view
import javafx.geometry.Pos
import javafx.scene.layout.Priority
import tornadofx.View
import tornadofx.action
import tornadofx.borderpane
import tornadofx.bottom
import tornadofx.button
import tornadofx.field
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace Loot.Modifiers
{
internal class ModifierEffectTooltipLineTagSerializer : TagSerializer<ModifierEffectTooltipLine, TagCompound>
{
@Jofairden
Jofairden / mandelbrot.cpp
Last active March 12, 2023 22:58
C++ Mandelbrot with gradiented colors Multithreaded generation
// Mandelbrot.cpp : Defines the entry point for the console application.
//#include "stdafx.h" // if you are using visual studio
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <thread>
using namespace std;
@Jofairden
Jofairden / PoopTerrariaWikiArmorRecipes.cs
Last active February 14, 2018 14:46
Poops out terraria armor sets recipes in wiki format
public override void OnEnterWorld(Player player)
{
// some random sheet to log armor recipes
// cuz im lazy, the following is just an example implementation
// poops out the wiki format for armor sets recipes
// does not support 3 hat variants, or assumes all hats use the same recipes
// (deviant hat recipes not allowed), put in 1 hat
// WorkBenches => Work Bench
// Anvils => Iron Anvil / Lead Anvil
// MythrilAnvil => Mythril Anvil / Orihalcum Anvil
@Jofairden
Jofairden / Program.cs
Last active February 14, 2018 14:50
tModLoader item hashing tests
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;
@extends('layouts.app')
@section('title', 'Welkom')
@section('styles')
<style>
#accordion
{
height: calc(60vh);
overflow-y: scroll;
}
@Jofairden
Jofairden / magicnumber.hs
Last active February 14, 2018 14:52
Calculate the magic number of length = 9 in Haskell
-- Calculate the magic number of length = 9
-- with numbers ranging from 1 to 9, and each number can only occur once
-- and each section of k length is divisable by k
del :: Eq a => [a] -> [a] -> [a]
del xs ys = [y| y <- ys, not(elem y xs)]
magicNumber :: [Int]
magicNumber = [var8 |
x1 <- [1..9],
@Jofairden
Jofairden / ItemValue.cs
Last active February 14, 2018 14:54
Terraria ItemValue struct that simplifies item values
public struct ItemValue
{
public int RawValue { get; private set; }
public int Copper { get; private set; }
public int Silver { get; private set; }
public int Gold { get; private set; }
public int Platinum { get; private set; }
public ItemValue(int c = 0, int s = 0, int g = 0, int p = 0)
{