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
#format = """ | |
#[╭─user───❯](bold blue) $username | |
#[┣─system─❯](bold yellow) $hostname | |
#[┣─project❯](bold red) $directory$rust$git_branch$git_status$package$golang$terraform$docker_context$python$docker_context$nodejs | |
#[╰─cmd────❯](bold green) | |
#""" | |
[username] | |
style_user = "green bold" | |
style_root = "red bold" | |
format = "[$user]($style) " |
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
#!/usr/bin/env python3 | |
import boto3 | |
import argparse | |
import string | |
parser = argparse.ArgumentParser('Find duplicate objects in an aws s3 bucket') | |
parser.add_argument('--bucket', dest='myBucket', default='yourBucketName', help='S3 Bucket to search') | |
cliArgs = parser.parse_args() |
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
➜ ~ curl --header "Authorization: eyJraWQiOiJCS0hEUDFENlZjNlU3Sk9ad0h4dDJ5K3ptcDBkb1psaCsxSGl4MEpueWE4PSIsImFsZyI6IlJTMjU2In0.eyJhdF9oYXNoIjoiSDJTdzlJaW12ZVJ0bXUwd2lCcnhjdyIsInN1YiI6IjhiNjU1Y2M1LWVmZDQtNDBkOS1iZjIwLThkNTI4M2UyNTc4ZiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAuYXAtc291dGhlYXN0LTIuYW1hem9uYXdzLmNvbVwvYXAtc291dGhlYXN0LTJfMUVFdHp3VWEwIiwiY29nbml0bzp1c2VybmFtZSI6Im1lZGl1bS1hZG1pbi11c2VyIiwiYXVkIjoiNzVvaG9nam8xczlkZmZnbjVxczQwOGpscGMiLCJldmVudF9pZCI6IjQzNmE3MDIxLTVjMmYtNGQ4Yi05YTUzLWUzNGRhZmFlOTA0MyIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjY3NDQ0MDU5LCJleHAiOjE2Njc0NDc2NTksImlhdCI6MTY2NzQ0NDA1OSwianRpIjoiZjdkYmFmNzAtMWU5YS00NWQxLWFjZDMtZDBlY2M3MGUzNjkyIiwiZW1haWwiOiJtZWRpdW1AZXhhbXBsZS5jb20ifQ.SxitwSkKs7T42-gUq7JNaw-oKdlYoct8O1OrwNQx_2PoSRYbAHWoZTe2ws3x_BC_oG3PB8lpzZQxiUrC1soHBmO5yriIM34xOBqCL9rTNKCE1eUHqtPoW2DUwAzLCrJncecYl6t10K_yYQMadearS3L8_RA3cHN4-V43QNlhCQyqWBYD3GQJsxBjFuL_NJ71ca1sGahMe9sprNqk-7tEk3z_gb9_Z7IaAeZfDwlf9SHUgaVg88DEAnjFHMNgjhtm_78sPTw8MmIlyAQati55_VD_qJ |
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
store.addMethod('POST', createOneIntegration, { ...authorizer }); | |
store.addMethod('GET', getAllIntegration, { ...authorizer }); | |
const singleStore = store.addResource('{id}'); | |
singleStore.addMethod('GET', getOneIntegration, { ...authorizer }); | |
singleStore.addMethod('PATCH', updateOneIntegration, { ...authorizer }); | |
singleStore.addMethod('DELETE', deleteOneIntegration, { ...authorizer }); |
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
const userPool = new cognito.UserPool(this, 'medium-userpool', { | |
userPoolName: 'medium-userpool', | |
}); | |
userPool.addClient('medium-client-1', { | |
oAuth: { | |
flows: { | |
authorizationCodeGrant: true, | |
}, | |
callbackUrls: ['https://www.google.com.au/'], |
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
store.addMethod('POST', createOneIntegration, { authorizer }); | |
store.addMethod('GET', getAllIntegration, { authorizer }); | |
const singleStore = store.addResource('{id}'); | |
singleStore.addMethod('GET', getOneIntegration, { authorizer }); | |
singleStore.addMethod('PATCH', updateOneIntegration, { authorizer }); | |
singleStore.addMethod('DELETE', deleteOneIntegration, { authorizer }); |
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
const medium_username = ssm.StringParameter.fromStringParameterName(this, 'medium_username', 'medium_username'); | |
const medium_password = ssm.StringParameter.fromStringParameterName(this, 'medium_password', 'medium_password'); | |
const authorizerFn = new NodejsFunction(this, 'BasicAuthAuthorizer', { | |
entry: join(__dirname, '..', 'lambda', '/authorizer.ts'), | |
handler: 'authorizer', | |
environment: { | |
medium_username: medium_username.stringValue, | |
medium_password: medium_password.stringValue, | |
}, |
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
curl -X POST https://fp5l1e7iwl.execute-api.ap-southeast-2.amazonaws.com/dev/store -H "Content-Type: application/json" -d '{"store_name":"yellow store","store_description":"my awesome store"}' |
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
new cdk.CfnOutput(this, 'apiUrl', {value: api.url}); |
NewerOlder