Skip to content

Instantly share code, notes, and snippets.

package;
/**
* Xorshift preudorandom number generator for Haxe.
* Reference: http://en.wikipedia.org/wiki/Xorshift
*/
class Xorshift
{
inline public static var INT_MAX:Int = 0x7FFFFFFF; // (2^31 - 1)
inline public static var INT_MAXPLUSONE:Float = 2147483648.0;
@zoon
zoon / gist:700314
Created November 15, 2010 12:53
Unity3D Input: OnGUI vs.Update.
using System.Threading;
using UnityEngine;
// [ExecuteInEditMode]
public class InputTest : MonoBehaviour
{
private float _delay;
private float _fps;
private float _fpsTime;
private void Start()
{
_mousePositions = new Vector2[TimeFliesLikeAnArrow.Length];
for (var i = 0; i < _mousePositions.Length; i++)
{
var ii = i;
_subscriptions.Add(
// Magic happens here:
RxHost.Instance.GUIEvents
.Where(e => e.type == EventType.mouseMove)
[[
01234567890123456789012345678901234567890123456789012345678901234567890123456789
]]
-- NOTE: requires 'LPEG' module
local re = require're'
local assert = assert
local min, max = math.min, math.max
-- PEG Grammar 1: