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
# Set the default terminal mode to 256color mode | |
set -g default-terminal "screen-256color" | |
# enable activity alerts | |
setw -g monitor-activity on | |
set -g visual-activity on | |
# Reset prefix to C-a | |
unbind C-b | |
set -g prefix C-a |
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 name = 'Phil'; | |
console.log(`My name is ${name}`); |
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 templateTag(strings, personName) { | |
return strings[0] + personName; | |
} | |
var name = 'Phil' | |
var someString = templateTag`My name is ${name}` | |
console.log(someString); |
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 someTemplate(strings, personName, favoriteFood) { | |
var output = strings[0] + personName + strings[1] + favoriteFood; | |
if (favoriteFood.toLowerCase() === 'pizza') { | |
return output + '. HELL YEAH!!!'; | |
} else if (favoriteFood.toLowerCase() === 'broccoli') { | |
return output + '. GROSS!'; | |
} else { | |
return output + strings[2]; | |
} |
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 strict'; | |
console.log('Loading function'); | |
const AWS = require('aws-sdk'); | |
const sesClient = new AWS.SES(); | |
/** | |
* Lambda to process HTTP POST for contact form with the following body | |
* { | |
"Email": <contact-email>, | |
"Subject": <contact-subject>, | |
"Message": <contact-message> |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1505675625000", | |
"Effect": "Allow", | |
"Action": [ | |
"ses:SendEmail" | |
], | |
"Resource": [ |
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 strict'; | |
console.log('Loading function'); | |
const AWS = require('aws-sdk'); | |
const sesClient = new AWS.SES(); | |
const sesConfirmedAddress = "<your-verified-ses-email>"; | |
/** | |
* Lambda to process HTTP POST for contact form with the following body | |
* { | |
"email": <contact-email>, |
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 AWS = require('aws-sdk'); | |
const sesClient = new AWS.SES(); | |
const sesConfirmedAddress = "<your-verified-ses-email>"; |
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 getEmailMessage (emailObj) { | |
var emailRequestParams = { | |
Destination: { | |
ToAddresses: [ sesConfirmedAddress ] | |
}, | |
Message: { | |
Body: { | |
Text: { | |
Data: emailObj.message | |
} |
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
exports.handler = (event, context, callback) => { | |
console.log('Received event:', JSON.stringify(event, null, 2)); | |
var emailObj = JSON.parse(event.body); | |
var params = getEmailMessage(emailObj); | |
var sendEmailPromise = sesClient.sendEmail(params).promise(); | |
var response = { | |
statusCode: 200 | |
}; | |
OlderNewer