This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.bytearray.org/?p=118 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc.Menu.extend = cc.Class.extend | |
cc.MenuItemLabel.extend = cc.Class.extend | |
ZoomActionTag = 0x60c05002 | |
MyItem = cc.MenuItemLabel.extend | |
onEnter : -> | |
_was_selected = false | |
check = => | |
_selected = @isSelected() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc.Menu.extend = cc.Class.extend | |
MyItem = cc.MenuItemFont.extend | |
onEnter : -> | |
_was_selected = false | |
check = => | |
_selected = @isSelected() | |
if _selected and not _was_selected | |
_was_selected = true | |
@selected_v2() | |
else if not _selected and _was_selected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ship.methods | |
get_campaigns : (event,data,next) -> | |
# get_campaigns 'login:alkka', @user, (err,result) -> | |
result.media | |
result.coupon | |
callback : (coupon,next) -> | |
per campaign |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ship.use require 'cargoship-modules' | |
ship.register 'library', (a,next) -> | |
@require 'bank', (err,bank) -> | |
return next err if err | |
bank.get_library next | |
ship.use (m) -> | |
ship.require 'bank', 'library', (err,bank,library) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.wolframalpha.com/input/?i=inv%28+%7B+%7B+a%2C+-b%2C+1%2C+0+%7D%2C+%7Bb%2C+a%2C+0%2C+1%7D%2C+%7B+c%2C+-d%2C+1%2C+0+%7D%2C+%7B+d%2C+c%2C+0%2C+1+%7D+%7D+%29+*+%7B+%7Bx%7D%2C+%7By%7D%2C+%7Bz%7D%2C+%7Bw%7D+%7D | |
calc = (p1, p2, q1, q2) -> | |
low = (a,b,c,d,x,y,z,w) -> | |
scale = 1/(a^2-2 a c+b^2-2 b d+c^2+d^2) | |
sct = -b w+d w+a x-c x+b y-d y-a z+c z | |
sst = -a w+c w-b x+d x+a y-c y+b z-d z | |
tx = z a^2-d w a-c x a+d y a-c z a+b c w+c^2 x+d^2 x-b d x-b c y+b^2 z-b d z | |
ty = w a^2-c w a-d x a-c y a+d z a+b^2 w-b d w+b c x+c^2 y+d^2 y-b d y-b c z) | |
[scale * sct, scale * sst, scale * tx, scale * ty] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gen_scope = (parentScope) -> | |
Scope = -> | |
Scope.prototype = parentScope | |
new Scope() | |
a = gen_scope() | |
a.x = 1 | |
b = gen_scope a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erver = cargoship() | |
server.get /.*/, (m) -> m.end() | |
gameserver = (create) -> | |
log.info 'game created', create.id, create.secret | |
players = [] | |
(m) -> | |
unless m? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
templ = { | |
"type" : "Layer", | |
"controller" : "MyLayerCtrl", | |
{ | |
"type" : "LabelTTF", | |
"repeat" : "x in friends", | |
"text" : "{{this.x}}", | |
"click" : "this.invite(this.x);" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["scripts/build_script.sh"], | |
"working_dir" : "${project_path:${folder}}/..", | |
"shell": "true", | |
"path":"/usr/local/bin:$PATH" | |
} |