Skip to content

Instantly share code, notes, and snippets.

View lenn4rd's full-sized avatar

Lennard Timm lenn4rd

View GitHub Profile
@lenn4rd
lenn4rd / function.js
Created May 18, 2016 13:07 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
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'};
<?php
/* Sends a test email with PHP's mail() method
*
* Put this file on your web server or run it from the command line:
*
* php test_php_mail.php
*
* When testing locally, i.e. on your development machine, make sure that
* you set a valid from address for sendmail unless your machine doesn't