Skip to content

Instantly share code, notes, and snippets.

@alxthm
alxthm / meltano_make_crontab.py
Last active August 12, 2022 20:34
Python script to transform meltano schedules from a json format into a crontab file
import json
import logging
import os
import sys
from pathlib import Path
from typing import List
"""
Transform meltano schedules from a json format into a crontab file.
@stkbailey
stkbailey / meltano-elt-template.yml
Last active September 21, 2023 06:07
Deploying Meltano on Argo Workflows
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: meltano-elt-template
spec:
entrypoint: run-elt
arguments:
parameters:
- name: extractor_name
- name: loader_name
@diegovalle
diegovalle / mapa_covid.R
Created April 15, 2020 16:00
Mapa de casos COVID-19
## Auto-Install the following packages
.packs <- c("tidyverse", "lubridate", "ggrepel", "viridis", "scales")
.success <- suppressWarnings(sapply(.packs, require, character.only = TRUE))
if (length(names(.success)[!.success])) {
install.packages(names(.success)[!.success])
sapply(names(.success)[!.success], require, character.only = TRUE)
}
if (!require(mxmaps))
devtools::install_github("diegovalle/mxmaps")
library(mxmaps)
@bradtraversy
bradtraversy / django_deploy.md
Last active July 18, 2024 16:48
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@fredbenenson
fredbenenson / kickstarter_sql_style_guide.md
Last active June 24, 2024 03:28
Kickstarter SQL Style Guide
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@hest
hest / gist:8798884
Created February 4, 2014 06:08
Fast SQLAlchemy counting (avoid query.count() subquery)
def get_count(q):
count_q = q.statement.with_only_columns([func.count()]).order_by(None)
count = q.session.execute(count_q).scalar()
return count
q = session.query(TestModel).filter(...).order_by(...)
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ...
print q.count()
@waynemoore
waynemoore / month_day_range.py
Created July 27, 2011 11:01
Get first and last day of a particular month using python-dateutil.
import datetime
# requires python-dateutil (http://labix.org/python-dateutil)
from dateutil.relativedelta import relativedelta
def get_month_day_range(date):
"""
For a date 'date' returns the start and end date for the month of 'date'.
Month with 31 days: