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
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
fileTree('.')
.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
NathanHowell / gist:5435345
Last active Jan 25, 2019
Simple Warp server that can be gracefully shutdown over HTTP.
View gist:5435345
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Control.Concurrent (forkIO)
import Control.Concurrent.STM
import Control.Monad (when)
import Control.Monad.Trans (liftIO)
import Network.HTTP.Types
import Network.Wai as Wai
@NathanHowell
NathanHowell / KinesisIO.java
Last active Oct 31, 2018
KinesisIO using Splittable DoFn (SDF) and the V2 Kinesis API (HTTP/2 push)
View KinesisIO.java
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
@NathanHowell
NathanHowell / pb.hs
Created May 20, 2012
Protocol Buffers via GHC Generics
View pb.hs
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
View keybase.md

Keybase proof

I hereby claim:

  • I am nathanhowell on github.
  • I am nathanhowell (https://keybase.io/nathanhowell) on keybase.
  • I have a public key ASC5cgtZMOLRHjV1qLg1TtuAv8xI1wjwmwqhvv9eUn7ybAo

To claim this, I am signing this object:

@NathanHowell
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 \
build-base
View centering.py
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 gist:1466063
{-# OPTIONS_GHC -fno-warn-deprecations #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
module Main (main) where
import Control.Monad (when)
import qualified Data.ByteString.Lazy as BL
@NathanHowell
NathanHowell / curry.hs
Created May 31, 2013
A proof-of-concept demonstrating the use of Z3 to solve Cabal version constraints for Haskell packages
View curry.hs
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
@NathanHowell
NathanHowell / stack.yaml
Created Feb 3, 2016
GHC 8.0 release candidate stack/stackage yaml
View stack.yaml
resolver: ghc-8.0.0.20160111
setup-info:
ghc:
linux64:
8.0.0.20160111:
url: "http://downloads.haskell.org/~ghc/8.0.1-rc1/ghc-8.0.0.20160111-x86_64-deb7-linux.tar.xz"
content-length: 111404852
sha1: 30d39c6ca6994dcafe25595e053035ad23198b52
macosx:
8.0.0.20160111:
You can’t perform that action at this time.