Skip to content

Instantly share code, notes, and snippets.

View adamhaney's full-sized avatar
🎯
Focusing

Adam Haney adamhaney

🎯
Focusing
View GitHub Profile
@adamhaney
adamhaney / dag.py
Created June 14, 2017 18:10
DBT Airflow DAG with model/graph introspection
from datetime import datetime, timedelta
import networkx as nx
from airflow import DAG
from airflow.operators import BashOperator, SubDagOperator
start_date = datetime(year=2017, month=6, day=13, hour=19, minute=0)
schedule_interval = '0 * * * 1-5'
default_args = {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamhaney
adamhaney / fabfile.py
Last active December 17, 2015 16:29 — forked from jaredlewis/fabfile.py
def deploy():
execute(__backup__)
execute(__pull__)
execute(__install_requirements__)
execute(syncdb)
execute(collectstatic)
execute(restart)
execute(newrelic)
@adamhaney
adamhaney / pushups.sh
Created January 16, 2013 16:29
A bash script to remind you to do pushups during work hours on OS X and Linux
#!/bin/bash
# pushup.sh
#
# Cron entry, weekdays on the hour from 8am-7pm
# m h dom mon dow command
# 0 8-19 * * 1-5 bash pushup.sh
# Minimum number of pushups you want to do
MINUPS=10
from multiprocessing import Pool
p = Pool()
p.map(lambda x: x, [1, 2, 3])