Skip to content

Instantly share code, notes, and snippets.

View trxcllnt's full-sized avatar

Paul Taylor trxcllnt

View GitHub Profile
package org.puremvc.as3.multicore.utilities.lazy.interfaces
{
import flash.events.IEventDispatcher;
public interface IFacadeAdapter
{
function getFQCN(clazz:Class):QName;
function startup(eventBus:IEventDispatcher, startupCommandClass:Class = null, autoMediateCommandClass:Class = null):void;
}
}
package org.robotlegs.variance
{
public interface IPackageFilters
{
/**
* Registers a package name to check against in <code>applyFilters()</code>.
*
* @see IPackageFilters#applyFilters
*/
function registerPackageFilter(packageFilter:String):void;
@trxcllnt
trxcllnt / Main.as
Created May 24, 2011 05:55
Functional and modular text layout algorithm shell.
package
{
import flash.display.*;
import flash.text.engine.*;
import org.tinytlf.layout.*;
import org.tinytlf.layout.properties.LayoutProperties;
import org.tinytlf.util.fte.ContentElementUtil;
[SWF(width="500", height="300")]
@trxcllnt
trxcllnt / WhateverService.as
Created July 26, 2011 20:13
Asynchronous service example with signals as promises enabling functional and fluent API interaction.
package
{
public class MyService
{
[Inject]
public var session:ISession;
private var startedSignal:ISignal;
public function startMyService():ISignal
{
@trxcllnt
trxcllnt / CSS.as
Created August 21, 2011 22:22
A small CSS parser in AS3. Part of tinytlf 2.0.
package org.tinytlf.html
{
import flash.utils.getTimer;
import org.tinytlf.*;
public class CSS extends Styleable
{
[Embed(source = "default.css", mimeType = "application/octet-stream")]
private const defaultCSS:Class;
package
{
import embeds.*;
import flash.display.*;
import org.swiftsuspenders.*;
import org.tinytlf.*;
import org.tinytlf.html.*;
import org.tinytlf.util.TagSoup;
@trxcllnt
trxcllnt / OnlineConcaveMinima.coffee
Created December 1, 2011 22:07
A JS port of the ConcaveMinima algorithm from D. Eppstein (http://www.ics.uci.edu/~eppstein/PADS/SMAWK.py)
class OnlineConcaveMinima
values = []
indices = [0]
finished = 0
matrix = (i, j) -> 0
base = 0
tentative = 0
fs = require 'fs'
path = require 'path'
{exec} = require 'child_process'
# Make sure we have our dependencies
try
colors = require 'colors'
coffee = require 'coffee-script'
browserify = require 'browserify'
catch error
@trxcllnt
trxcllnt / combineLatest-tricks.coffee
Created January 25, 2013 20:55
combineLatest, merge, expand
merge = [].concat
expand = (fn, context) -> (args) -> fn.apply context, args.slice 0, fn.length
obs1 = Rx.Observable.returnValue(1)
obs2 = Rx.Observable.returnValue(2)
obs3 = Rx.Observable.returnValue(3)
combined = obs1.combineLatest(obs2, merge).combineLatest(obs3, merge)
combined.subscribe expand (o1, o2, o3) -> o1 + o2 + o3
package org.tinytlf.fn
{
import raix.interactive.toEnumerable;
/**
* @author ptaylor
*/
public function pipe(...functions):Function {
return function(...args):* {
return toEnumerable(functions).reduce(args, function(args:Array, func:Function):Array {