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 getQuestionListUrl(index) { | |
return 'https://workorder.console.aliyun.com/json/page/query_index.json?__preventCache=' + (new Date()).getTime() + '¤tPage=' + index + '&page=' + index + '&pageSize=100&status='; | |
} | |
function getQuestions() { | |
let questions = []; | |
for (let p = 1; p <= 4; p++) { | |
let url = getQuestionListUrl(p); | |
$.ajax({ | |
url, |
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
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
'use strict'; | |
const mongoUrl = 'mongodb://my-db-address:27017';// MongoDB connection URL. | |
const filePath = 'id.list';// This must be Unix/Linux ID list file. | |
const limit = 100;// Buffer this number of documents. Then do insert. | |
const dbName = 'myDB';// DB name. | |
const collectionName = 'myCollection';// Collection name. | |
const MongoDB = require('mongodb'); | |
const MongoClient = MongoDB.MongoClient, assert = require('assert'); |
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
// returns things in array 'a' that are not in array 'b' | |
// > ['a','b','c','1', '2', '3'].complement(['b', 'c', 'd', 'e']); | |
// ['a', '1', '2', '3'] | |
function complement(a, b){ | |
(b)||(b=a, a=this); | |
return (Array.isArray(a) && Array.isArray(b)) | |
? a.filter(function(x){return b.indexOf(x)===-1;}) | |
: undefined; | |
} | |
Array.prototype.complement=complement; |
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
/** | |
* A helper module for AngularUI Router, which allows you to define your states as an object tree. | |
* @author Mark Lagendijk <[email protected]> | |
* @license MIT | |
*/ | |
+function(){ | |
angular.module('ui.router.stateHelper', [ 'ui.router' ]) | |
.provider('stateHelper',['$stateProvider', function($stateProvider){ | |
var self = this; |
NewerOlder