Skip to content

Instantly share code, notes, and snippets.

View alijaya's full-sized avatar

Ali Jaya Meilio alijaya

View GitHub Profile
@alijaya
alijaya / GetShapeArea.jsx
Last active November 9, 2021 19:10 — forked from bryanbuchanan/GetShapeArea.jsx
Script to find the area of shapes in Adobe Illustrator
/* Save this file with a jsx extension and place in your
Illustrator/Presets/en_US/Scripts folder. You can then
access it from the File > Scripts menu */
var decimalPlaces = 3;
function calculateArea (obj) {
if (obj.typename == "PathItem") {
return obj.area; // could be negative
} else if (obj.typename == "CompoundPathItem") {
@alijaya
alijaya / easing.hx
Last active August 29, 2015 14:12 — forked from anonymous/easing.hx
import flash.display.Sprite;
import flash.Lib;
class Test {
static function linear(t:Float) : Float return t;
static function quad(t:Float) : Float return t * t;
static function cubic(t:Float) : Float return t * t * t;
static function quart(t:Float) : Float return t * t * t * t;
static function quint(t:Float) : Float return t * t * t * t * t;
static function poly(t:Float, p:Float=2.0) : Float return Math.pow(t, p);
@alijaya
alijaya / slicingbitmap
Last active December 18, 2015 21:09 — forked from anonymous/slicingbitmap
var bd = Assets.getBitmapData("img/sumachan.png");
var temp:BitmapData = new BitmapData(300, 300, true, 0);
temp.copyPixels(bd, new Rectangle(0, 0, 300, 300), new Point(0, 0));
var data:Data = Tools.build32ARGB(temp.width, temp.height, Bytes.ofData(temp.getPixels(temp.rect)));
var bo:BytesOutput = new BytesOutput();
var writer:Writer = new Writer(bo);
writer.write(data);
var byteArray:ByteArray = bo.getBytes().getData();