Skip to content

Instantly share code, notes, and snippets.

Avatar

Dima Granetchi profelis

View GitHub Profile
@profelis
profelis / Makefile
Last active Feb 5, 2022
how to build hashlink on MacBook with M1/arm cpu
View Makefile
LBITS := $(shell getconf LONG_BIT)
MARCH ?= $(LBITS)
PREFIX ?= /usr/local
INSTALL_DIR ?= $(PREFIX)
INSTALL_BIN_DIR ?= $(PREFIX)/bin
INSTALL_LIB_DIR ?= $(PREFIX)/lib
INSTALL_INCLUDE_DIR ?= $(PREFIX)/include
LIBS=fmt sdl ssl openal ui uv mysql
@profelis
profelis / README.MD
Last active Feb 29, 2020
haxe + numba
View README.MD

Haxe + numba sample

$ haxe build.hxml

$ python testhx.py
Test.hx:28: 499999700005.0959
Test.hx:29: first calc, 0.20508950000000015
Test.hx:33: 499999700005.0959
Test.hx:34: second calc, 0.05553469999999994
@profelis
profelis / brew-cask-upgrade.sh
Created Jun 24, 2016 — forked from c00kiemon5ter/brew-cask-upgrade.sh
a portable shell script to upgrade cask packages
View brew-cask-upgrade.sh
#!/bin/sh
help=0
latest=0
verbose=0
status=0
usage() {
cat <<-EOF
${0##*/} [options]
View colorize-maven.sh
#!/bin/sh
# Written by Mike Ensor (mike@ensor.cc)
# Copywrite 2012
# Use as needed, modify, have fun!
# This is intended to be used for Maven3 + Mac OSX
#
# To use:
# in your ".bashrc" or ".bash_profile" add the following line:
# source ~/<path to script>/colorize-maven.sh
@profelis
profelis / HxWorker.hx
Last active Aug 29, 2015
Create flash Worker from single class (inspired by https://github.com/makc/worker-from-class)
View HxWorker.hx
package worker;
import flash.display.Sprite;
import flash.system.*;
import haxe.io.*;
import format.swf.*;
/**
* usage:
* -lib format
@profelis
profelis / ElvisReflect.hx
Last active Dec 24, 2015
ElvisReflect.hx
View ElvisReflect.hx
using haxe.macro.ExprTools;
import haxe.macro.Context;
import haxe.macro.Expr;
class ElvisReflect {
@:noUsing macro static public function fast(args:Array<Expr>) {
if (args.length == 0) return macro {};
function map(e:Expr):Expr {
@profelis
profelis / getField.hx
Last active Dec 19, 2015
ClassField -> Field
View getField.hx
function getField(field:ClassField):Field {
var typedExpr = field.expr();
var expr = typedExpr != null ? Context.getTypedExpr(typedExpr) : null;
var f = {
name: field.name,
doc: field.doc,
pos: field.pos,
meta: field.meta.get(),
kind: null,
@profelis
profelis / ElseMacros.hx
Created May 30, 2013
while () {} else {} for () {} else {}
View ElseMacros.hx
package ;
import haxe.macro.Expr;
/**
* ...
* @author deep <system.grand@gmail.com>
*/
class ElseMacros
{
@profelis
profelis / Measure.hx
Created May 30, 2013
Measure macros (Haxe 3)
View Measure.hx
package ;
#if macro
import haxe.macro.Context;
import haxe.macro.Expr;
#end
/**
* ...
* @author deep <system.grand@gmail.com>
*/
class Measure
@profelis
profelis / Stats.hx
Created Feb 3, 2013
h3d stats based on mrdoob stast.as. show Engine.drawTriangles, Engine.drawCalls and Engine.mem.stats()
View Stats.hx
/**
* stats.hx
* http://github.com/mrdoob/stats.as
*
* Released under MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* How to use:
*
* addChild( new Stats(engine) );