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
function isFunction(func) { | |
return func && typeof func === 'function'; | |
} | |
export default class Sandbox { | |
constructor(props = {}) { | |
this.multiMode = false; | |
this.eventListeners = {}; | |
this.timeoutIds = []; | |
this.intervalIds = []; | |
this.propertyAdded = {}; |
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
jiangtianyi@jiangtinyideMBP shuhe2 % yarn build sample | |
yarn run v1.22.4 | |
$ node scripts/build.js sample | |
$ yarn workspace @alife/shuhe2-core build | |
warning package.json: No license field | |
$ rimraf lib/ && tsc | |
$ yarn workspace @alife/shuhe2-schema-form build | |
warning package.json: No license field | |
$ rimraf lib/ && babel src -d lib && cp -r src/types.d.ts lib |
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
jiangtianyi@jiangtinyideMBP shuhe2 % yarn start sample | |
yarn run v1.22.4 | |
$ node scripts/start.js sample | |
$ concurrently --names @alife/shuhe2-core,@alife/shuhe2-schema-form,@alife/shuhe2-data-sources,@alife/shuhe2-edit,sample --prefix-colors green,yellow,magenta,bgGreen,bgYellow "yarn workspace @alife/shuhe2-core start" "yarn workspace @alife/shuhe2-schema-form start" "yarn workspace @alife/shuhe2-data-sources start" "yarn workspace @alife/shuhe2-edit start" "yarn workspace sample start" | |
warning package.json: No license field | |
warning package.json: No license field | |
warning package.json: No license field | |
warning package.json: No license field | |
$ tsc -w --preserveWatchOutput |
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
/* | |
var YijiConfig = { | |
// 商户id | |
partner:"20170413020014185029", | |
// 密钥 | |
key:"21a121c1ca7c146581292c28892971f8", | |
// 网管 | |
url:"https://openapi.yijifu.net/gateway.html?" | |
}; | |
*/ |
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
const benchmark = require('benchmark'); | |
const suite = new benchmark.Suite; | |
const join = require('path').join; | |
const normalize = require('path').normalize; | |
const p = '/ddd/../../../aaa/bbb/ccc'; | |
function getRandomStr() { | |
return '__' + Math.floor(Math.random() * 16777215).toString(16) + '__'; |
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
var getCSSPath = function(elem, detail) { | |
var detail = detail || {}; | |
var path = '', nextElem = elem; | |
if (detail.withAttrs) { | |
path += convertAttrsToCSS(elem); | |
} | |
if (detail.withIndex) { | |
path += ':nth-child(' + getSiblingIndex(elem) + ')'; | |
} |
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
/* | |
Copyright (C) 2013 Ariya Hidayat <[email protected]> | |
Copyright (C) 2013 Thaddee Tyl <[email protected]> | |
Copyright (C) 2013 Mathias Bynens <[email protected]> | |
Copyright (C) 2012 Ariya Hidayat <[email protected]> | |
Copyright (C) 2012 Mathias Bynens <[email protected]> | |
Copyright (C) 2012 Joost-Wim Boekesteijn <[email protected]> | |
Copyright (C) 2012 Kris Kowal <[email protected]> | |
Copyright (C) 2012 Yusuke Suzuki <[email protected]> | |
Copyright (C) 2012 Arpad Borsos <[email protected]> |
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
var x= new ActiveXObject("Msxml2.XMLHTTP.6.0"); | |
x.onreadystatechange=function(){ | |
if(x.readyState<4)return; | |
var xml_dom = new ActiveXObject("MSXML2.DOMDocument"); | |
var tmpNode = xml_dom.createElement("tmpNode"); | |
tmpNode.dataType = "bin.base64"; | |
tmpNode.nodeTypedValue = x.responseBody; | |
base64string=tmpNode.text.replace(/\n/g,""); | |
document.write("<img src=\"data:image/bmp;base64,"+base64string+"\">") | |
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
function saveAs(blob, filename) { | |
var type = blob.type; | |
var force_saveable_type = 'application/octet-stream'; | |
if (type && type != force_saveable_type) { // 强制下载,而非在浏览器中打开 | |
var slice = blob.slice || blob.webkitSlice; | |
blob = slice.call(blob, 0, blob.size, force_saveable_type); | |
} | |
var url = URL.createObjectURL(blob); | |
var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a'); |
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
function XHRWorker(url, ready, scope) { | |
var oReq = new XMLHttpRequest(); | |
oReq.addEventListener('load', function() { | |
var worker = new Worker(window.URL.createObjectURL(new Blob([this.responseText]))); | |
if (ready) { | |
ready.call(scope, worker); | |
} | |
}, oReq); | |
oReq.open("get", url, true); | |
oReq.send(); |
NewerOlder