Skip to content

Instantly share code, notes, and snippets.

View jbesw's full-sized avatar

James Beswick jbesw

View GitHub Profile
@wongcyrus
wongcyrus / cloud9upgradeawssamcli.sh
Last active October 31, 2022 18:39
Cloud9 upgrade to the latest AWS SAM CLI
sudo yum update -y
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
sudo ./sam-installation/install --update
sam --version
@rts-rob
rts-rob / main.go
Created March 19, 2020 21:15
Partial SAM template and partial Go function code for limiting access to GSIs in IAM
func (d *dependencies) handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
input := dynamodb.QueryInput{
ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{
":v1": {
S: aws.String(request.PathParameters[PathParameter]),
},
},
// hard-coded for proof of concept
IndexName: aws.String("SSN-index"),
function findProduct(arr) {
// First find the total product of all indeces
let totalProduct = arr[0];
for (let i = 1; i < arr.length; i++) {
totalProduct *= arr[i];
}
// Then, return a new array where each index is the
// product of all numbers, except for the current value of that index
// i.e. newArr[0] = arr[1] * arr[2] * arr[3]... arr[length-1];
@bilzard
bilzard / node_aws_blackbelt_online_seminar_aws_lambda_part3.md
Created May 31, 2019 04:11
Anti-patterns & Best Practices in AWS Lambda

Note: AWS blackbelt online seminar - part3

Anti-patterns & Best Practices in AWS Lambda

Speaker: 西谷 圭介, AWS Japan

  • The only tunable parameter is MEMORY, but, in fact, it affects all computing resources ex. CPU usage
  • Reduce package size
@alexcasalboni
alexcasalboni / amazon-rekognition.md
Last active October 11, 2024 16:44
Amazon Rekognition - Python Code Samples

Amazon Rekognition - Python Code Samples

  1. Labels Detection
  2. Faces Detection
  3. Faces Comparison
  4. Faces Indexing
  5. Faces Search