Skip to content

Instantly share code, notes, and snippets.

View yesenarman's full-sized avatar

Arman Yessenamanov yesenarman

View GitHub Profile
@yesenarman
yesenarman / dotenv.bashrc
Created February 15, 2023 20:12
Shell utility command to load .env files in current terminal session
dotenv () {
[ -f "$1".env ] && export $(egrep -v "^#" "$1".env | xargs) || echo "dotenv: $1.env: No such file or directory"
}
@yesenarman
yesenarman / export_csv.sql
Last active February 7, 2023 11:14
Export CSV data from PostgreSQL table
COPY (
SELECT * FROM table
)
TO STDOUT WITH (FORMAT CSV, HEADER TRUE, FORCE_QUOTE *)