Skip to content

Instantly share code, notes, and snippets.

View brendanhay's full-sized avatar
💭
💩

Brendan Hay brendanhay

💭
💩
View GitHub Profile
downloading 'https://cache.nixos.org/jh30yfs48khjm4vm5x3y69s5b5la4sa9.narinfo'
downloading 'https://urbit-linux.cachix.org/nar/540b39d1e047ec7b847901752e79cdaa1bb4a6f2053c18608bda3c6a831bb8d4.nar.xz'
querying info about '/nix/store/wvj7g45j497n1z7xldi9k8mn7gd5y855-bootstrap_cmds-dev-tools-7.0' on 'https://cache.nixos.org'
downloading 'https://cache.nixos.org/wvj7g45j497n1z7xldi9k8mn7gd5y855.narinfo'
querying info about '/nix/store/wvj7g45j497n1z7xldi9k8mn7gd5y855-bootstrap_cmds-dev-tools-7.0' on 'https://urbit-linux.cachix.org'
downloading 'https://urbit-linux.cachix.org/wvj7g45j497n1z7xldi9k8mn7gd5y855.narinfo'
building '/nix/store/jh30yfs48khjm4vm5x3y69s5b5la4sa9-bootstrap_cmds-dev-tools-7.0.drv'
unpacking sources
unpacking source archive /nix/store/lzizcvlfhc44iqlsb5qhfprxms5rqd3m-bootstrap_cmds-93.tar.gz
source root is bootstrap_cmds-93
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ViewPatterns #-}
module Subnet
( KnownBits
, bitmask
@brendanhay
brendanhay / keybase.md
Created December 15, 2017 23:14
Keybase Proof

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 November 14, 2017 16:15
vowpal_wabbit 8.1.1 -> 8.4.0
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 October 13, 2016 00:50
GHC8 ImpredictiveTypes + monad-control instances
{-# 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)
@brendanhay
brendanhay / optimise.cabal
Last active October 29, 2015 09:28
Cabal O1/O2
flag optimise
Description: Turns on -O2 optimizations
Default: False
library
...
if flag(optimise)
ghc-options: -O2 -Wall -Werror
else
ghc-options: -O1 -Wall
λ: 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 August 21, 2015 10:29
Number of operations per service
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
#!/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 January 6, 2015 06:33
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) ->