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
import * as ec2 from '@aws-cdk/aws-ec2'; | |
import {DockerImageAsset} from '@aws-cdk/aws-ecr-assets'; | |
import * as ecs from "@aws-cdk/aws-ecs"; | |
import {FargatePlatformVersion} from "@aws-cdk/aws-ecs"; | |
import * as ecs_patterns from '@aws-cdk/aws-ecs-patterns'; | |
import * as efs from "@aws-cdk/aws-efs"; | |
import {AccessPoint} from "@aws-cdk/aws-efs"; | |
import {RetentionDays} from "@aws-cdk/aws-logs"; | |
import * as route53 from '@aws-cdk/aws-route53'; | |
import * as cdk from "@aws-cdk/core"; |
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
function ConvertKeysToLowerCase(obj) { | |
if (!obj || typeof obj !== "object") { | |
return obj; | |
} | |
var output = {}; | |
for (let i in obj) { | |
if (Object.prototype.toString.apply(obj[i]) === '[object Object]') { | |
output[i.toLowerCase()] = ConvertKeysToLowerCase(obj[i]); | |
}else if(Object.prototype.toString.apply(obj[i]) === '[object Array]'){ | |
output[i.toLowerCase()]=[]; |
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
sls package --stage alpha -p output //--stage alpha | |
# Update $LATEST version of function | |
aws lambda update-function-code --function-name apollo-lambda-alpha-graphql --zip-file fileb://output/apollo-lambda.zip --output json | |
# Publish new version of function | |
VERSION=$(aws lambda publish-version --function-name apollo-lambda-alpha-graphql --output json | jq -r .Version) | |
# Verify that the new version is healthy | |
… |
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
// Generic constructor signature | |
type ClassConstructor<T> = new (...args: any[]) => T; | |
// The contraint we might want to apply to our constructor signature | |
export interface IHelperRepository { | |
getEntity<T extends EntityDTO>(entityQuery: EntityQuery): Promise<Maybe<T>>; | |
getItems<T extends SummaryDTO>(itemsQuery: ItemsQuery): Promise<T[]>; | |
} | |
type HelperRepoConstructor = ClassConstructor<IHelperRepository>; |
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
type ClassConstructor<T> = new (...args: any[]) => T; | |
function withEZDebug<C extends ClassConstructor<{ getDebugValue(): object }>>( | |
Class: C | |
) { | |
return class extends Class { | |
debug() { | |
let Name = Class.name; | |
let value = this.getDebugValue(); | |
return Name + '(' + JSON.stringify(value) + ')'; |
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
docker --tlsverify --tlskey keys/docker/docker_key.pem --tlscert keys/docker/docker_cert.pem --tlscacert keys/ca/ca_cert.pem images |
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 --cacert keys/ca/ca_cert.pem --cert keys/nginx/nginx_cert.pem --key keys/nginx/nginx_key.pem | |
--resolve 'nginx.ecomm.com:8443:10.0.0.128' https://nginx.ecomm.com:8443/v1.39/images/json |
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
git config --global alias.lg "log --all --graph --pretty='%C(green)%h%Creset %C(cyan)%d%Creset %s'" | |
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
git log --format=format: --name-only | egrep -v '^$' | sort | uniq -c | sort -r | head -10 |
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
# aws_secret_access_key = YYYYYYYYYYYYYYYYYYYYYYYY | |
# | |
# where <USER NAME> is your username as above | |
# | |
# | |
# Requirements: | |
# ************ | |
# aws cli must be installed. | |
# | |
set -e |