Skip to content

Instantly share code, notes, and snippets.

@creichert
creichert / .cVimrc
Last active November 14, 2018 05:07
cvim config
" minimal cvim - see the cvim.css file for customizing theme
"
" https://gist.github.com/creichert/31914a6dc517b22f4a21777c463ab4ff
set autoupdategist
let hintcharacters = 'asdfghjklcvbn'
let barposition = "bottom"
let searchalias s = "stackoverflow"
let searchalias g = "google"
@creichert
creichert / Makefile
Last active September 10, 2018 01:24
Self-documenting Makefile
SHELL := /bin/bash
foo: ## this is a doc
echo "foo"
.DEFAULT_GOAL := help
.PHONY: help
help:
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) \
@creichert
creichert / config.yml
Last active November 24, 2019 14:35
Circle CI 2.0 configuration for Haskell Stack (multiple GHC & LTS versions)
version: 2
workflows:
version: 2
build-and-test:
jobs:
- build
- build-nightly
- build-lts-11
@creichert
creichert / setup-info-gen.hs
Created August 11, 2018 16:39 — forked from DanBurton/setup-info-gen.hs
Generate a stack.yaml that can install ghc-8.6.1-beta1 (aka ghc-8.6.0.20180810)
#!/usr/bin/env stack
{- stack
script
--resolver lts-11.16
--package bytestring
--package http-conduit
-}
-- usage: ./Main.hs
-- modify the baseUrl and ghcDateVersion to taste
@creichert
creichert / Dockerfile
Created June 24, 2018 05:16 — forked from alexanderkjeldaas/Dockerfile
ghcjs-8.4 with stack.
FROM ubuntu:16.04
## ensure locale is set during build
ENV LANG C.UTF-8
## Haskell environment
RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main' > \
/etc/apt/sources.list.d/ghc.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 && \
apt-get update && \
Writing a billing system in Haskell, using Stripe and Heroku
===
*This post is written in literate Haskell, meaning the source can be turned
into a blogpost or a working program. You can view the [source][source].
[source]: https://gist.github.com/gatlin/7754289
Normally clients pay me with checks, but recently one informed me that they
really really really like *really really* super prefer some kind of online
openapi: "3.0.0"
info:
version: 3.0.0
title: GitHub API v3
servers:
- url: https://api.github.com
paths:
/users:
get:
summary: List all GitHub users.
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v2
paths:
/pet:
@creichert
creichert / Main.hs
Created November 16, 2017 17:30
Find number in a list that occurs an odd number of times
import Data.List
import Data.Bits
-- > 1
main = print $ foldl xor 0 [1,1,2,2,3,3,4,4,5,5,6,6,7,7,1]
# trying out new compiler
compiler: ghc-8.2.0.20170507
compiler-check: match-exact
allow-newer: true
ghc-options: { deepseq: -XTypeSynonymInstances }
setup-info:
ghc:
linux64:
8.2.0.20170507:
url: https://downloads.haskell.org/~ghc/8.2.1-rc2/ghc-8.2.0.20170507-x86_64-deb8-linux.tar.xz