Skip to content

Instantly share code, notes, and snippets.

@andscoop
andscoop / list_comprehension_templating.py
Created October 19, 2017 14:57
Should I loop or use is this list comphrension easier to read?
def create_path(self, field_path):
base = "\"${}\""
# Create a template for each value in array
# reasonable assume iether str or int will be passed
tmplts = ["['{}']" if isinstance(path, str) else "[{}]" for path in field_path ]
paths = [tmplts[i].format(field_path[i]) for i in range(len(field_path))]
full_path = ''.join(paths)
return base.format(full_path)
@andscoop
andscoop / log_example.py
Created November 15, 2017 19:02
simple method for logging
def log(**kwargs):
print(json.dumps(kwargs))
log(articleId='test_article', message='this is a message')
@andscoop
andscoop / grocery_list.md
Last active November 19, 2017 18:40
grocery_list
  • Kirkland Signature Normandy-Style Vegetables
  • Frozen Chicken Breast
  • Morningstar Blackbean Burgers
  • Hardboiled Eggs
  • Lasagna

Keybase proof

I hereby claim:

  • I am andscoop on github.
  • I am andscoop (https://keybase.io/andscoop) on keybase.
  • I have a public key whose fingerprint is 6EE9 E58F E2A7 9BCE CAA1 FC16 6729 96DE 18FC 1225

To claim this, I am signing this object:

@andscoop
andscoop / .keys
Created February 17, 2018 14:10
fix nice-editor (ne) backspace issue
KEY 0x7f BS
KEY 0x115 DC
https://kubernetes-charts.storage.googleapis.com/
package main
import (
"context"
"log"
"os"
"strings"
dockercompose "github.com/docker/libcompose/docker"
"github.com/docker/libcompose/docker/ctx"
#!/bin/sh
set -e
# Code generated by godownloader. DO NOT EDIT.
#
usage() {
this=$1
cat <<EOF
$this: download go binaries for astronomerio/astro-cli
"""
Example of sequential dynamic task creation
"""
from datetime import datetime, timedelta
from airflow import DAG, configuration
from airflow.operators.dummy_operator import DummyOperator
dag = DAG(
dag_id="dynamic_tasks_example",
start_date=datetime(2018, 2, 9),
@andscoop
andscoop / bashtrack.sh
Created September 30, 2018 22:25
Bash Track
###############################
### *B*ASH *T*RACK
## A series of commands leveraging git and file system to do time tracking, task management, note taking
# Path BASHTRACK repo
export BT_ROOT="/Users/andscoop/dev/kb-andscoop/notes"
# Convenience env for grouping daily files by month
export BT_TIMETRACK_PATH="$BT_ROOT/daily/$(date '+%m')"