Skip to content

Instantly share code, notes, and snippets.

View dead-horse's full-sized avatar
🤖
I may be slow to respond.

Yiyu He dead-horse

🤖
I may be slow to respond.
View GitHub Profile
@dead-horse
dead-horse / benchmark.js
Created April 29, 2016 03:11
assgin_for_in_of
'use strict';
const Benchmark = require('benchmark');
const benchmarks = require('beautify-benchmark');
const suite = new Benchmark.Suite();
suite
.add('Object.assign', function() {
var createGame = require('voxel-engine');
var game = module.exports = createGame({
generateChunks: false,
texturePath: 'textures/',
materials: [
['grass', 'dirt', 'grass_dirt'], 'brick', 'cobblestone', 'bluewool', 'glowstone', 'diamond', 'grass_dirt', 'grass'
// ,'meow'
],
//materialFlatColor: true,
var check = require('./');
var rule = {
name: 'string',
age: {type: 'int', max: 200},
gender: ['male', 'female'],
working: 'boolean',
salary: {type: 'number', min: 0},
birthday: 'date',
now: 'dateTime',
var Cutter = require('cutter');
var net = require('net');
/**
* must return length of head + body
*/
function packetLength(data) {
return 4 + data.readInt32BE(0);
}
var cutter = new Cutter(4, packetLength);
// error in next tick
try {
setImmediate(function () {
throw new Error('error happened');
});
} catch (err) {
// 捕获不到异常
}
// get json by callback
(function (exports) {
//---------------------------------------------------------------
//------------------------set up editor--------------------------
//---------------------------------------------------------------
var editor1 = ace.edit("editor1");
editor1.setTheme("ace/theme/monokai");
editor1.getSession().setMode("ace/mode/javascript");
var editor2 = ace.edit("editor2");
editor2.setTheme("ace/theme/monokai");
editor2.getSession().setMode("ace/mode/javascript");
function Cube() {
this.commands = [];
}
Cube.prototype.executeCommand = function (commands, callback) {
this.commands = commands;
this.commandCallback = callback;
this._execute();
};
00:00
beats: http://miao.item.taobao.com/41781815440.htm?mt=&spm=a1z0k.7385961.1997985097.d4918997.eNalBC&_u=ab1pr6m5afb
mk: http://detail.tmall.hk/hk/item.htm?id=41848825576
00:30
tcl: http://miao.item.taobao.com/35246887163.htm?mt=
01:00
表: http://miao.item.taobao.com/41827050867.htm?mt=
var cp = require('child_process');
var urllib = require('urllib');
exports.ipMap = {};
var urls = [
'www.baidu.com',
'www.tmall.com'
];