Skip to content

Instantly share code, notes, and snippets.

View brendanhay's full-sized avatar
💭
💩

Brendan Hay brendanhay

💭
💩
View GitHub Profile
@brendanhay
brendanhay / statsd-generator.sh
Created October 26, 2012 15:06
Random metrics generation for statsd
#!/bin/bash
BUCKETS=(ball sack nut job hax red saw new grunge)
TYPES=(g c s ms)
usage() {
echo "Usage: -h [host] -p [port]"
exit 1
}
@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
@brendanhay
brendanhay / Data.SemVer.hs
Last active December 31, 2015 12:29
Semantic Versioning Replacement for Data.Version
{-# LANGUAGE RecordWildCards #-}
-- Module : Data.SemVer
-- Copyright : (c) 2013 Brendan Hay <brendan.g.hay@gmail.com>
-- License : This Source Code Form is subject to the terms of
-- the Mozilla Public License, v. 2.0.
-- A copy of the MPL can be found in the LICENSE file or
-- you can obtain it at http://mozilla.org/MPL/2.0/.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : experimental
{-# 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 ()
@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 / 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 / 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:

{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ViewPatterns #-}
module Subnet
( KnownBits
, bitmask
@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
@brendanhay
brendanhay / rabbitmq.config
Created December 16, 2011 11:10
Example Shovel Config
[
{rabbit, [
%% snip...
]},
{rabbitmq_shovel, [
{shovels, [
{'MUTHA-SHOVELER', [
{sources, [
{broker, "amqp://"}