This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static var transform:Matrix = new Matrix(); | |
private static var transformInverse:Matrix = new Matrix(); | |
private static var path:Vector.<DisplayObject> = new Vector.<DisplayObject>(); | |
public static function localToLocal(source:DisplayObject, target:DisplayObjectContainer = null, objChildOfTarget:Boolean = true):void | |
{ | |
if (target == null || source == null) return; | |
transform.identity(); | |
transform.copyFrom(source.transformationMatrix); | |
var parent:DisplayObject = source as DisplayObject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var glob = require('glob'); | |
var path = require('path'); | |
var browserify = require('browserify'); | |
var source = require('vinyl-source-stream'); | |
var transform = require('vinyl-transform'); | |
var exorcist = require('exorcist'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var argv = require('yargs').argv; | |
var watchify = require('watchify'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Parses dates that conform to the xs:DateTime format. */ | |
public static function parse(str : String) : Date { | |
if (str == null) return null; | |
var finalDate : Date; | |
try { | |
var dateStr : String = str.substring(0, str.indexOf("T")); | |
var timeStr : String = str.substring(str.indexOf("T") + 1, str.length); | |
var dateArr : Array = dateStr.split("-"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# full status | |
s = !git status -sb --ignore-submodules=dirty && git submodule foreach --recursive git status -sb --ignore-submodules=dirty | |
# updates project and all submodules | |
up = !git submodule foreach --recursive git pull --rebase && git pull --rebase | |
# updates and creates all submodules (can move sumbmodules from there brunches) | |
subup = submodule update --init --recursive | |
# fetches all modules | |
rfetch = !git fetch && git submodule foreach --recursive git fetch | |
# mergeBranch(from, to) e.g. git bft master next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.utils.getTimer; | |
public class MethodClosureTest extends Sprite { | |
public function MethodClosureTest() { | |
addEventListener(Event.ENTER_FRAME, onEnterFrame); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import starling.extensions.sap.ParticleEffect; | |
import starling.extensions.sap.ParticlePrototype; | |
import starling.extensions.sap.ParticleTextureAtlas; | |
import flash.display3D.Context3DBlendFactor; | |
import flash.geom.Vector3D; | |
import flash.utils.setTimeout; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function generateOrientationTexture(size:int):BitmapData { | |
var half:uint = size / 2; | |
var bmd:BitmapData = new BitmapData(size, size, false, 0x000000); | |
for (var i:uint = 0; i < size; i++) { | |
for (var j:uint = 0; j < size; j++) { | |
var directionX:Number = i - half; | |
var directionY:Number = j - half; | |
var length:Number = Math.sqrt(directionX * directionX + directionY * directionY); | |
directionX /= length; | |
directionY /= length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// | |
//Time: | |
// | |
//0.195312 - All browsers with FlashPlayer 11.9 release http://i.imgur.com/0WrbiVP.png | |
//0.203 - exe compiled with MSVC in release http://i.imgur.com/9aUm4TZ.png | |
// | |
//Download swf - https://www.dropbox.com/s/0vwvvo04d179gef/speedTest.swf | |
// | |
//Compile in Crossbridge /cygdrive/c/flascc/sdk/usr/bin/g++.exe speedTest.cpp -O4 -emit-swf -o speedTest.swf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sstream> | |
#include <thread> | |
#include <cstdio> | |
#include <cstdarg> | |
#include <cwchar> | |
#include <cstdlib> | |
#include <windows.h> | |
struct DebugOutImpl { | |
DebugOutImpl(const char* location, int line, bool enabled_ = true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flash.display.Sprite; | |
import flash.text.TextField; | |
import flash.text.TextFieldAutoSize; | |
import flash.utils.getTimer; | |
public class ConditionTest extends Sprite { | |
public function ConditionTest() { | |
testTime(); |