Skip to content

Instantly share code, notes, and snippets.

View jgranick's full-sized avatar

Joshua Granick jgranick

View GitHub Profile
@jgranick
jgranick / LessVerbose.hx
Created April 16, 2012 16:02
A quick contrast of code styles
class MyCoolClass {
var message:String;
var total:Float;
public function new () {
var hello = combineText ("H", "ello");
var world = combineText ("W", "orld");
@jgranick
jgranick / (Auto-Generated) B2Vec2.hx
Created May 15, 2012 18:23
Initial working example of BuildHX C++ bindings
package box2d.common.math;
#if cpp
import cpp.Lib;
#elseif neko
import neko.Lib;
#end
@jgranick
jgranick / README.md
Created August 8, 2012 22:44
How to setup Cordova support for NME

Install NME

First, go to http://www.haxenme.org/download and install NME.

Development Builds

Since Cordova support is a beta feature, we will continue to improve NME's support of Cordova over time. If you want, you can get the latest development build here:

@jgranick
jgranick / TestJS.hx
Created August 9, 2012 18:39
"Hello World" in Haxe/Javascript
class TestJS {
static function main () {
trace ("Hello World");
}
}
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 16:52
How to send messages to and from a thread (NME recipe)
import cpp.vm.Thread;
import nme.display.Sprite;
import nme.Lib;
class ThreadingExample extends Sprite {
public function new () {
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 17:00
How to send messages between child threads (NME recipe)
import cpp.vm.Thread;
import nme.display.Sprite;
import nme.Lib;
class ThreadingExample extends Sprite {
public function new () {
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 17:15
How to share a Deque object between child threads (NME recipe)
import cpp.vm.Deque;
import cpp.vm.Thread;
import cpp.Sys;
import nme.display.Sprite;
import nme.Lib;
class ThreadingExample extends Sprite {
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 17:32
How to set and retrieve the same value between threads (NME recipe)
import cpp.vm.Mutex;
import cpp.vm.Thread;
import nme.display.Sprite;
import nme.Lib;
class ThreadingExample extends Sprite {
public function new () {
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 19:05
How to make a background worker thread (NME recipe)
import com.eclecticdesignstudio.motion.Actuate;
import cpp.vm.Thread;
import nme.display.Sprite;
import nme.events.Event;
import nme.Lib;
class ThreadingExample extends Sprite {
@jgranick
jgranick / TestNME.hx
Created September 2, 2012 20:43
Color transform
package;
import com.eclecticdesignstudio.motion.Actuate;
import nme.display.Sprite;
class TestNME extends Sprite {