Skip to content

Instantly share code, notes, and snippets.

View jfollmann's full-sized avatar
🏠
Working from home

Jefferson Follmann jfollmann

🏠
Working from home
View GitHub Profile
// 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);
@zenoyu
zenoyu / gist:f63799a9079a5df376d5daf3cea27be4
Last active March 28, 2024 19:28
AWS Lambda (Node) - Using Insight API to Query your Cloudwatch Log for Daily Error Report
/**
* AWS Lambda (Node) - Using Insight API to Query your Cloudwatch Log for Daily Error Report
* @author Zeno Yu <zeno.yu@gmail.com>
*/
const AWS = require('aws-sdk');
var cloudwatchlogs = new AWS.CloudWatchLogs();
exports.handler = async (event) => {
// Cloudwatch Log Group name
@codecitizen
codecitizen / serverless.yml
Created November 22, 2018 20:42
A serverless.yml file configuring a AWS ElastiCache redis instance that is accessible by all AWS Lambda functions deployed by this serverless function.
service: my-service
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, 'dev'}
environment:
REDIS_HOST:
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address]
functions: