Skip to content

Instantly share code, notes, and snippets.

View liekkas's full-sized avatar
🎯
Focusing

liekkas liekkas

🎯
Focusing
View GitHub Profile
var MyApp = angular.module('MyApp');
MyApp.factory('msgBus', ['$rootScope', function($rootScope) {
var msgBus = {};
msgBus.emitMsg = function(msg, data) {
data = data || {};
$rootScope.$emit(msg, data);
};
msgBus.onMsg = function(msg, func, scope) {
var unbind = $rootScope.$on(msg, func);
if (scope) {
@liekkas
liekkas / Polygon.as
Created April 21, 2012 10:04 — forked from PrimaryFeather/Polygon.as
A custom display object for Starling, rendering a regular n-sided polygon.
package utils
{
import com.adobe.utils.AGALMiniAssembler;
import flash.display3D.*;
import flash.geom.*;
import starling.core.RenderSupport;
import starling.core.Starling;
import starling.display.DisplayObject;