Skip to content

Instantly share code, notes, and snippets.

View jgranick's full-sized avatar

Joshua Granick jgranick

View GitHub Profile
@jgranick
jgranick / install-haxe.sh
Last active September 3, 2023 15:47
Haxe Linux install script
#!/bin/sh
HAXE_VERSION=3.2.1
NEKO_VERSION=2.0.0
if [ `uname -m` = "armv7l" ]; then
HAXE_VERSION=3.1.3
@jgranick
jgranick / gist:1763850
Created February 8, 2012 01:05
NMML File Specification
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- <meta />
Use meta nodes to set metadata for your application. The description is ignored
on most targets, but is useful for packaging like Chrome Apps or Opera Widgets.
For compatibility with Android and webOS, the package name must include at least
@jgranick
jgranick / ScreenResize.hx
Created February 7, 2012 21:39
How to dynamically handle different screen sizes (NME recipe)
import nme.display.Sprite;
import nme.display.StageAlign;
import nme.display.StageScaleMode;
import nme.Lib;
/**
* @author Joshua Granick
*/
class ScreenResize extends Sprite {
@jgranick
jgranick / ConditionalCompilation.hx
Created February 9, 2012 16:59
How to use conditional compilation (NME recipe)
import nme.display.Sprite;
/**
* @author Joshua Granick
*/
class ConditionalCompilation extends Sprite {
public function new () {
@jgranick
jgranick / MineHX.hx
Created February 7, 2012 21:24
How to switch graphics based on screen density (NME recipe)
package com.eclecticdesignstudio.minehx;
import nme.display.Sprite;
import nme.system.Capabilities;
import nme.Assets;
/**
* ...
@jgranick
jgranick / .htaccess
Last active June 3, 2019 14:19
SimpleGL
SetOutputFilter DEFLATE
@jgranick
jgranick / install-haxe.sh
Last active April 17, 2019 18:38
Install Haxe using a development release for 64-bit Linux
#!/bin/sh
# Install Haxe using a development release for 64-bit Linux
HAXE_VERSION=haxe_2019-04-01_development_bbfe5ac
NEKO_VERSION=2.2.0
if [ "$1" = "y" -o "$1" = "-y" ]; then
echo "Do you want to install Haxe $HAXE_VERSION and Neko $NEKO_VERSION? (y/n) y"
@jgranick
jgranick / flashplayerdebugger.sh
Created March 2, 2019 00:25
Flash Player install script for Linux
#!/bin/sh
echo ""
echo "-----------------------------------"
echo " Installing Flash Debugger"
echo "-----------------------------------"
sudo echo ""
@jgranick
jgranick / gist:026efc8addaf6cbca353
Created July 29, 2014 05:06
Basic Lime/OpenAL sample
//var bytes = Assets.getBytes ("soundTheme");
//var sound = lime.audio.Sound.loadFromBytes (bytes);
var sound = lime.audio.Sound.loadFromFile ("sounds/theme.ogg");
var format = 0;
if (sound.channels == 1) {
if (sound.bitsPerSample == 8) {
git clone https://github.com/openfl/starling
cd starling
git reset --hard 0306c8625df7bb4b183ca5ca104b33091f814436
cd samples/demo_npm/as3
npm install
npm start