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
| /** | |
| * 文本超出省略号 | |
| */ | |
| $.fn.ellipsis = function(options) { | |
| //插件参数 | |
| options = $.extend({}, { | |
| //英文模式 | |
| english : false, | |
| //优化系数 |
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
| /node_modules/**/*.js | |
| /src/app/**/*.html | |
| /dist/**/* |
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
| .DS_Store | |
| node_modules/ | |
| dist/ | |
| npm-debug.log* | |
| yarn-debug.log* | |
| yarn-error.log* | |
| # Editor directories and files | |
| .idea | |
| *.suo |
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 express = require('express'); | |
| var path = require('path'); | |
| var favicon = require('serve-favicon'); | |
| var logger = require('morgan'); | |
| var fs = require('fs') | |
| var FileStreamRotator = require('file-stream-rotator'); | |
| var cookieParser = require('cookie-parser'); | |
| var bodyParser = require('body-parser'); | |
| var lessMiddleware = require('less-middleware'); | |
| var session = require('express-session'); |
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 nodemailer = require('nodemailer'); | |
| var transporter = nodemailer.createTransport({ | |
| host: 'smtp.qq.com', | |
| secureConnection: true, | |
| port: 25, | |
| auth: { | |
| user: '944473232@qq.com', | |
| pass: '***' //授权码 |
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
| Student | |
| .find({ | |
| name: /Jake/, //正则 | |
| studentId: { $gt: 13084233, $lte: 13084255 }, //学号大于13084233 小于13084255 | |
| college: { | |
| '$in': ['通信工程学院', '会计学院'] | |
| } | |
| }) | |
| .populate('time') | |
| .sort({ studentId: -1, 'meta.createAt': -1 }) // 排序 先按 studentId 排序, studentId 一样再按 meta.createAt 排序 |
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
| /* | |
| * @param {HTMLElement} textarea Element | |
| * @param {Number} The distance between the cursor and the input box(Default 0) | |
| * @param {Number} Set the maximum height (optional) | |
| */ | |
| function autoTextarea(elem, extra, maxHeight) { | |
| extra = extra || 0; | |
| var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX' in window, | |
| isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera'), | |
| addEvent = function(type, callback) { |
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 checkID(ID) { | |
| if (typeof ID !== 'string') return '非法字符串'; | |
| var city = { | |
| 11: "北京", | |
| 12: "天津", | |
| 13: "河北", | |
| 14: "山西", | |
| 15: "内蒙古", | |
| 21: "辽宁", | |
| 22: "吉林", |
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 dateConvert(date, format) { | |
| date = parseInt(date); | |
| var Udate = new Date(date); | |
| var Y = Udate.getFullYear(), | |
| M = Udate.getMonth() < 10 ? "0" + (Udate.getMonth() + 1) : (Udate.getMonth() + 1), | |
| D = Udate.getDate() < 10 ? "0" + Udate.getDate() : Udate.getDate(), | |
| h = Udate.getHours(), | |
| m = Udate.getMinutes(), | |
| s = Udate.getSeconds(), | |
| result; |