Skip to content

Instantly share code, notes, and snippets.

Avatar

Abdiel Aviles abdielou

View GitHub Profile
@vgeshel
vgeshel / function.js
Last active Mar 6, 2021
AWS Lambda function for forwarding SNS notifications to Slack
View function.js
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
@kdabir
kdabir / iso_date.groovy
Last active Sep 27, 2020
current date in iso 8601 in groovy
View iso_date.groovy
new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC"))