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 app = require('express')() | |
const getRoute = (req) => { | |
const route = req.route ? req.route.path : '' // check if the handler exist | |
const baseUrl = req.baseUrl ? req.baseUrl : '' // adding the base url if the handler is child of other handler | |
return route ? `${baseUrl === '/' ? '' : baseUrl}${route}` : 'unknown route' | |
} | |
const fs = require('fs') |
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
//* | |
//* See the JS Fiddle: http://jsfiddle.net/sxcjmoj5/3/ | |
//* | |
//* | |
// make sure ngSanitize module is installed: | |
// https://docs.angularjs.org/api/ngSanitize | |
// | |
// To convert links from plaintext, you must use the linky filter which is included with ngSanitize | |
// https://docs.angularjs.org/api/ngSanitize/filter/linky | |
// |
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
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
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 fs = require('fs'); | |
//每段读取的长度 | |
//@param inputFile{filepath} | |
//@param onEnd{func} 所有内容读完了 | |
module.exports = function(inputFile, onEnd){ | |
var sLength = 1024; |