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 / 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
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 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
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
@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:
@NathanHowell
NathanHowell / value-promotion.hs
Last active Sep 30, 2015
Example of promoting a value to a type using higher ranked types, continuation passing and GADTs
View value-promotion.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Data.Proxy
import Data.Type.Equality
@NathanHowell
NathanHowell / please-no.hs
Created Jun 23, 2015
Really terrible HTTP CONNECT proxy for Haskell/WAI
View please-no.hs
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent (forkIO, newEmptyMVar, putMVar, takeMVar)
import Control.Exception (finally)
import Control.Monad
import Control.Monad.Trans (liftIO)
import Data.ByteString.Char8 ()
import qualified Data.ByteString as B
import Data.Monoid
@NathanHowell
NathanHowell / JsonSchemaRDD.scala
Created Nov 15, 2014
SchemaRDD to row JSON conversion
View JsonSchemaRDD.scala
/*
* 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
*
You can’t perform that action at this time.