Skip to content

Instantly share code, notes, and snippets.

View bkatiemills's full-sized avatar
💭
pushing pixels farming bits

Bill Katie-Anne Mills bkatiemills

💭
pushing pixels farming bits
View GitHub Profile
@bkatiemills
bkatiemills / demo.py
Created September 27, 2021 17:39
loop over dates example
from dateutil import rrule
from datetime import datetime
def get_selection_profiles_loop(start, end, shape, pres):
now = datetime.strptime(start, "%Y-%m-%d")
later = datetime.strptime(end, "%Y-%m-%d")
previous = start
profiles = []
@bkatiemills
bkatiemills / Dockerfile
Last active September 7, 2021 14:45
dockerfile for argovis tutorial
FROM python:3.6
WORKDIR /usr/src/argo-database
COPY ./requirements.txt ./requirements.txt
RUN apt-get update && \
apt-get --assume-yes install libhdf5-serial-dev netcdf-bin libnetcdf-dev nano
RUN pip install -r requirements.txt
RUN pip install wget==3.2
from wodpy import wod
def find_instrument_code(profile, varcode):
'''
given a wodpy profile and a variable code varcode as defined in table 3 of [reference 1],
return the instrument code from [reference 2] associated with this measurement, if it is available;
if not, return None.
[reference 1]: https://www.ncei.noaa.gov/data/oceans/woa/WOD/DOC/wodreadme.pdf
[reference 2]: https://www.ncei.noaa.gov/data/oceans/woa/WOD/CODES/PDF/v_5_instrument.pdf
'''
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: psp.flannel.unprivileged
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default
seccomp.security.alpha.kubernetes.io/defaultProfileName: docker/default
apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default
apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default
---
# Source: calico/templates/calico-config.yaml
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
# Typha is disabled.
@bkatiemills
bkatiemills / serialize.py
Created September 29, 2019 16:43
fun with byte serialization
import io, pickle, sqlite3, sys, pandas
import numpy as np
def parse(results):
return results.apply(unpack_qc)
def unpack_qc(value):
print(value, type(value))
qc = np.load(io.BytesIO(value))
@bkatiemills
bkatiemills / docker-compose.yaml
Created April 21, 2019 21:39
basic compose file for demo app
version: "3.6"
services:
database:
environment:
POSTGRES_DB: ddev
POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password
image: ${dockerID}/ddev_db
build:
context: database
apiVersion: apps/v1
kind: Deployment
metadata:
name: bb-database
namespace: default
spec:
replicas: 1
selector:
matchLabels:
bb: db
@bkatiemills
bkatiemills / bb-stack.yaml
Created March 14, 2019 20:11
bulletin board stack file solution part 3
version: '3.7'
services:
bb-db:
image: ${dockerId}/bb-db:v2
networks:
- bb-net
volumes:
- sqlbackup:/var/opt/mssql
@bkatiemills
bkatiemills / bb-stack.yaml
Last active March 14, 2019 19:49
bulletin board stack file solution part 2
version: '3.7'
services:
bb-app:
image: ${dockerId}/bb-app:v2
networks:
- bb-net
bb-db:
image: ${dockerId}/bb-db:v2
networks: