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 | |
DBNAME="dbname" | |
tables=$(psql -d $DBNAME -t -c "SELECT table_name FROM information_schema.tables WHERE table_schema='public' and table_type='BASE TABLE'"|cut -d' ' -f2) | |
while IFS= read -r table; do | |
pg_dump --schema-only -t $table $DBNAME > $table.schema | |
pg_dump --data-only -t $table $DBNAME > $table.data | |
done <<< "$tables" |
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 | |
# PURPOSE: Compare if two directories have the same source code in all branches | |
# WHY?: Ensure that bgf has not altered the code after running | |
# HOW?: Easy! dir1 is the original untouched repo, dir2 is what have been altered by BFG. | |
# 1. From untouched directory, grab all the branches and iterate over them | |
# 2. Magic happens in compare_branch_and_sha: checkout to that branch and get an md5sum of all files for each directory. | |
# 3. The output is self-explanatory! | |
# Thanks to https://rtyley.github.io/bfg-repo-cleaner/ for that awesome and magic project :) | |
dir1=$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
" no vi-compatible | |
set nocompatible | |
" Setting up Vundle - the vim plugin bundler | |
let iCanHazVundle=1 | |
let vundle_readme=expand('~/.vim/bundle/vundle/README.md') | |
if !filereadable(vundle_readme) | |
echo "Installing Vundle.." | |
echo "" | |
silent !mkdir -p ~/.vim/bundle | |
silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle |
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
hola | |
Retenciones automaticas que no tienen tax_app_id | |
================================================ | |
test_arg=> SELECT rtl.name, r.type, round(((round(rtl.amount,2)/round(rtl.base,2))*100),2) as percentage | |
FROM retention_tax_line rtl | |
JOIN retention_retention r | |
ON rtl.retention_id=r.id | |
JOIN account_tax at | |
ON r.tax_id=at.id | |
WHERE rtl.manual=false /* Solo automaticas */ |
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
``` | |
COPY(SELECT rp.name AS Partner, rpa.name as Contact_Name, rpa.street, rpa.street2, rpa.city, rpa.zip, rcs.name as state, rc.name as country FROM res_partner_address rpa | |
JOIN res_partner rp ON rpa.partner_id=rp.id | |
JOIN res_country rc ON rpa.country_id=rc.id | |
JOIN res_country_state rcs ON rpa.state_id=rcs.id | |
WHERE rpa.type IS NULL AND rpa.active IS True | |
ORDER BY rp.name) | |
TO '/tmp/res_partner_address_type_null.csv' DELIMITER ',' CSV HEADER; | |
``` |