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
// Examples of https://medium.com/@alvaro.saburido/set-theory-for-arrays-in-es6-eb2f20a61848 | |
const arrA = [1, 3, 4, 5]; | |
const arrB = [1, 2, 5, 6, 7]; | |
const intersection = arrA.filter((x) => arrB.includes(x)); | |
console.log('Intersection: ', intersection); | |
console.log('Expected: [1,5]'); | |
const difference = arrA.filter((x) => !arrB.includes(x)); | |
console.log('\nDifference: ', difference); |
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
/** | |
* AWS Lambda (Node) - Using Insight API to Query your Cloudwatch Log for Daily Error Report | |
* @author Zeno Yu <[email protected]> | |
*/ | |
const AWS = require('aws-sdk'); | |
var cloudwatchlogs = new AWS.CloudWatchLogs(); | |
exports.handler = async (event) => { | |
// Cloudwatch Log Group name |
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
service: my-service | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: ${opt:stage, 'dev'} | |
environment: | |
REDIS_HOST: | |
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address] | |
functions: |