Skip to content

Instantly share code, notes, and snippets.

View ImLoaD's full-sized avatar
🎯
Focusing

Andrew ImLoaD

🎯
Focusing
  • Singapore
View GitHub Profile
@ImLoaD
ImLoaD / ultimate-ut-cheat-sheet.md
Created September 28, 2016 11:05 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@ImLoaD
ImLoaD / export_db_schema.sh
Created August 3, 2021 19:16
Export database schema from PostgreSQL
#!/bin/sh
DEFAULT_DB_NAME="my_web_admin"
read -p "Enter the database name to make schema dump [$DEFAULT_DB_NAME]" DB_NAME
DB_NAME=${name:-$DEFAULT_DB_NAME}
FILE_NAME=${DB_NAME}_schema.sql
echo "I will create a file called $FILE_NAME"
pg_dump -h localhost -U postgres -s $DB_NAME > "$FILE_NAME"
@ImLoaD
ImLoaD / export_table.sh
Last active August 4, 2021 19:46
Export table from PostgreSQL
#!/bin/sh
# Prepare names
DEFAULT_DB_NAME="my_web_admin"
read -p "Enter database name [$DEFAULT_DB_NAME]: " DB_NAME
DB_NAME=${name:-$DEFAULT_DB_NAME}
read -p "Enter table name in db '$DB_NAME' name to make schema dump: " TABLE_NAME
DIR_NAME="$DB_NAME"
# Exit if table name not writen