Skip to content

Instantly share code, notes, and snippets.

View m-espinoza's full-sized avatar
♟️

Manuel Espinoza m-espinoza

♟️
View GitHub Profile
@edthix
edthix / ssh_tunnel_postgres.py
Created December 11, 2019 08:12
Sample airflow dag for ssh tunnel + postgres (assuming both SERVER_ssh_connector and SERVER_ssh_postresql_tunnel_connector are available)
from datetime import timedelta, datetime
import airflow
from airflow import DAG
from airflow.models import Variable
from airflow.contrib.operators.ssh_operator import SSHOperator
from airflow.contrib.hooks.ssh_hook import SSHHook
from airflow.operators.postgres_operator import PostgresOperator
default_args = {
'owner': 'airflow',
@toledorobia
toledorobia / validate_email.sql
Last active August 14, 2023 04:45
MySQL - Validate email
SELECT *
FROM user
WHERE email NOT REGEXP '^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9_\-]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$'