Skip to content

Instantly share code, notes, and snippets.

View AxGord's full-sized avatar
🦄
Pony

Alexander Gordeyko AxGord

🦄
Pony
View GitHub Profile
@Yanrishatum
Yanrishatum / hxsl-cheatsheet.md
Last active October 6, 2023 12:55
HXSL cheat-sheet

HXSL cheat-sheet

This is a WIP of a cheat-sheet that I will finish Eventually™

Types

Mapping of the shader types to Heaps types:

Float = Float
Int = Int
Bool = Bool
@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};
@qti3e
qti3e / README.md
Last active April 13, 2024 15:50
List of file signatures and mime types based on file extensions
@clarkjones
clarkjones / HaxeScript.hx
Last active July 12, 2018 19:55 — forked from jasononeil/HaxeScript.hx
haxex, a short shell script that can be used so you have Haxe shell scripting
#!/usr/bin/env haxex -lib mcli @
/**
Taken from mcli example https://github.com/waneck/mcli
Say hello.
Example inspired by ruby's "executable" lib example
**/
class HaxeScript extends mcli.CommandLine
{
/**
@nadako
nadako / 1 Main.hx
Created February 18, 2014 22:19
Using haxe macros as syntax-tolerant, position-aware json parser
import haxe.macro.Context;
import haxe.macro.Expr;
using haxe.macro.ExprTools;
class Main
{
inline static var QUOTED_FIELD_PREFIX = "@$__hx__";
static function main()
@nadako
nadako / Const.hx
Created February 14, 2014 11:06
@:genericBuild read-only type builder
@:genericBuild(ConstMacro.build())
class Const<T> {}
@nadako
nadako / Main.hx
Created January 19, 2014 13:29
stack-allocated pair iterator
class Main
{
static function main()
{
var a = ["a", "b", "c"];
for (p in new IndexIter(a))
{
trace(p.idx);
trace(p.val);
@nadako
nadako / DynamicMap.hx
Last active January 2, 2016 22:29
Abstract wrapper for Dynamic objects.
/**
* Simple wrapper for anonymous structures that are meant to be used as a
* keyed collection of objects of the same type (i.e. json object).
*
* Wraps Reflect calls with nice syntax and static typing without any
* runtime overhead.
*/
abstract DynamicMap<V>(Dynamic<V>) from Dynamic<V>
{
/**
@RealyUniqueName
RealyUniqueName / Exception.hx
Created November 28, 2013 12:09
Simple exception class with stack information
package fst.exception;
import haxe.CallStack;
/**
* Exceptions base
*
*/
class Exception {
import haxe.macro.Expr;
class FTW
{
public static function build()
{
return haxe.macro.Context.getBuildFields().map(transformField);
}
static function transformField(field:Field)