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
#!/usr/bin/env python3 | |
import argparse | |
import datetime as dt | |
import os.path | |
from google.auth.transport.requests import Request | |
from google.oauth2.credentials import Credentials | |
from google_auth_oauthlib.flow import InstalledAppFlow |
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
version: '3.5' | |
services: | |
postgres: | |
container_name: postgres_container | |
image: postgres | |
environment: | |
POSTGRES_USER: ${POSTGRES_USER:-postgres} | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} | |
POSTGRES_DB: ${POSTGRES_DB:-app_db} |
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
[tool.poetry] | |
name = "airflow-dbt2" | |
version = "0.1.0" | |
description = "" | |
authors = ["Your Name <[email protected]>"] | |
readme = "README.md" | |
[tool.poetry.dependencies] | |
python = "^3.10" |
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
select format_datetime(current_timestamp, 'YYYY-MM-dd''T''HH:mm''Z''') |
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
WITH CTE AS ( | |
SELECT | |
concat( | |
substr('20220416T070044.243Z', 1, 4), '-', | |
substr('20220416T070044.243Z', 5, 2), '-', | |
substr('20220416T070044.243Z', 7, 2), 'T', | |
substr('20220416T070044.243Z', 10, 2), ':', | |
substr('20220416T070044.243Z', 12, 2), ':', | |
substr('20220416T070044.243Z', 14) | |
) as ts |
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
import logging | |
from sqlalchemy.sql import text | |
_logger = logging.getLogger(__name__) | |
class ArchivableMixin: | |
"""Model which can be duplicated via one special materialized view""" |
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
# show only icons on the dock that belong to app in the current workspace | |
gsettings set org.gnome.shell.app-switcher current-workspace-only true | |
gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true | |
gsettings set org.gnome.shell.extensions.dash-to-dock isolate-monitors true | |
# https://varhowto.com/forum-topic/ubuntu-dock-how-to-show-windows-in-current-workspace-only/ | |
# https://askubuntu.com/questions/1068097/separate-workspaces-in-ubuntu-18-04-desktop |
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 | |
# install pyenv dependencies | |
sudo apt-get install git make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev curl | |
# install pyenv | |
curl https://pyenv.run | bash | |
echo 'eval "$(pyenv init -)"' >> ~/.bashrc |
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
import os, subprocess | |
from getpass import getpass | |
def is_root(): | |
return os.geteuid() == 0 | |
def test_sudo(pwd=""): | |
args = "sudo -S echo OK".split() | |
kwargs = dict(stdout=subprocess.PIPE, | |
encoding="ascii") |
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
From de641d9474417203e707c0932185c1dccfd39e96 Mon Sep 17 00:00:00 2001 | |
From: Yurdik Cervantes <[email protected]> | |
Date: Wed, 4 Dec 2019 12:16:48 +0100 | |
Subject: [FIX] ignore duplicated rows for translation imports | |
In the cases where conflicting translation rows are imported (for | |
example `.po` vs `.pot` files) the import queries during the database | |
update fail with one stop error. | |
With this change, just one of the duplicated rows to import is left, |
NewerOlder