Skip to content

Instantly share code, notes, and snippets.

View devboy's full-sized avatar

Dominic Graefen devboy

View GitHub Profile
@devboy
devboy / Rakefile.rb
Created June 9, 2011 11:57
rake test
desc "a"
task :a do
system "tree"
system "git status"
end
desc "b"
task :b => :a do
system "ls"
end
@devboy
devboy / gator_config.rb
Created July 1, 2011 14:30
Gator - Example configuration
#This file has been generated by gator and wants to be edited by you!
Gator.project = Gator::Project.new "gator"
Gator.project.layout[:source,:main,:ruby] = "lib"
Gator.project.layout[:source,:test,:ruby] = "test"
puts Gator.project.path(:source,:main,:ruby)
@devboy
devboy / buildfile.rb
Created July 13, 2011 09:23
Example buildfile with modules depending on each other
require "buildr/as3"
FLEX_SDK = FlexSDK.new("4.5.0.20967")
define "BuildingModules" do
project.version = "0.0.0"
define "Application" do
compile.using :mxmlc
@devboy
devboy / yield.rb
Created August 21, 2011 15:54
Does anyone know why block_given? always returns false?
class Configuration
def create_method(name, &block)
self.class.send(:define_method, name, &block )
end
def add_configuration(name)
create_method "#{name.to_s}=" do |val|
instance_variable_set("@#{name}",val)
end
@devboy
devboy / Test.as
Created September 7, 2011 12:41
Wondering why this code throws no error at: changeValue("e");
package
{
import flash.display.Sprite;
public class Test extends Sprite
{
public function Test()
{
var a:Value = new Value();
@devboy
devboy / sandbox.rb
Created October 6, 2011 16:56
Don't you just love ruby
module Sandbox
end
class App
def initialize
app = self
Sandbox.class.send(:define_method, :app) do
puts app
end
Sandbox.app
class Node
private
_upstream/_parents: Vector.<Node>
_downstream/_children: Vector.<Node>
end
@devboy
devboy / instanceMixins.rb
Created October 29, 2011 15:00
Mixins on instances
class MyObject
def instanceMethod
"MyObject"
end
end
module MyMixin
def instanceMethod
"MyMixin"
end
@devboy
devboy / enum.hx
Created October 30, 2011 21:43 — forked from alecmce/enum.hx
Haxe Enum Example
enum MyEnum
{
first;
second;
third(param:MyParam);
}
class MyClass
{
private var _state:MyEnum;
@devboy
devboy / enum.hx
Created October 30, 2011 21:44 — forked from alecmce/enum.hx
Haxe Enum Example
enum MyEnum
{
first;
second;
third(param:MyParam);
}
class MyClass
{
private var _state:MyEnum;