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
drop table store; | |
drop table sales; | |
drop materialized view city_sales; | |
CREATE TABLE "sales" ( | |
"id" int PRIMARY KEY, | |
"item" varchar, |
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
for NAME in $(aws logs describe-log-groups | jq -r .logGroups[].logGroupName | grep amplifynotes) | |
do | |
aws logs delete-log-group --log-group-name $NAME | |
done |
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
import boto3 | |
s3 = boto3.resource('s3') | |
for bucket in s3.buckets.all(): | |
print(bucket.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
{ | |
"demo-global-table": [ | |
{ | |
"PutRequest": { | |
"Item": { | |
"id": {"S": "0123456789"}, | |
"firstname": {"S": "Jeff"}, | |
"lastname": {"S": "Barr"} | |
} | |
} |
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
import ec2 = require('@aws-cdk/aws-ec2'); | |
import cdk = require('@aws-cdk/core'); | |
import { Fn, Tag, Resource } from '@aws-cdk/core'; | |
import { AmazonLinuxImage, UserData, InstanceType } from '@aws-cdk/aws-ec2'; | |
import { Role, ServicePrincipal, ManagedPolicy, CfnInstanceProfile } from '@aws-cdk/aws-iam' | |
/** | |
* Create my own Ec2 resource and Ec2 props as these are not yet defined in CDK | |
* These classes abstract low level details from CloudFormation |
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 updatePlayCount(your_object) { | |
return new Promise((resolve, reject) => { | |
const LAST_PLAYED_TIME = Math.round(new Date() / 1000); | |
var params = { | |
TableName: "your_table", | |
Key: { | |
"cognitoid": your_object.userId, |
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
async function asyncWorker() { | |
return new Promise( (resolve, reject) => { | |
setTimeout(resolve, 2000); | |
}); | |
} | |
async function main() { | |
console.debug('Started'); |
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 asyncWorker() { | |
return new Promise( (resolve, reject) => { | |
setTimeout(resolve, 2000); | |
}); | |
} | |
function main() { | |
callback = () => { |
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 asyncWorker(callback) { | |
setTimeout(callback, 2000); | |
} | |
function main() { | |
callback = () => { | |
console.debug('callback !'); | |
} |