Skip to content

Instantly share code, notes, and snippets.

Nathan Howell NathanHowell

Block or report user

Report or block NathanHowell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
NathanHowell / Dockerfile
Created Feb 13, 2020
lightweight pubsub emulator image
View Dockerfile
FROM alpine@sha256:ddba4d27a7ffc3f86dd6c2f92041af252a1f23a8e742c90e6e1297bfa1bc0c45 AS build
RUN apk add --no-cache ca-certificates curl python3
RUN curl${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \
| tar xzf -
RUN /google-cloud-sdk/ \
--bash-completion=false \
--override-components beta pubsub-emulator \
--path-update=false \
NathanHowell / BUILD
Last active Jan 29, 2020
How to push a bundle of images in parallel
load("@io_bazel_rules_docker//container:bundle.bzl", "container_bundle")
load("@io_bazel_rules_docker//container:image.bzl", "container_image")
load("@io_bazel_rules_docker//contrib:push-all.bzl", _push_bundle = "docker_push")
name = "my_first_image",
NathanHowell / BUILD
Last active Mar 5, 2020
Seal Python with a VirtualEnv toolchain
load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair")
load(":venv.bzl", "py_venv")
load(":wrapper.bzl", "py_wrapper")
name = "py3_venv",
# caching the venv interpreter doesn't work for two reasons:
# * there are no platform dependencies on this target: the cache will contain binaries for the wrong OS
# * there are no dependencies on the interpreter binary or standard library: the cache may contain stale versions
NathanHowell / settings.gradle
Created Jun 25, 2019
Example settings.gradle to dynamically derive projects from build.gradle files
View settings.gradle
// find all build.gradle files in the expected locations in the build tree
.matching {
exclude '**/src/**', '**/build/**', '**/.*'
include '**/build.gradle'
.each {
// then convert the file path to a project path
final relative = rootProject.projectDir.relativePath(it.parentFile)
final project = ":${relative.replace('/', ':')}"
NathanHowell /
Last active Oct 31, 2018
KinesisIO using Splittable DoFn (SDF) and the V2 Kinesis API (HTTP/2 push)
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at

Keybase proof

I hereby claim:

  • I am nathanhowell on github.
  • I am nathanhowell ( on keybase.
  • I have a public key ASC5cgtZMOLRHjV1qLg1TtuAv8xI1wjwmwqhvv9eUn7ybAo

To claim this, I am signing this object:

NathanHowell / Dockerfile
Created Jul 28, 2017
Example of multistage Docker build for grpc
View Dockerfile
FROM alpine:3.6 AS base
RUN apk add --no-cache python3 ca-certificates tzdata tini \
&& apk upgrade --no-cache
FROM base AS build
RUN apk add --no-cache \
python3-dev \
cython \
import tensorflow as tf
from scipy.special import logit
def centering_inference(c):
:param c: the number of target classes
:return: a uniformly distributed class bias variable
return tf.Variable(
View better-compile-errors.hs
instance (a ~ Proxy "Sum types are not supported by LLVM") => GGetElementIndex a (x :+: y) where
type GGetElementPtrType a (x :+: y) = Void
ggetElementIndex _ _ = error "Sum types are not supported by LLVM"
type family StructElement (a :: [*]) (n :: Nat) :: * where
StructElement (x ': xs) 0 = x
StructElement (x ': xs) n = StructElement xs (n - 1)
StructElement '[] n = Proxy "Attempting to index past end of structure"
NathanHowell / 1.idr
Last active Mar 23, 2016
A port of `Fin` and `natToFin` from Idris to Haskell.
View 1.idr
module Data.Fin
%default total
%access public export
||| Numbers strictly less than some bound. The name comes from "finite sets".
||| It's probably not a good idea to use `Fin` for arithmetic, and they will be
||| exceedingly inefficient at run time.
||| @ n the upper bound
You can’t perform that action at this time.