View account.chain.ts
import { MongoClient } from 'mongodb';
const url = 'mongodb://localhost:27017';
const dbName = 'test-set';
import { ConsolePro } from "console-pro";
const console = new ConsolePro();
/**等待n毫秒 */
function sleep(ms: number) {
return new Promise(cb => setTimeout(cb, ms));
}
View remove-term-color.js
const color_flag_reg = /((\u001b\[\d+m)+)([\s\S]+?)((\u001b\[\d+m)+)/;
s.replace(color_flag_reg, "$3");
View worker.example.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cluster = require("cluster"); // const cluster = require("cluster")
const os = require("os"); // const os = require("os")
/* Share code */
const prepare_job_promise = new Promise((resolve, reject) => {
// bootstrap modules
setTimeout(resolve, 1000);
});
// or write like this
View keyboard-attach.ts
import { Directive, ElementRef, Input } from '@angular/core';
import { Content, Platform } from 'ionic-angular';
import { Keyboard } from '@ionic-native/keyboard';
import { Subscription } from 'rxjs/rx';
/**
* @name KeyboardAttachDirective
* @description
* The `keyboardAttach` directive will cause an element to float above the
* keyboard when the keyboard shows. Currently only supports the `ion-footer` element.
View PromisePool.js
// __op_temp_null_: 说明缓存取中没有东西
Object.defineProperty(global, "__op_temp_null_", {
value: Symbol("Operators Object NULL")
});
const op_temp_key = Symbol("Operators Object TEMP");
Object.defineProperty(global, "__op_temp__", {
get() {
const res = this[op_temp_key];
// 取值后马上移除引用关系
this[op_temp_key] = global.__op_temp_null_;
View H5lock.md

How to use

const lock = new H5lock({
  width: number,
  height: number,
  container: Element|id,
  chooseType ?: 2|3|4|5, // default is 3: 3×3
  inputEnd(pwd){
    console.log('Pattern Lock Value Is:', pwd);
  }
View Capture DOM.MD
domToImg.dom = document.body;
domToImg.download(location.protocol + "//" + location.host + "/build/main.css");
View Flow of Find PWD.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 流程的状态机
*/
var FLOW_PROCESS_STATUS;
(function (FLOW_PROCESS_STATUS) {
FLOW_PROCESS_STATUS[FLOW_PROCESS_STATUS["BEFORE_START"] = 0] = "BEFORE_START";
FLOW_PROCESS_STATUS[FLOW_PROCESS_STATUS["INPUT_EMAIL"] = 1] = "INPUT_EMAIL";
FLOW_PROCESS_STATUS[FLOW_PROCESS_STATUS["INPUT_CODE"] = 2] = "INPUT_CODE";
View firebase-pagination.js
const admin = require("./firebase-admin");
admin.initializeApp({
credential: **yourCredential**
databaseURL: **yourDatabaseURL**
});
const db = admin.database();
const dbPromise = (db_ref, options = {}) => {
const {
can_null,
View mide-pact.event.test.js
// 事件监听
var MP = require("../mind-pact");
var eve = new MP({});
[
"a",
"a.b",
"a.b2",
"a.b.c",
"a.b.c1",
"a.b.c2"