Skip to content

Instantly share code, notes, and snippets.

View darscan's full-sized avatar

Shaun Smith darscan

  • United Kingdom
View GitHub Profile

Snyk SBT Plugin tool contributor agreement

This Snyk SBT Plugin tool Agreement (this "Agreement") applies to any Contribution you make to any Work.

This is a binding legal agreement on you and any organization you represent. If you are signing this Agreement on behalf of your employer or other organization, you represent and warrant that you have the authority to agree to this Agreement on behalf of the organization.

1. Definitions

"Contribution" means any original work, including any modification of or addition to an existing work, that you submit to Snyk SBT Plugin tool repo in any manner for inclusion in any Work.

@darscan
darscan / Invalidator.as
Created June 27, 2013 16:00
Flex-like Invalidator
package robotlegs.bender.framework.impl
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.IEventDispatcher;
public class Invalidator
{
private var commit:Function;
@darscan
darscan / bmi.js
Created June 12, 2013 20:04 — forked from mjtko/bmi.js
var bmi_htmlEdit = 0;
var bmi_ie;
var bmi_ns;
var bmi_safari;
var bmi_imageObjSelected;
var bmi_ffx_op_toolTip = "Shift+R improves the quality of this image. Shift+A improves the quality of all images on this page.";
var bmi_toolTip = "Shift+R improves the quality of this image. CTRL+F5 reloads the whole page.";
var bmi_ns_tooltip = "Shift+Reload reloads the whole page.";
var bmi_toolTipSeperator = " ... ";
var bmi_concatStr = "bmi_orig_img";
package async
{
public class Deferred implements Promise
{
private const pending:Array = [];
private var processed:Boolean;
private var completed:Boolean;
@darscan
darscan / gist:2793564
Created May 26, 2012 11:22
AS3 Logical OR
// In AS3
a ||= value;
// is shorthand for:
if (a == false) { // 1: Tests truthiness, not strict null
a = value;
} else {
a = a; // 2: Will reassign
@darscan
darscan / vagrant.org
Created May 5, 2012 23:56
CentOS Box for Vagrant
@darscan
darscan / gist:2243929
Created March 29, 2012 21:21
meta name=viewport
<meta name="viewport" content="width=device-width, initial-scale=1.0,
minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,
target-densitydpi=device-dpi"/>
@darscan
darscan / dynamic_class.rb
Created March 8, 2012 13:00
Dynamically adding class methods
# I want to add DynamicClass.some_method, not DynamicClass.new.some_method, so..
class DynamicClass
@@syms = []
def self.metaclass
class << self; self; end
end
def self.add_method(sym)
@@syms.push(sym) unless @@syms.include?(sym)
metaclass.instance_eval do
@darscan
darscan / AOPTest.as
Created December 30, 2011 17:27 — forked from nodename/AOPTest.as
Interesting use of 'finally' to slip some code in before a function returns
// originally from Andy Shang http://bbs.9ria.com/viewthread.php?tid=47399
package
{
import flash.display.Sprite;
public class AOPTest extends Sprite
{
public function AOPTest()
{
@darscan
darscan / gist:1213863
Created September 13, 2011 13:58
InjectingMediators
A view Class to mediator Class mapping means that there may be multiple mediator instances for a given view type. How would RL know which instance to inject?
mediatorMap.mapView(SomeView, SomeMediator);
..
addChild(new SomeView());
addChild(new SomeView());
addChild(new SomeView());
..
[Inject]
public var view:SomeMediator; // which one of the 3 mediator instances should we inject? it makes no sense.