View invalidate_cloudfront_and_wait.sh
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="/*" |
View 1passwordtoenv.sh
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 |
View Dockerfile
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: |
View aws-batch-empty-delete.bash
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://{}' |
View gist:d1dd6f83d1d64204d454fb30fb94b0c9
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) |
View CitySpinner.java
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
package net.petrabarus.testandroid.dynamicdatabinding; | |
import android.content.Context; | |
import android.databinding.BindingAdapter; | |
import android.databinding.InverseBindingAdapter; | |
import android.databinding.InverseBindingListener; | |
import android.databinding.InverseBindingMethod; | |
import android.databinding.InverseBindingMethods; | |
import android.databinding.Observable; | |
import android.util.AttributeSet; |
View command.sh
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 | |
seq 10 | xargs -I X bash -c "echo X \$RANDOM" |
View Webstack.template.yml
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 |
View modern-yii1-app_part-1.patch
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 |
View app.ts
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(); |
NewerOlder