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
| local function getCenterPosition(baseNode, childNode) | |
| local baseSize = baseNode:getContentSize() | |
| local childSize = childNode:getContentSize() | |
| return baseSize.width / 2 - childSize.width / 2, | |
| baseSize.height / 2 - childSize.height / 2 | |
| end |
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
| var format = function(){ | |
| var i = 0; | |
| var str = ""; | |
| for(i = 0; i < arguments.length; i++){ | |
| str = str + arguments[i]; | |
| } | |
| return str; | |
| }; |
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
| function extend(Child, Parent) { | |
| var NewParent = Parent; | |
| if(typeof Parent.prototype.parent !== "undefined"){ | |
| NewParent = Animate.tools.extend(Parent, Parent.prototype.parent); | |
| } | |
| Child.prototype = new NewParent(); | |
| Child.prototype.parent = NewParent; | |
| return Child; | |
| } |
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
| import random | |
| import string | |
| import hashlib | |
| source = string.digits + string.letters | |
| letters = "".join([random.choice(source) for i in xrange(25)]) | |
| letters_hash = hashlib.sha256(letters).hexdigest() | |
| print 'Letters =>', letters | |
| print 'SHA-256 =>', letters_hash |
NewerOlder