This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isObject = item => item && typeof item === 'object' && !Array.isArray(item); | |
const path = ([...paths], obj) => { | |
const tmp = obj[paths.shift()]; | |
return !isObject(tmp) || !paths.length ? tmp : path(paths, tmp); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --detach --name instance-of-mysql -p 3306 -e MYSQL_ROOT_PASSWORD=secretPw -d mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT IN tablename (id, val1, val2) VALUES (1, 'a', 'b') | |
ON DUPLICATE KEY UPDATE val1 = 'a', val2 = 'b'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
try_files $uri $uri/ /index.html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xattr -rc ./*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download copy of database from remote host | |
mongodump --host mongo.hostname.com --db database-name --port 27017 --username user --password pwd --out /opt/backup/mongodump | |
# Restore copy of database to remote host | |
mongorestore --host mongo.hostname.com --db database-name --port 27017 --username user --password pwd /opt/backup/mongodump/database-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
*/5 * * * * /path/to/job/to/run/every/five/minutes | |
0 9 * * * /path/to/job/to/run/every/day/at/9am | |
0 9 * * * . /source/doesnt/work/so/use/dot/script.sh | |
0 9 * * * /path/script.sh >> /var/log/output_and_errors.log 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df -h /home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -hc ./*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git pull --rebase upstream master |