Skip to content

Instantly share code, notes, and snippets.

View alzalabany's full-sized avatar
🥕
Building something cool!

Momen Zalabany alzalabany

🥕
Building something cool!
View GitHub Profile
@alzalabany
alzalabany / docker-compose-backup.sh
Created April 18, 2020 19:56 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
# Fully backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
project_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
cd "$project_dir"
project_name=$(basename "$project_dir")
backup_time=$(date +"%Y-%m-%d_%H-%M")
backup_dir="$project_dir/data/backups/$backup_time"
@alzalabany
alzalabany / settings.json
Last active March 2, 2020 09:47
vscode settings
{
"workbench.iconTheme": "vscode-icons",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"eslint.format.enable": true,
"eslint.packageManager": "yarn",
"typescriptHero.imports.organizeOnSave": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
/* generated using http://www.network-science.de/ascii/ */
```js
// _ _ _____ ____ _ _ _____ _______
// _| || |_ / ____|/ __ \ | \ | | / ____||__ __|
// |_ __ _| | | | | | || \| || (___ | |
// _| || |_ | | | | | || . ` | \___ \ | |
// |_ __ _| | |____| |__| || |\ | ____) | | |
// |_||_| \_____|\____/ |_| \_||_____/ |_|
var Promise = require('bluebird'),
mysql = require('mysql'),
using = Promise.using;
Promise.promisifyAll(require("mysql/lib/Connection").prototype);
Promise.promisifyAll(require("mysql/lib/Pool").prototype);
var env = (process.env.NODE_ENV == 'production') ? 'prod': 'dev';
var pools = {};
var base = {