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
from __future__ import print_function | |
import json | |
import logging | |
import urllib2 | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
SUCCESS = 'SUCCESS' |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"BarbaraUser" : { | |
"Type": "AWS::IAM::User", | |
"Properties": { | |
"Groups": [ { "Fn::ImportValue": "MFAGroupsStack-BossGroup" } ], | |
"UserName": "barbara" | |
} | |
}, |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"BossRole" : { | |
"Type": "AWS::IAM::Role", | |
"Properties": { | |
"RoleName": "BossRole", | |
"AssumeRolePolicyDocument": { | |
"Version" : "2012-10-17", | |
"Statement": [ { |
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
// Get the Arn from a resource | |
"Principal": { | |
"AWS": { "Fn::GetAtt": [ "BarbaraBossUser", "Arn" ] } | |
}, |
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
{} |
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
# jq reference: https://stedolan.github.io/jq/manual | |
# Get a list of each Lambda function that starts with ^test and output that as an array | |
# i.e. take the contents of the .Functions[] list, select the ones that have a .FunctionName property that | |
# starts with test, and record the .FunctionName value | |
aws lambda list-functions | jq '[ .Functions[] | select(.FunctionName | test("^test")) | .FunctionName ]' | |
# Create an array of new maps for Lambda functions | |
aws lambda list-functions | jq '[ .Functions[] | select(.FunctionName | test("^test")) | {name: .FunctionName, memory: .MemorySize} ]' |
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
// Don't use fat arrow functions as props in pure components, use a named function instead e.g. | |
export const ChoiceKey = (props: Props) => { | |
const keyClickHandler = () => { | |
props.keyClick(props.id) | |
} | |
return <div className={classes.choiceKey} | |
onClick={keyClickHandler}>Choice Key {props.id}</div> | |
} |
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
echo '1 | |
2 | |
3 | |
4 | |
LOG: 5 | |
6 | |
LOG: 7' | tee >(grep LOG | sed 's/LOG: //' > tmp.txt) |
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
// shorthand for result that is a promise | |
it(() => { | |
return expect(result) | |
.to.eventually.deep.equal({url, options}) | |
}) | |
// ... longhand, which handles multiple promises in a test, and is | |
// easier to debug (by inserting console.log in then handler) | |
it(() => { | |
return Promise.all([ |