Skip to content

Instantly share code, notes, and snippets.

View YellowAfterlife's full-sized avatar

Vadym Diachenko YellowAfterlife

View GitHub Profile
<html><head>
</head><body>
<div style="text-align: center">
<canvas width="640" height="360" id="canvas">
</canvas>
<br>Click to change tiles.
</div>
<script type="text/javascript">(function() {
package yy;
using StringTools;
import haxe.Json;
/**
* This is largely a copy of haxe.format.JsonParser, except:
* - Trailing commas are allowed
* - Int64 literals are preserved as Int64, not cast to Float with precision loss
* @author YellowAfterlife
*/
@YellowAfterlife
YellowAfterlife / ItemConf.cs
Last active March 15, 2026 04:36
A TerraPatcher plugin for tweaking item stats.
using System;
using System.Collections.Generic;
using PluginLoader;
using Terraria;
/// Updated July 24, 2015
/// Updates: https://gist.github.com/YellowAfterlife/1edaa4060191823ee366
namespace YellowAfterlifePlugins {
/// Item modification rules are defined as following:
/// [item3507]
@YellowAfterlife
YellowAfterlife / raw_mouse.cpp
Last active June 7, 2025 21:09
My tweaks to multi-device polling code by Jake Stookey (http://www.jstookey.com/arcade/rawmouse/)
//================================================================
//
// raw_mouse.c - Win XP access to multiple mice via raw input
//
// To do:
//
// - Improve the method for weeding out the RDP Mouse. Find "status bits" (see below).
//
//================================================================
import haxe.ds.*;
import haxe.Constraints.IMap;
@:transitive
@:multiType(@:followWithAbstracts K)
abstract Set<T>(IMap<T, Bool>) {
public function new();
@:to static inline function toStringMap<K:String>(t:IMap<K, Bool>):StringMap<Bool> {
return new StringMap<Bool>();
@YellowAfterlife
YellowAfterlife / Player.hx
Last active May 26, 2024 07:37
Terraria 1.3 character file format implementation in Haxe
package terra;
import openfl.Lib;
import openfl.utils.ByteArray;
import openfl.utils.Endian;
import Ext.cfor;
using utils.ByteArrayTools;
/**
* ...
#include <Windows.h>
#include <stdio.h>
#define dllx extern "C" __declspec(dllexport)
dllx double delay(double ms) {
Sleep((DWORD)ms);
return 1;
}
var i;
i := 0;
while (i < 10) begin
show_message("o rly");
i := i + 1;
end;
@YellowAfterlife
YellowAfterlife / discord-compact.user.js
Created December 10, 2021 18:37
Replaces the "help" button with a button to toggle left sidebar, like so https://i.imgur.com/JsTp0pu.jpg
// ==UserScript==
// @name Discord: compact checkbox
// @namespace https://yal.cc
// @version 0.2
// @description try to take over the world!
// @author YellowAfterlife
// @match https://discord.com/*
// @grant none
// ==/UserScript==
@YellowAfterlife
YellowAfterlife / config.json
Created March 6, 2021 17:49
An example of making custom syntax extensions for GMEdit. This collapses `//hello` in a file to `//hi` in editor and back.
{
"name": "synext",
"description": "",
"scripts": ["synext.js"],
"stylesheets": []
}