Skip to content

Instantly share code, notes, and snippets.

View squeedee's full-sized avatar
🚛
Supply Chain Specialist

Rasheed Abdul-Aziz squeedee

🚛
Supply Chain Specialist
View GitHub Profile
source :rubygems
gem 'rjb', :platforms => [:ruby]
#gem 'buildr-as3', :git => "git://github.com/devboy/buildr_as3.git", :ref => "f9576fc8eba5121e92d7765fe9675410abeca6b5"
gem 'buildr-as3', :path => "/Users/rasheed/Documents/buildr_as3"
require 'buildr/as3'
# We really do need a lot of heap
ENV['JAVA_OPTS'] ||= '-Xms1g -Xmx1g'
common_layout = Layout.new
common_layout[:source, :main, :as3] = 'src'
common_layout[:source, :test, :as3] = 'test'
@squeedee
squeedee / iAskYou.hs
Created July 20, 2011 09:53
Dunno how to execute a naked expression inside a script yet
firstWord x = [x !! 2,x !! 6, x !! 8]
lastWordIndex x = (length x) - 4
lastWord x = init (drop (lastWordIndex x) x)
sentence x = (firstWord x) ++ " " ++ (lastWord x)
sentence "Why the snideness sir?"
require 'flex_compiler'
require 'flex_analyzer'
class VworkCommon < Thor
include FlexCompiler
include FlexAnalyzer
artifact :swc, "vwork_common.swc"
artifact :test_swf, "TEST_vwork_common.swf"
public function add(handlerType:Class):InstanceHandlerCollection {
var handler:* = instanceClass(handlerType);
var added:Boolean;
added = addBeforeHandler(handler);
added ||= addAfterHandler(handler);
if (!added)
throw new NotAnInstanceHandlerError(handlerType);
@squeedee
squeedee / Modelling.markdown
Created July 4, 2011 20:51
Skeleton of a RL chap

Modelling your application

The reason MVC came into existence, was to seperate view logic and domain modelling. When you model your application domain, you naturally are aware of how poeple may use your application, however if you can distinguish between the display of information, accepting user input, and the actual logic/state that binds your application together, then you do not have to change large amounts of one to satisfy changes to the other.

[Further reading: Fowler history of MVC]

Robotlegs simplifies the seperation of view and domain modelling.

package com.visfleet.vWork.modules.map.controller.configuration.commands {
public class ConfigureHoverModelCommands extends Command {
[Inject]
public var event:SequenceStepEvent;
override public function execute():void {
commandMap.mapEvent(OpenFlyoutForVOEvent.SET, OpenFlyoutForVOCommand, OpenFlyoutForVOEvent);
commandMap.mapEvent(CloseFlyoutForVOEvent.CLEAR, CloseFlyoutForVOCommand, CloseFlyoutForVOEvent);
<testsuite errors="0" failures="0" name="Worker Selection" tests="0" time="0.049817"> </testsuite>
lib/buildr/as3/compiler
base.rb
module Buildr
module As3
module Compiler
class Base < Buildr::Compiler::Base
end
end
end
@squeedee
squeedee / gist:912891
Created April 11, 2011 00:20
Yucky find_by_sql
user system total real
Sequel 13.810000 4.800000 18.610000 ( 27.503995)
Sequel Eager Loaded 2.170000 2.370000 4.540000 ( 4.960289)
AR 12.470000 4.440000 16.910000 ( 24.182770)
AR Eager Loaded 5.520000 0.000000 5.520000 ( 5.556822)
Sequel No-Models 2.090000 3.720000 5.810000 ( 6.506667)
AR Find By SQL 26.000000 6.690000 32.690000 ( 55.647988)
AR Direct SQL 0.520000 0.020000 0.540000 ( 0.684972)