This file contains 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
{ | |
"Description": "Example ECS TaskDef", | |
"Parameters": { | |
"Param1": { | |
"Description": "Example param 1", | |
"Type": "String" | |
} | |
}, | |
"Resources": { | |
"ECSTaskExampleExecutionRole": { |
This file contains 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
{ | |
"Description" : "Example ECS Cluster", | |
"Resources" : { | |
"ECSClusterExample1" : { | |
"Type" : "AWS::ECS::Cluster", | |
"Properties" : { | |
"ClusterName" : "ecs-cluster-example1" | |
} | |
} | |
} |
This file contains 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
let arrayOfStrings = [ "bbb", "ccc", "aaa"]; | |
arrayOfStrings.sort(); //sorts as strings in alphabetical ascending order by default | |
//arrayOfStrings = ["aaa", "bbb", "ccc"] | |
let arrayOfInts = [3, 4, 1]; | |
//function passed to sort() returns > 0 if b comes after a, or if < 0 then a comes before b | |
arrayOfInts.sort( (a,b) => a - b ); | |
//arrayOfInts = [1, 3, 4]; |
This file contains 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
let arrays = [ [1,2], [2,3], [3,4] ]; | |
let singleArray = [].concat.apply([], arrays); | |
//singleArray = [1, 2, 2, 3, 3, 4]; |
This file contains 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
# Lambda ARNs | |
aws lambda list-functions | jq '.Functions[].FunctionArn' | |
# multiple properies: outputs on separate lines | |
aws lambda list-functions | jq -r '.Functions[] | .FunctionArn, .FunctionName' | |
# multiple properties as arrays | |
aws lambda list-functions | jq -r '.Functions[] | [.FunctionArn, .FunctionName]' | |
# multiple properties as arrays, converted to csv |
This file contains 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
# list alll connectors | |
GET connectorhost:8083/connectors | |
# status for one connector | |
GET connectorhost:8083/connectors/connector-name/status | |
# restart - does not restart failed tasks | |
POST connectorhost:8083/connectors/connector-name/restart | |
# restart specific task |
This file contains 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
Assuming DynamoDB local instance started with: | |
docker run -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath . | |
# --endpoint-url http://localhost:8000 for local Docker DynamoDB instance | |
# table with hash key | |
% aws dynamodb create-table --table-name test --key-schema AttributeName=id,KeyType=HASH \ | |
--attribute-definitions AttributeName=id,AttributeType=N \ | |
--endpoint-url http://localhost:8000 \ |
This file contains 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
#calls a function setting the value for 'this' within the function | |
functionName.call(someThisValue, otherParams); | |
- the first param passed is the value for 'this' when this is referenced within that function | |
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call |
This file contains 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
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8081 -jar YourApp.jar |
This file contains 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
let example = new Promise( | |
function(resolve, reject){ | |
let success = do some async task; | |
if(success){ | |
resolve(); | |
}else{ | |
reject(); | |
} | |
}; | |
); |