Skip to content

Instantly share code, notes, and snippets.

View vietch2612's full-sized avatar
🏠
Working from home

Viet Cao (Ross) vietch2612

🏠
Working from home
View GitHub Profile
public class Shape {}
public class Circle extends Shape {
private double radius;
}
public class Square extends Shape {
private double height;
}
public class AreaDisplay {
public double calculateArea(Shape shape) {
if (shape instanceof Circle) {
@vietch2612
vietch2612 / keybase.md
Last active September 10, 2019 10:43
keybase verification

Keybase proof

I hereby claim:

  • I am vietch2612 on github.
  • I am hoaiviet (https://keybase.io/hoaiviet) on keybase.
  • I have a public key ASCrpuKRREIfbnjJlsNivC1kJkjTCyv12Pwvo9yMAVIXxgo

To claim this, I am signing this object:

@vietch2612
vietch2612 / restore.sh
Last active July 14, 2021 06:44 — forked from jgillman/restore.sh
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db