- for (...) {}
- array copy: new Array(len) and copy in loop is fastest
- concat vs unshift
- Visitor(eval seems no performence degradation)
- Cache: no difference, but cached faster in IE 11 (except array item cache)
- Enumerate Object Properties
- apply arguments
This file contains 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
/* | |
modified from original source: https://bitbucket.org/mattkotsenas/c-promises/overview | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Promises |
This file contains 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
gulp.task('compile-cocos2d', function (done) { | |
console.log('Spawn ant in ' + paths.originCocos2dCompileDir); | |
var child = Spawn('ant', { | |
cwd: paths.originCocos2dCompileDir, | |
stdio: [0, 1, 'pipe'] | |
}); | |
child.on('error', function (err) { | |
var ANT = Chalk.inverse('ant'); | |
if (err.code === 'ENOENT') { |
This file contains 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
/Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge merge -p $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED") |
开始学习的时候为了直观的看效果确实是经常把子节点放在中间,但用来开发的几个项目就不会再以中心点为基点了。
我也算做了10年游戏了,一直都习惯于设置在父节点的中心点。我个人不太理解一个编辑器,创建的子物体默认会跑到父物体的下方这种做法。而且假如我是一个美术/策划,或者将来 Creator 支持 3D 以后,这种子物体一创建就跑到父物体最边上的行为,会更加让人困惑。
假如父节点的大小会动态增加的话。现在的坐标系统就会出问题。
会有什么问题?
假如父节点是超级长的地图话,位置怎么设置
This file contains 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
javascript:(function() { | |
var tbody = document.querySelector('table#test-table>tbody'); | |
var lastTr = tbody.querySelector('tr:last-child'); | |
var tr = document.createElement('tr'); | |
tbody.appendChild(tr); | |
tr.innerHTML = lastTr.innerHTML; | |
var th = tr.querySelector('th'); | |
th.id = 'title-' + tbody.childElementCount; |
This file contains 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
find . -name "*.js"|xargs cat|wc -l |