Skip to content

Instantly share code, notes, and snippets.

View squeedee's full-sized avatar
💃
Choreographer to the stars!

Rasheed Abdul-Aziz squeedee

💃
Choreographer to the stars!
View GitHub Profile
private function configureUnallocatedDataModel():void {
injector.mapSingleton(UnallocatedJobModel);
// a new injector context, already has it's parentInjector set
var loInjector:IInjector = injector.createChild();
// get the configuration for LO mapping...
var loRule:InjectionConfig = injector.mapClass(ListObserver,ListObserver);
// ...so that we can configure the maping to use the new child injector...
package com.visfleet.maps.events.refresh {
import flash.events.Event;
public class StartRefreshesEvent extends Event {
public static const START:String = "startRefreshesEvent";
public function StartRefreshesEvent() {
super(START);
}
package com.visfleet.robotlegs {
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import org.robotlegs.base.ContextEvent;
import org.robotlegs.core.IMediatorMap;
import org.robotlegs.mvcs.Actor;
public class Presenter extends Actor {
<?xml version="1.0"?>
<s:ItemRenderer
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:vo="com.visfleet.radiator.vo.*"
>
<fx:Declarations>
<vo:JobVO id="jobVO" />
</fx:Declarations>
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
trustctime = false
autocrlf = false
@squeedee
squeedee / LoggingCommandMap.as
Created August 1, 2010 20:58
Really Helpful commandMap logging for your Robotlegs apps
package com.visfleet.robotlegs {
import com.visfleet.core.isNotNull;
import flash.events.Event;
import flash.events.IEventDispatcher;
import mx.logging.ILogger;
import mx.logging.Log;
@squeedee
squeedee / Grafix.as
Created August 25, 2010 19:56
Decorator for the Graphics class and a sample implementation
package com.visfleet.util.datatypes {
import flash.display.Graphics;
import flash.geom.Matrix;
import flash.geom.Point;
public class Grafix extends GraphicsDecorator implements IGraphics {
private var _transforms:Array;
public function Grafix(graphics:Graphics) {

If i'm developing away, i often want to add 'Commands' in a conventional way so:

$ thor rl:command com.vf.SomeClass 

and i'll do this all day. Interesting note, rl:command also invokes vf:event to create an event for each command (unless told not to)

Someone says, hey we need a new module.. A module is a sub-app, so think it terms of a rails application generator.

$ thor rl:module moduleName
@squeedee
squeedee / CouchTarget.as
Created September 25, 2010 20:46
CouchDB Flex Logging Target
package com.visfleet.util {
import com.adobe.serialization.json.JSONDecoder;
import com.adobe.serialization.json.JSONEncoder;
import com.visfleetOld.iv.DateUtil;
import com.visfleetOld.iv.Invalidator;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestHeader;

Interfaces and Implementations

These are sometimes a special case for encodings. For example, say you are building an ABSTRACT FACTORY for the creation of shapes. This factory will be an interface and will be implemented by a concrete class. What should you name them? IShapeFactory and ShapeFactory? I prefer to leave interfaces unadorned. The preceding I, so common in today’s legacy wads, is a distraction at best and too much information at worst. I don’t want my users knowing that I’m handing them an interface. I just want them to know that it’s a ShapeFactory. So if I must encode either the interface or the implementation, I choose the implementation. Calling it ShapeFactoryImp, or even the hideous CShapeFactory, is preferable