Skip to content

Instantly share code, notes, and snippets.

View mbolt35's full-sized avatar
:octocat:
Code, code, code...

Matt Bolt mbolt35

:octocat:
Code, code, code...
View GitHub Profile
@mbolt35
mbolt35 / Foo.coffee
Created May 1, 2012 14:53
CoffeeScript Global Class
# Defining a class globally can be done like this:
class Foo
constructor: (@name) ->
this.Foo = Foo;
# Or like this...
this.Foo = class Foo
constructor: (@name) ->
@mbolt35
mbolt35 / ArrayClass.cpp
Created April 24, 2012 01:48
Vector Dynamic Memory Allocation
// Allocation for Array
ArrayObject* ArrayClass::newarray(Atom* argv, int argc)
{
ArrayObject *inst = newArray(argc);
for (uint32 i=0; i<uint32(argc); i++) {
inst->setUintProperty(i, argv[i]);
}