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 bash | |
# This will receive arguments of number of commits to squash | |
# and use the earliest commit message as the new commit message | |
# Function to show usage | |
show_usage() { | |
echo "Usage: ./git-squash.sh <number_of_commits>" | |
echo "Example: ./git-squash.sh 3" | |
exit 1 | |
} |
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 bash | |
# This script will find all files in the current directory and rename them using UUID and flatten the directory structure. | |
# This script is useful when you have a directory structure like this: | |
# src/dir1/dir2/dir3/file1.txt | |
# src/dir1/dir2/dir4/file2.txt | |
# src/dir1/dir2/file3.txt | |
# | |
# And you want to flatten it to this: |
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 bash | |
# Requirements | |
# - AWS | |
# - jq | |
# Variables | |
PROFILE= | |
DISTRIBUTION_ID= | |
PATHS="/*" |
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 bash | |
# Load environment variables from 1password | |
# To execute this script, execute the command below. | |
# source 1passwordtoenv.sh 'Name of the item' | |
ITEM_NAME=$1 | |
# Signin | |
eval $(op signin) | |
# Load environment variables |
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 bash | |
# Sometimes we create a lot of S3 Bucket with similar names. | |
# The command below will find all buckets in the region with pattern `bucket_pattern`, | |
# then empty the bucket and then delete the bucket. | |
BUCKET_PATTERN=bucket_pattern | |
aws s3api list-buckets |\ | |
jq -r '.Buckets[].Name' |\ | |
grep $BUCKET_PATTERN |\ | |
xargs -n 1 -I {} sh -c 'aws s3 rm s3://{} --recursive && aws s3 rb s3://{}' |
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
#!/bin/bash | |
# Resize disk for AWS Cloud9 | |
# https://docs.aws.amazon.com/cloud9/latest/user-guide/move-environment.html#move-environment-resize | |
# Specify the desired volume size in GiB as a command line argument. If not specified, default to 20 GiB. | |
SIZE=${1:-20} | |
# Get the ID of the environment host Amazon EC2 instance. | |
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data/instance-id) |
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
version: '3' | |
services: | |
php: | |
build: . | |
volumes: | |
- ~/.composer-docker/cache:/root/.composer/cache:delegated | |
- ./:/app:delegated | |
ports: | |
- '8080:80' | |
environment: |
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
Resources: | |
ecsCluster15812518: | |
Type: AWS::ECS::Cluster | |
Metadata: | |
aws:cdk:path: WebStack/ecsCluster/Resource | |
ecsClusterVpcFF32B42F: | |
Type: AWS::EC2::VPC | |
Properties: | |
CidrBlock: 10.0.0.0/16 | |
EnableDnsHostnames: true |
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 node | |
import 'source-map-support/register'; | |
import cdk = require('@aws-cdk/core'); | |
import ecs = require("@aws-cdk/aws-ecs"); | |
import ecsPatterns = require("@aws-cdk/aws-ecs-patterns"); | |
export class WebStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
this.createECSCluster(); |
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
diff --git a/.dockerignore b/.dockerignore | |
new file mode 100644 | |
index 0000000..b2ef806 | |
--- /dev/null | |
+++ b/.dockerignore | |
@@ -0,0 +1 @@ | |
+cdk.out | |
\ No newline at end of file | |
diff --git a/.gitignore b/.gitignore | |
index 5bd9be8..8600814 100644 |
NewerOlder