Skip to content

Instantly share code, notes, and snippets.

Avatar

markhibberd markhibberd

View GitHub Profile
@markhibberd
markhibberd / postmortem.md
Created Jun 21, 2018 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491
View postmortem.md

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@markhibberd
markhibberd / .projectile
Created Aug 25, 2017
Haskell projectile file.
View .projectile
-/*/dist
-/lib
-/*/.cabal-sandbox
-/dist
-/.cabal-sandbox
View gist:125ad3f586c94ee05ad3c3f56721b9fd
```
/------ A -|
[submit batch] -------- B -|--[success-of-all-in-batch]-- D (which submits new batch to hydra to run next step)
\------ C -|
```
@markhibberd
markhibberd / .profile
Created Sep 23, 2016 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
View .profile
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
View FileEmbed.hs
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
module Boris.Http.TH (
embed
) where
import qualified Data.Text as T
View haskell-generalization-proposal.md
View gadt-answers.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-
Lets start ^^ by enabling some language extensions. GADTs to encode our data types and
Rank2Types for the existental we will need to hide our types when we don't care about
the invariant.
-}
View gadt.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-
Lets start ^^ by enabling some language extensions. GADTs to encode our data types and
Rank2Types for the existental we will need to hide our types when we don't care about
the invariant.
-}
View Duration.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- FIX de-dupe with apiengine-server
module Apiengine.Trace.Duration (
Duration
, durationToMicro
, microToDuration
, durationToDiffTime
, diffTimeToDuration
) where
View dumb.scala
def findMapM[F[_]: Monad, A, B](l: List[A])(f: A => F[Option[B]]): F[Option[B]] = l match {
case x :: xs =>
f(x).flatMap({
case Some(b) =>
b.some.pure[F]
case None =>
findMapM(xs)(f)
})
case Nil =>
none.pure[F]