This file contains hidden or 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
SELECT | |
schemaname, | |
relname as "Table", | |
pg_size_pretty(pg_total_relation_size(relid)) As "Size", | |
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size" | |
FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC; |
This file contains hidden or 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
select count(*) from | |
tb_lotacao le where le.ctid <> (select min(li.ctid) from tb_lotacao li | |
where li.co_pessoa = le.co_pessoa and li.ds_mes_ano = le.ds_mes_ano and li.co_unidade = le.co_unidade) |
This file contains hidden or 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
public static <T> Collector<T, ?, List<T>> lastN(int n) { | |
return Collector.<T, Deque<T>, List<T>>of(ArrayDeque::new, (acc, t) -> { | |
if(acc.size() == n) | |
acc.pollFirst(); | |
acc.add(t); | |
}, (acc1, acc2) -> { | |
while(acc2.size() < n && !acc1.isEmpty()) { | |
acc2.addFirst(acc1.pollLast()); | |
} | |
return acc2; |
This file contains hidden or 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: web | |
namespace: default | |
spec: | |
selector: | |
matchLabels: | |
run: web | |
template: |
This file contains hidden or 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
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: ingress-ih | |
namespace: default | |
spec: | |
rules: | |
- host: web.meudominio.com.br | |
http: | |
paths: |
This file contains hidden or 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 branch -D `git branch --merged | grep -v \* | xargs` |
This file contains hidden or 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
#!/usr/bin/env bash | |
function copy_text_to_pod() { | |
namespace=$1 | |
pod_name=$2 | |
src_filename=$3 | |
dest_filename=$4 | |
base64_text=`cat $src_filename | base64` | |
kubectl --kubeconfig=conasems-config.yml exec -n $namespace $pod_name -- bash -c "echo \"$base64_text\" | base64 -d > $dest_filename" |
This file contains hidden or 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 INTO dm_time (co_dm_time, epoch, day_suffix, day_name, day_of_week, day_of_month, day_of_quarter, day_of_year, week_of_month, week_of_year, week_of_year_iso, month_actual, month_name, month_name_abbreviated, quarter_actual, quarter_name, year_actual, first_day_of_week, last_day_of_week, first_day_of_month, last_day_of_month, first_day_of_quarter, last_day_of_quarter, first_day_of_year, last_day_of_year, mmyyyy, mmddyyyy, weekend_indr) | |
SELECT datum AS date_actual, | |
EXTRACT(EPOCH FROM datum) AS epoch, | |
TO_CHAR(datum, 'fmDDth') AS day_suffix, | |
TO_CHAR(datum, 'TMDay') AS day_name, | |
EXTRACT(ISODOW FROM datum) AS day_of_week, | |
EXTRACT(DAY FROM datum) AS day_of_month, | |
datum - DATE_TRUNC('quarter', datum)::DATE + 1 AS day_of_quarter, | |
EXTRACT(DOY FROM datum) AS day_of_year, | |
TO_CHAR(datum, 'W')::INT AS week_of_month, |
This file contains hidden or 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
from thinc.api import Config | |
import spacy | |
DEFAULT_CONFIG_STR = """ | |
[transformer] | |
max_batch_items = 4096 | |
[transformer.set_extra_annotations] | |
@annotation_setters = "spacy-transformers.null_annotation_setter.v1" |
This file contains hidden or 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
import sys | |
import threading | |
class ProgressPercentage(object): | |
''' Progress Class | |
Class for calculating and displaying download progress | |
''' | |
def __init__(self, client, bucket, filename): | |
''' Initialize |