Skip to content

Instantly share code, notes, and snippets.

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

Donny O ostriandoni

🏠
Working from home
View GitHub Profile
@ostriandoni
ostriandoni / mysql-docker.sh
Created June 25, 2021 03:47
Backup and restore a mysql database from a running Docker mysql container
# backup
docker exec -i myapp-mysql mysqldump -u root -pPASSWORD DATABASE > backup.sql
tar -czvf backup.tar.gz backup.sql
# restore
tar -zxvf backup.tar.gz
sed -i -n -e '2,$p' backup.sql # remove warning message => mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1064 (42000) at line 1
docker exec -i myapp-mysql mysql -u root -pPASSWORD DATABASE < backup.sql
@ostriandoni
ostriandoni / settings.json
Created January 10, 2019 10:48
vscode settings
{
"workbench.colorTheme": "Andromeda Colorizer",
"workbench.iconTheme": "material-icon-theme",
"window.title": "${activeEditorLong}${separator}${rootName}",
"window.zoomLevel": -1,
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
"editor.rulers": [
100
],
@ostriandoni
ostriandoni / ultimate-ut-cheat-sheet.md
Created June 26, 2018 01:33 — 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


@ostriandoni
ostriandoni / swagger-yaml-to-html.py
Created June 23, 2018 04:54 — forked from oseiskar/swagger-yaml-to-html.py
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
#!/usr/bin/python
"""
Usage:
python swagger-yaml-to-html.py < /path/to/api.yaml > doc.html
"""
import yaml, json, sys
TEMPLATE = """
@ostriandoni
ostriandoni / sql-mongo-comparison.md
Last active May 26, 2018 05:17 — forked from aponxi/sql-mongo_comparison.md
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@ostriandoni
ostriandoni / secretkey.js
Created April 26, 2018 07:20
Generate Secret Key in Node.js
const crypto = require('crypto')
const secretKey = crypto.randomBytes(8).toString('hex')
console.log(secretKey)