Skip to content

Instantly share code, notes, and snippets.

@ruby0x1
ruby0x1 / luxe-alpha-2.0-changes.md
Created April 27, 2015 17:50
luxe-alpha-2.0 initial work

Parcel:

  • new Parcel implementation
  • update options and creation options for all new resource types and settings
  • initial work toward parcel diff loading
  • add parcel event endpoints, for progress, complete, failed events
  • added ParcelChange type for information on progress or failure events
  • added length properties for counting resources
  • added state, for unloaded loading loaded
  • added listed which returns an array of resource id's in the parcel
  • added loaded which returns an array of resource id's that are loaded by this parcel
@ruby0x1
ruby0x1 / Test.hx
Last active August 29, 2015 14:19
Write luxe pixels from GL framebuffer as RGB to a raw file
import snow.api.buffers.Uint8Array;
import snow.modules.opengl.GL;
//....
override function onkeyup( e:KeyEvent ) {
if(e.keycode == Key.key_h) {
@ruby0x1
ruby0x1 / main.cpp
Last active January 4, 2019 21:09
SDL2 sample
//SDL2 flashing random color example
//Should work on iOS/Android/Mac/Windows/Linux
#include <SDL.h>
#include <SDL_opengl.h>
#include <stdlib.h> //rand()
static bool quitting = false;
static float r = 0.0f;
@ruby0x1
ruby0x1 / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ruby0x1
ruby0x1 / Random.hx
Last active August 29, 2015 14:17
Random.hx
package ;
//Adapted from code by Grant Skinner, see bottom of file.
//This is cut from https://github.com/underscorediscovery/luxe under MIT license
/**
Given an `initial` value for the seed, subsequent generated numbers will be predictable,
and the `seed` value updated to reflect the current seed which can be used to resume predictability
from an ongoing set. Uses a Park–Miller pseudo random number generator.
> haxelib run haxelibcounter
HaxelibCounter.hx:69: haxelibcounter
HaxelibCounter.hx:76: > found args { any => true, length => 0, valid => [], invalid => [{ name => /Users/sven/dev/haxe-entry-point-example/, value => }] }
HaxelibCounter.hx:69: usage:
HaxelibCounter.hx:69: --count | displays the number of haxelib libraries installed
HaxelibCounter.hx:69: --show-names | must be specified with --count, lists installed haxelibs one per line
@ruby0x1
ruby0x1 / URLUtil.hx
Created February 18, 2015 13:24
Example android JAR utility written in haxe
// http://notes.underscorediscovery.com/haxe-from-1000ft
import android.util.Log;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.net.Uri;
import android.content.Intent;
@:nativeGen
class Basic {
static function main() {
trace('basic example');
}
}
@ruby0x1
ruby0x1 / thisisnotcss.css
Created January 28, 2015 19:13
stay example
base width will expand,
because of the last rule,
and not clamp to 100 from the second
:base {
left: >= 100;
width: >= 100;
right: screen.right;
}
@ruby0x1
ruby0x1 / test.mint.css
Last active August 29, 2015 14:14
mint file markup and layout example
/*
notes :
- set to css for highlighting only, does not equate to css.
- wip, etc
----
control markup
----
*/