Skip to content

Instantly share code, notes, and snippets.

View lawson-ng's full-sized avatar
📖
hmmm_____.

lawson-ng lawson-ng

📖
hmmm_____.
View GitHub Profile
#!/bin/bash
set -e
set -u
function create_user_and_database() {
local database=$1
echo " Creating user and database '$database'"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER $database;

THIS PROJECT IS IN MAINTENANCE MODE. We accept pull-requests for Bug Fixes ONLY. NO NEW FEATURES ACCEPTED!

Description

Related Issue

@lawson-ng
lawson-ng / git.md
Created November 7, 2022 03:14
Delete branches which do not existing in remote
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D
@lawson-ng
lawson-ng / The entire table of ANSI color codes.
Last active January 15, 2022 17:08
The entire table of ANSI color codes.
# Regular Colors
| Value | Color |
| -------- | ------ |
| \e[0;30m | Black |
| \e[0;31m | Red |
| \e[0;32m | Green |
| \e[0;33m | Yellow |
| \e[0;34m | Blue |
| \e[0;35m | Purple |
@lawson-ng
lawson-ng / docker-compose.yaml
Created November 29, 2021 15:43
Docker compose for local stack
version: "2.1"
services:
localstack:
image: localstack/localstack:0.12.19.1
ports:
- "4566:4566"
environment:
- SERVICES=dynamodb
- DATA_DIR=/tmp/localstack/data
@lawson-ng
lawson-ng / docker-compose.yml
Last active November 29, 2021 06:06
Docker compose for mysql and admier
version: "2.1"
mysql:
image: mysql:5.7
restart: always
ports:
- '3307:3306'
container_name: dev-mysql
environment:
MYSQL_ROOT_PASSWORD: password
@lawson-ng
lawson-ng / docker-compose.yml
Last active November 30, 2021 03:18
Docker compose for dynamoDB and dynamo-admin
version: '3.7'
services:
dynamoDB-local:
image: amazon/dynamodb-local:1.13.6
ports:
- '4569:8000'
dynamo-admin:
image: aaronshaf/dynamodb-admin
environment: