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
# The initial version | |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi | |
# My favorite from the comments. Thanks @richarddewit & others! | |
set -a && source .env && set +a |
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
Backup: | |
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
Restore: | |
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
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
export function postData (url, params, fileURL) { | |
let data = new FormData() | |
if (fileURL) { | |
data.append('image', {uri: fileURL, name: 'image.jpg', type: 'image/jpg'}) | |
} | |
_.each(params, (value, key) => { | |
if (value instanceof Date) { | |
data.append(key, value.toISOString()) | |
} else { | |
data.append(key, String(value)) |
- Introdução
- O que é Docker ?
- O que diferencia um container de uma máquina virtual ?
- O que são Namespaces ?
- Para que serve o Cgroups ?
- O que é Union file systems ?
- Explorando o Docker
- Instalação
- Hello, Docker!
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
#!/bin/bash | |
echo "" > /tmp/azk-agent-start.log | |
./bin/azk agent start --no-daemon > /tmp/azk-agent-start.log 2>&1 & | |
AGENT_PID="$!" | |
tail -f /tmp/azk-agent-start.log & | |
TAIL_PID="$!" | |
echo "PIDS - agent: ${AGENT_PID}, tail: ${TAIL_PID}"; | |
until tail -1 /tmp/azk-agent-start.log | grep -q 'Agent has been successfully started.'; do | |
sleep 2; |
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
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
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
{ | |
"requireCurlyBraces": ["else", "for", "while", "do", "try", "catch"], | |
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], | |
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], | |
"disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], | |
"requireRightStickedOperators": ["!"], | |
"requireLeftStickedOperators": [","], | |
"disallowImplicitTypeConversion": ["string"], | |
"disallowKeywords": ["with"], | |
"disallowMultipleLineBreaks": true, |
NewerOlder