Skip to content

Instantly share code, notes, and snippets.

View FireyFly's full-sized avatar

FireFly FireyFly

View GitHub Profile
@FireyFly
FireyFly / dcpu.diff
Created April 26, 2012 11:59 — forked from migerh/dcpu
specs diff 1.4 to 1.5
--- dcpu16.txt 2012-04-26 13:57:37.477152465 +0200
+++ dcpu16_1_5.txt 2012-04-26 13:57:12.209965926 +0200
@@ -1,6 +1,6 @@
DCPU-16 Specification
Copyright 1985 Mojang
-Version 1.4
+Version 1.5
:begin
set A, foo
set B, foo
add B, 2
set C, 0x8000
jsr upack
jsr makevisible
:end sub PC, 1
@FireyFly
FireyFly / 1QSjwaTw.js
Created March 27, 2012 21:41 — forked from anonymous/1QSjwaTw
a guest on Mar 27th, 2012 - pastebin.com/1QSjwaTw
my best solution so far: changing the updateTransformation function to take the transformation as an argument and then change the variable... something like updateTransformation({'rotate':-0.05});
function getTransformerCallback(delta) {
return function() {
delta.rotate && (rotate += delta.rotate)
delta.translateX && (translateX += delta.translateX)
delta.translateY && (translateY += delta.translateY)
updateTransformation()
}
@FireyFly
FireyFly / gist:1975677
Created March 5, 2012 00:42 — forked from koistya/gist:1975645
Named parameters application of a function
/**
* Applies a set of named arguments to a `func`.
*
* Example: var f = function(x, y, z) { return x * (y - z); };
* namedApply(f, {x: 1, y: 2, z: 3});
*
* @param func {Function} A function to invoke.
* @param args {Object} A collection of named arguments.
* @return {Function} A new function with partially applied named arguments.
*/
var Talkable = {
talk: function(){
return this.name + ': ' + this.speech()
}
}
var Animal = Object |> {
trait Talkable,
name: 'Animal',
@FireyFly
FireyFly / gist:1122730
Created August 3, 2011 14:11 — forked from anonymous/gist:1120803
CoffeeScript Sample
vinyls = [
record:
name: "The best"
year: 2005
,
record:
name: "OK, The Best For Real"
year: 2010
]