Skip to content

Instantly share code, notes, and snippets.

View m4n3z40's full-sized avatar
📈
Multi-tasking

Allan Marques Baptista m4n3z40

📈
Multi-tasking
View GitHub Profile
@m4n3z40
m4n3z40 / media_pedidos_por_segundo.sql
Last active December 3, 2021 21:32
Queries úteis do BQ
WITH diff_seconds AS (
SELECT o.order_id, o.date, DATE_DIFF(date, LAG(date) OVER (ORDER BY date), SECOND) diff
FROM `bi-data-science.DW.order` o
JOIN `bi-data-science.DW.order_item` oi ON o.order_id = oi.order_id
WHERE date >= '2021-01-01' AND
date <= '2021-10-31'
AND o.status_name NOT IN ('Recusado', 'Cancelado', 'Recusado por inconsistência de dados')
AND oi.sku_type IN ('LGPKG', 'LGTKT')
AND o.pos = 'BR'
GROUP BY o.order_id, o.date
@m4n3z40
m4n3z40 / useful_docker_commands.sh
Created May 24, 2021 21:31
Comandos úteis do docker
# Remover todas imagens com um nome ou padrão (usando wildcard *) específico
docker rmi -f $(docker images --filter=reference="{{NOME}}:{{TAG}}" -q)