Skip to content

Instantly share code, notes, and snippets.

View louisbl's full-sized avatar

Louis Beltramo louisbl

  • Annecy
View GitHub Profile
package com.onavo.android.common.ui;
import android.view.View;
import android.view.ViewGroup;
import java.util.LinkedList;
import java.util.List;
/**
* Based on http://stackoverflow.com/a/8831593/37020 by by Shlomi Schwartz
package ;
abstract JsonMap<T>({ }) from {} {
public function new() this = {};
public function exists(key:String) return Reflect.hasField(this, key);
public function get(key:String) return Reflect.field(this, key);
public function set(key:String, value:T) Reflect.setField(this, key, value);
public function keys():Array<String> return Reflect.fields(this);
public function remove(key:String) return Reflect.deleteField(this, key);
public function iterator():Iterator<T> {
@louisbl
louisbl / Stats.hx
Last active December 14, 2015 04:39 — forked from profelis/Stats.hx
H3D engine Stats
/**
* 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) );
@louisbl
louisbl / robot.js
Created December 6, 2012 16:11 — forked from f6p/robot.js
DumberZero
// helpers
function areEnemies(robot, sighted) {
var sightedIsChild = (robot.id == sighted.parentId);
var sightedIsParent = (robot.parentId == sighted.id);
return !(sightedIsChild || sightedIsParent);
};
function baseStep(robot) {
@louisbl
louisbl / gist:3832164
Created October 4, 2012 08:17 — forked from tynril/gist:3276916
Patch for HXCPP (r559) to disable buffering on standard out (fixes the issue regarding traces displayed at process exit)
Index: include/hx/StdLibs.h
===================================================================
--- include/hx/StdLibs.h (revision 559)
+++ include/hx/StdLibs.h (working copy)
@@ -32,6 +32,7 @@
void __hxcpp_print(Dynamic &inV);
void __hxcpp_println(Dynamic &inV);
void __trace(Dynamic inPtr, Dynamic inData);
+void __hxcpp_stdlibs_boot();