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
[alias] | |
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg = !"git lg1" | |
[color] | |
ui = auto |
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
#Add to .bashrc | |
#Usage: npmdeps <package>[@<version>] | |
function npmdeps { | |
regex="^[- |]*$" | |
regex_space="^ *$" | |
regex_github="github\.com" | |
if [[ "$1" =~ $regex ]]; then | |
return | |
else | |
DEPS=`npm info $1 dependencies|perl -0777 -pe 's/^.*{//gs'|perl -0777 -pe 's/}.*$//gs'| sed "s/[\{\}' ]//g" | sed 's/, \?/\n/g' | sed "s/:/@/g"` |
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
#add new dependency | |
cd github-mirror | |
git submodule add <url/ssh> <namespace>/<project-name>/<branch> | |
cd <namespace>/<project-name>/<branch> | |
git checkout <branch> | |
cd .. | |
git add <branch> | |
git commit -m "Adding <namespace>/<project-name>/<branch>" | |
cd <branch> |
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
asset 'bootstrap-sass-official' | |
asset 'angular', '~> 1.4' | |
#asset 'angular-mocks' |
I hereby claim:
- I am bushong1 on github.
- I am charlesbushong (https://keybase.io/charlesbushong) on keybase.
- I have a public key whose fingerprint is F770 07AF 538B 48F9 BF1B 4672 6A1E 5661 6626 23F0
To claim this, I am signing this object:
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 aws-rm-ami-snap() { | |
if [[ ${1} == ami-* ]]; then | |
AMI_ID=${1} | |
SNAPSHOT_IDS=$(aws ec2 describe-images --filters Name=image-id,Values=${1} | jq '.Images[].BlockDeviceMappings[].Ebs.SnapshotId' | sed 's/"//g') | |
aws ec2 deregister-image --image-id ${AMI_ID} | |
for snapshot_id in ${SNAPSHOT_IDS}; do | |
aws ec2 delete-snapshot --snapshot-id ${snapshot_id} | |
done | |
else | |
echo "ERROR: Require \$1 to be an AMI ID, starting with 'ami-'" |
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
Parameters: | |
PapertrailEndpoint: | |
Type: String | |
Default: logsX.papertrailapp.com:XXXXX | |
Resources: | |
LaunchConfig: | |
Properties: | |
... | |
UserData: | |
Fn::Base64: !Sub | |
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 -e | |
# Usage: | |
# 1) Build the AWS CLI into your container | |
# 2) Set your region, or pass env into the container | |
export AWS_DEFAULT_REGION=us-east-1 | |
function usage () { | |
echo "Usage: Container must be run with the following 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
ARG MY_ARG | |
RUN : "${MY_ARG:?ERROR - MY_ARG Build argument needs to be set and non-empty.}" |
OlderNewer