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
var fs = require('fs'); | |
var jade = require('jade'); | |
var _ = require('lodash'); | |
var async = require('async'); | |
exports.generate = function (arr) { | |
var fn = jade.compileFile('./template/seed1.jade', {pretty: true}); | |
var chapterFn = jade.compileFile('./template/seed2.jade', {pretty: true}); | |
var topicFn = jade.compileFile('./template/seed3.jade', {pretty: true}); |
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
__author__ = 'ronfe' | |
import pymongo | |
from pymongo import MongoClient | |
from time import strftime | |
import re | |
from tabulate import tabulate | |
output = [] |
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
{ | |
"versionCode" : "1.5", | |
"platform" : "iOS", | |
"releaseDate" : ISODate("2015-09-15T00:00:00.000Z"), | |
"note" : "1.全新的课程结构,让学习条理更清晰。\n2.可选择教材与年级,快快定制属于自己的知识树吧!\n3.全新的交互和页面设计,体验更愉悦。\n4.细节优化,体验更流畅。", | |
"updatePriority" : "Common", | |
"build" : 2.9 | |
} |
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
# _*_ coding: utf8 _*_ | |
__author__ = 'ronfe' | |
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
from collections import defaultdict, Counter | |
# Access db | |
dbClient = MongoClient('mongodb://10.8.8.8:27017') |
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
__author__ = 'ronfe' | |
# _*_ coding: utf8 _*_ | |
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
import datetime | |
# link to db | |
dbClient = MongoClient('mongodb://10.8.8.8:27017') |
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
var objectIdFromDate = function (date) { | |
return Math.floor(date.getTime() / 1000).toString(16) + "0000000000000000"; | |
}; | |
var dateFromObjectId = function (objectId) { | |
return new Date(parseInt(objectId.substring(0, 8), 16) * 1000); | |
}; |
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
/* 1 */ | |
{ | |
"result" : [ | |
{ | |
"_id" : ObjectId("55795f839240735a33240e25"), | |
"sum" : 235, | |
"count" : 50.0000000000000000, | |
"average" : 5.0000000000000000 | |
}, | |
{ |
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
__author__ = 'ronfe' | |
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
import datetime | |
import threading | |
remoteClient = MongoClient('mongodb://10.8.3.182:27017') | |
points = remoteClient['yangcong-prod25']['points'] | |
startTime = datetime.datetime(2015,6,19) |
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
__author__ = 'ronfe' | |
from pymongo import MongoClient | |
import datetime | |
from bson.objectid import ObjectId | |
db = MongoClient('mongodb://10.8.8.8:27017')['matrix-yangcong-prod25'] | |
start_date = datetime.datetime(2015, 10, 26) | |
mid_date = datetime.datetime(2015, 11, 1) |
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
# _*_ coding: utf8 _*_ | |
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
import datetime | |
# link to db | |
dbClient = MongoClient('mongodb://localhost:27017') | |
db = dbClient['yangcong-prod25'] |
OlderNewer