Create dump:
docker exec -i CONTAINER_NAME /bin/bash -c "PGPASSWORD=DATABASE_PASSWORD pg_dump --username DATABASE_USER -h RDS_HOST DATABASE_NAME" > ./dump.sqlCreate local db to restore dump:
create database "db-restored"| { | |
| "diffEditor.ignoreTrimWhitespace": false, | |
| "editor.codeActionsOnSave": { | |
| "source.fixAll.eslint": "explicit" | |
| }, | |
| "editor.codeLens": true, | |
| "editor.columnSelection": false, | |
| "editor.detectIndentation": false, |
| "use strict"; | |
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // choose either `'stable'` for receiving highly polished, | |
| // or `'canary'` for less polished but more frequent updates | |
| updateChannel: 'stable', | |
| // default font size in pixels for all tabs |
Create dump:
docker exec -i CONTAINER_NAME /bin/bash -c "PGPASSWORD=DATABASE_PASSWORD pg_dump --username DATABASE_USER -h RDS_HOST DATABASE_NAME" > ./dump.sqlCreate local db to restore dump:
create database "db-restored"| Pega esse desafio: | |
| Faça a soma de todos os produtos de todas as compras sem usar laços (loops - for, foreach, etc). | |
| Use apenas map, reduce, recursão, etc. | |
| const data = { | |
| compras: [ | |
| { | |
| data: '2022-01-01', | |
| produtos: [ |
| #!/bin/env zsh | |
| team_total=$(git shortlog -s -n |sed 's/\t/,/g'|cut -f1 -d, |bc -l|awk '{sum+=$1}END{print sum}'); | |
| tmp_counter='/tmp/counter.txt'; | |
| tmp_user='/tmp/users.txt'; | |
| tmp_percentage='/tmp/counters_users' | |
| # if you are running this again it make the file empty or you can rm it | |
| rm $tmp_percentage $tmp_user $tmp_counter | |
| git shortlog -s -n |sed 's/\t/,/g'|cut -f2 -d, >>$tmp_user; | |
| git shortlog -s -n |sed 's/\t/,/g'|cut -f1 -d, >>$tmp_counter; |
| // Examples of https://medium.com/@alvaro.saburido/set-theory-for-arrays-in-es6-eb2f20a61848 | |
| const arrA = [1, 3, 4, 5]; | |
| const arrB = [1, 2, 5, 6, 7]; | |
| const intersection = arrA.filter((x) => arrB.includes(x)); | |
| console.log('Intersection: ', intersection); | |
| console.log('Expected: [1,5]'); | |
| const difference = arrA.filter((x) => !arrB.includes(x)); | |
| console.log('\nDifference: ', difference); |
| const arrA = [1, 3, 4, 5]; | |
| const arrB = [1, 2, 5, 6, 7]; | |
| const intersection = arrA.filter((x) => arrB.includes(x)); | |
| console.log('intersection', intersection); | |
| // Output => intersection [ 1, 5 ] | |
| const differenceA = arrA.filter((x) => !arrB.includes(x)); | |
| console.log('differenceA', differenceA); | |
| // Output => difference [ 3, 4 ] |
| [global_config] | |
| title_font = Ubuntu 9 | |
| title_receive_bg_color = "#8be9fd" | |
| title_transmit_bg_color = "#ff5555" | |
| [keybindings] | |
| split_horiz = <Primary><Alt>e | |
| [layouts] | |
| [[default]] | |
| [[[child1]]] | |
| parent = window0 |
| // Execute: node spread-destructuring-rest-operator.js | |
| // #### Spread Operator #### | |
| const e1 = 'CODE'; | |
| const r1 = [...e1]; | |
| console.log('[01]', r1) | |
| // Output => [ 'C', 'O', 'D', 'E' ] | |
| const e2 = ['This', 'is', 'a', 'sentence']; | |
| console.log('[02]', ...e2); |
| #!/bin/bash | |
| # Reference: https://superuser.com/a/12976 | |
| if [[ $# -lt 1 ]] ; then | |
| echo "Usage: findhardlinks <fileOrDirToFindFor> ..." | |
| exit 1 | |
| fi | |
| while [[ $# -ge 1 ]] ; do | |
| echo "Processing '$1'" |