Skip to content

Instantly share code, notes, and snippets.

💭
💩

Brendan Hay brendanhay

💭
💩
Block or report user

Report or block brendanhay

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
View Subnet.hs
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ViewPatterns #-}
module Subnet
( KnownBits
, bitmask
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@brendanhay
brendanhay / vwdll.h.diff
Created Nov 14, 2017
vowpal_wabbit 8.1.1 -> 8.4.0
View vwdll.h.diff
diff --git a/vowpalwabbit/vwdll.h b/vowpalwabbit/vwdll.h
index 4ccc36f8..6c659b7a 100644
--- a/vowpalwabbit/vwdll.h
+++ b/vowpalwabbit/vwdll.h
@@ -57,7 +57,6 @@ typedef void * VW_EXAMPLE;
typedef void * VW_LABEL;
typedef void * VW_FEATURE_SPACE;
typedef void * VW_FEATURE;
-typedef void * VW_IOBUF;
@brendanhay
brendanhay / MonadControlGHC8.hs
Last active Oct 13, 2016
GHC8 ImpredictiveTypes + monad-control instances
View MonadControlGHC8.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module MonadControlGHC8 where
import Control.Applicative (Alternative, Applicative)
import Control.Monad.Base (MonadBase)
import Control.Monad.Reader (MonadReader, ReaderT)
View optimise.cabal
flag optimise
Description: Turns on -O2 optimizations
Default: False
library
...
if flag(optimise)
ghc-options: -O2 -Wall -Werror
else
ghc-options: -O1 -Wall
View gist:6d576a8bef5ba139af01
λ: type ExampleResource = "foo" :> "bar" :> Capture "alt" Text :> QueryParam "quote" Bool :> Get '[JSON] Text
λ: let p = Proxy :: Proxy ExampleResource
λ: let u = BaseUrl Http
λ: let u = BaseUrl Http "localhost" 8080
λ: let example = client p u
λ: :t example
example :: Text -> Maybe Bool -> EitherT ServantError IO Text
@brendanhay
brendanhay / output
Created Aug 21, 2015
Number of operations per service
View output
amazonka-ec2: 187
amazonka-iam: 114
amazonka-rds: 81
amazonka-opsworks: 75
amazonka-redshift: 64
amazonka-s3: 57
amazonka-storagegateway: 55
amazonka-autoscaling: 53
amazonka-elasticache: 42
amazonka-elasticbeanstalk: 37
View travis-matrix.sh
#!/usr/bin/env bash
set -e
core=( documentation amazonka-core amazonka )
priority_=( s3 autoscaling elb sqs iam ec2 )
priority=${priority_[@]/#/amazonka-}
library_=( $(ls -d amazonka-*) )
@brendanhay
brendanhay / amazonka-ec2-case-insensitive-simpl-types.hs
Created Jan 6, 2015
amazonka-ec2-case-insensitive-simpl-types.hs
View amazonka-ec2-case-insensitive-simpl-types.hs
lvl768_r4v5V
:: Data.CaseInsensitive.Internal.CI Data.Text.Internal.Text
[GblId, Str=DmdType]
lvl768_r4v5V =
case Data.Text.unpackCString# "disabled"#
of dt_a19nJ
{ Data.Text.Internal.Text ipv_s19nM ipv1_s19nN ipv2_s19nO ->
case GHC.ST.runSTRep
@ Data.Text.Internal.Text
(\ (@ s1_a19nY) (s2_a19nZ :: GHC.Prim.State# s1_a19nY) ->
View describe-instances-transformer.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Lens -- lens
import Control.Monad.IO.Class -- transformers
import Control.Monad.Trans.AWS -- amazonka
import Network.AWS.EC2 -- amazonka-ec2
main :: IO ()
You can’t perform that action at this time.