Skip to content

Instantly share code, notes, and snippets.

View vampyar's full-sized avatar
🎯
Focusing

Yaromir vampyar

🎯
Focusing
View GitHub Profile
@vampyar
vampyar / javascript
Last active March 30, 2018 17:24
customFlatten
const customFlatten = (arr) => {
return arr.reduce((initFlat, toFlat) => {
return initFlat.concat(Array.isArray(toFlat) ? customFlatten(toFlat) : toFlat);
}, [])
};
@vampyar
vampyar / pg_dump.sh
Last active March 31, 2023 10:28
Create dump from remote RDS
// create dump from remote service not using local pg client
docker exec -i postgres_container bash -c "pg_dump --dbname=postgresql://$PGUSER:$PGPASSWORD@$PGHOST:$PGPORT/$PGDB" > /asbolute/direction/path/dump.sql
// for apply dump on the local db
docker exec -i postgres_container psql -U postgres local_db_name < /Users/vampyar/Projects/Careclix/dump.sql
@vampyar
vampyar / exports.sh
Created May 16, 2023 19:34
# Export the vars in .env into your shell
export $(egrep -v '^#' .env | xargs)
@vampyar
vampyar / npm.bash
Created May 24, 2023 11:06
install all node dependencies in the root directory
find . -type d -name node_modules -prune -o -name 'package.json' -exec dirname {} \; | xargs -I{} sh -c 'cd "{}" && npm i'