Skip to content

Instantly share code, notes, and snippets.

package fx;
class Dither extends flixel.system.FlxAssets.FlxShader
{
@:glFragmentSource('
#pragma header
const float scale = 2.0;
float checker(vec2 coord)
@kLabz
kLabz / haxelsp.md
Last active April 18, 2019 12:54
Haxe + LSP + Neovim
@nadako
nadako / 1 Main.hx
Last active October 16, 2021 04:38
ocaml-like `with` for Haxe
using WithMacro;
typedef Player = {
final name:String;
final level:Int;
}
class Main {
static function main() {
var player = {name: "Dan", level: 15};
@haxiomic
haxiomic / Partial.hx
Last active February 26, 2023 11:44
Haxe macro to make all fields of a type optional (similar to Typescript's Partial<T>)
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.TypeTools;
#if !macro
@:genericBuild(PartialMacro.build())
#end
class Partial<T> {}
class PartialMacro {
package;
import flash.geom.Rectangle;
import flixel.FlxSprite;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.util.FlxDestroyUtil;
class CrookedText extends FlxSprite
{
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.ExprTools;
class ClassBuild{
//the entire contents of a class is contained in the class's fields
//a class-building-macro's job is to return an array of fields
static function saveClass():Array<Field>{
@nadako
nadako / Main.hx
Last active November 27, 2020 16:08
Signal builder using new Rest type parameter in Haxe
class Main {
static function main() {
var signal = new Signal<Int,String>();
var conn = signal.connect(function(a, b) {
trace('Well done $a $b');
});
signal.dispatch(10, "lol");
}
}
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!