make sure you add SpacebarsCompiler package with meteor add SpacebarsCompiler
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
| [ | |
| {name: 'Afghanistan', code: 'AF'}, | |
| {name: 'Åland Islands', code: 'AX'}, | |
| {name: 'Albania', code: 'AL'}, | |
| {name: 'Algeria', code: 'DZ'}, | |
| {name: 'American Samoa', code: 'AS'}, | |
| {name: 'AndorrA', code: 'AD'}, | |
| {name: 'Angola', code: 'AO'}, | |
| {name: 'Anguilla', code: 'AI'}, | |
| {name: 'Antarctica', code: 'AQ'}, |
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
| load and get sheet data |
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
| const lambda_report_pattern = /REPORT RequestId: ([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\s{1,}Duration: (\d{1,}.\d{1,}) ms\s{1,}Billed Duration: (\d{1,}) ms\s{1,}Memory Size: (\d{1,}) MB\s{1,}Max Memory Used: (\d{1,}) MB/; | |
| const lambda_start_pattern = /START RequestId: ([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\s{1,}Version: /; | |
| const lambda_end_pattern = /END RequestId: ([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})/; | |
| const lambda_report_example = `REPORT RequestId: 4af5ccd9-fef7-11e8-8de1-bfd74775c3f5 Duration: 38.07 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 32 MB`; | |
| const lambda_start_example = `START RequestId: 698e4612-06da-43ee-93d1-623b6946bc24 Version: $LATEST`; | |
| const lambda_end_example = `END RequestId: 698e4612-06da-43ee-93d1-623b6946bc24`; | |
| if (lambda_report_pattern.test(lambda_report_example)) { |
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 byteLength(str) { | |
| // returns the byte length of an utf8 string | |
| var s = str.length; | |
| for (var i=str.length-1; i>=0; i--) { | |
| var code = str.charCodeAt(i); | |
| if (code > 0x7f && code <= 0x7ff) s++; | |
| else if (code > 0x7ff && code <= 0xffff) s+=2; | |
| if (code >= 0xDC00 && code <= 0xDFFF) i--; //trail surrogate | |
| } | |
| return s; |
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
| const delay = ms => { | |
| return new Promise(res => { | |
| setTimeout(res, ms); | |
| }); | |
| }; | |
| const run = () => { | |
| const promise = MakeQuerablePromise(delay(1000)); | |
| console.log(promise.isPending()); | |
| }; |
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 IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Node Inspector", | |
| "type": "node", | |
| "request": "launch", |
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
| const PromiseAll = (inputArray, asyncFunction) => { | |
| const promises = inputArray.map((input, index) => { | |
| return asyncFunction(input) | |
| .then(e => { | |
| return { in: input, out: e, status: 'resolved', index }; | |
| }) | |
| .catch(e => { | |
| return { in: input, err: e, status: 'rejected', index }; | |
| }); | |
| }); |
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
| // | |
| export async function asyncForEach(array, callback) { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array); | |
| } | |
| } | |
| export function split(arr, n) { | |
| var res = []; | |
| while (arr.length) { | |
| res.push(arr.splice(0, n)); |
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 webpack = require('webpack'); | |
| var MemoryFS = require('memory-fs'); | |
| var SingleEntryDependency = require('webpack/lib/dependencies/SingleEntryDependency'); | |
| var fs = new MemoryFS(); | |
| fs.mkdirpSync('/src'); | |
| fs.writeFileSync('/src/app.js', 'require("./dep.js")', 'utf-8'); | |
| fs.writeFileSync('/src/dep.js', 'module.exports = function(msg){console.log(msg)}', 'utf-8'); | |
| fs.writeFileSync('/src/extra-entry.js', 'require("./dep.js")', 'utf-8'); |
NewerOlder