Skip to content

Instantly share code, notes, and snippets.

View MindScriptAct's full-sized avatar

Raimundas Banevicius MindScriptAct

View GitHub Profile
@MindScriptAct
MindScriptAct / button.html
Created February 11, 2012 02:15 — forked from Olical/button.html
Sleek CSS3 GitHub download button
<a href='https://github.com/USER/REPOSITORY/archives/master' class='download-button'>
Download
<span>Latest version from GitHub</span>
</a>
@MindScriptAct
MindScriptAct / ObjectHelper.as
Last active May 26, 2016 08:40
Class to clone deep AS3 objects preserve types.
package utils.data {
import flash.utils.describeType;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;
/**
* @author http://blog.another-d-mention.ro/programming/how-to-clone-duplicate-an-object-in-actionscript-3/,
* Modified by Raimundas Banevicius
*/
public class ObjectHelper {
@MindScriptAct
MindScriptAct / BasicTests.as
Last active December 14, 2015 15:38
AsyncUtil usage for AsUnit
package {
import flexunit.framework.Assert;
import utils.AsyncUtil;
/**
* COMMENT
*/
public class BasicTests {
private var asincFunction:Function;
@MindScriptAct
MindScriptAct / unitTestAsync
Last active December 14, 2015 15:38
FlashDevelop snippet - asinc test for AsUnit.
private var $$(feature)_asincFunction:Function;
[Test(async)]
public function $$(unit)_$$(feature)_$$(outcome=ok,fail)():void {
$$(feature)_asincFunction = AsyncUtil.asyncHandler(this, $$(feature)_callBack, [], 1000, $$(feature)_fail);
$$(feature)_asincFunction();
@MindScriptAct
MindScriptAct / arrayPermutationFunct
Created March 3, 2014 15:18
function to get all array member permutations.
public static function permutate(elements:Array):Array {
var retVal:Array = new Array();
var elementCount:int = elements.length;
var doSearch:Boolean = true;
var indexVector:Vector.<int> = new Vector.<int>(elementCount);
var headIndex:int = 0;
while (doSearch) {
// set up initial data
var tempCards:Vector.<CardVO> = new <CardVO>[];
@MindScriptAct
MindScriptAct / Enum.as
Created October 5, 2014 13:22
Enum for as3
package utils.types {
import flash.utils.describeType;
public class Enum {
// USAGE:
//package myProject.constants {
//import utils.types.Enum;
//public class ScreenIdEnum {
// {Enum.init(ScreenIdEnum);}
@MindScriptAct
MindScriptAct / SecureInt
Last active August 29, 2015 14:13
Int data, protected from simple memory editors.
package utils {
public class SecureInt {
private var _value:int;
private var tempVal:IntValueObject;
public function SecureInt(initValue:int = 0) {
this.value = initValue;
}
public function set value(value:int):void {
@MindScriptAct
MindScriptAct / SecureUint
Created January 9, 2015 14:46
Uint data, protected from simple memory editors.
package utils {
public class SecureUint {
private var _value:uint;
private var tempVal:UintValueObject;
public function SecureUint(initValue:uint = 0) {
this.value = initValue;
}
public function set value(value:uint):void {
/**
* Created by Raimundas Banevicius on 8/15/2016.
*/
package utils.text {
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
public class TextHelper {
package {
import flash.utils.Dictionary;
/**
* Contains country codes and names.
*/
public class Country {
public static var allCountries:Dictionary = new Dictionary();
{