Skip to content

Instantly share code, notes, and snippets.

@creichert
creichert / poly-nfdata.hs
Created June 14, 2016 21:21 — forked from phadej/poly-nfdata.hs
Example how is possible to write polykinded type-classes in GHC-8.0. It's not that bad or messy, but I'm not sure it's practical either.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
@creichert
creichert / meta-tags.md
Created July 12, 2016 21:23 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@creichert
creichert / custom-error-page
Created July 21, 2016 04:27 — forked from simlegate/custom-error-page
Nginx return custom json
error_page 400 404 405 =200 @40*_json;
location @40*_json {
default_type application/json;
return 200 '{"code":"1", "message": "Not Found"}';
}
error_page 500 502 503 504 =200 @50*_json;
location @50*_json {
@creichert
creichert / gist:58ac83414d4e0d57effff4667dfb09ee
Created July 23, 2016 23:11 — forked from jetztgradnet/gist:808968
Elastic Beanstalk configuration options
aws:autoscaling:asg Availability Zones
aws:autoscaling:asg Cooldown
aws:autoscaling:asg Custom Availability Zones
aws:autoscaling:asg MaxSize
aws:autoscaling:asg MinSize
aws:autoscaling:launchconfiguration EC2KeyName
aws:autoscaling:launchconfiguration ImageId
aws:autoscaling:launchconfiguration InstanceType
aws:autoscaling:launchconfiguration MonitoringInterval
aws:autoscaling:launchconfiguration SecurityGroups
# 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
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
@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 && \
@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 / mode-line.el
Created September 22, 2018 04:20 — forked from fhdhsni/mode-line.el
my emacs mode line config
(defun mode-line-fill-right (face reserve)
"Return empty space using FACE and leaving RESERVE space on the right."
(unless reserve
(setq reserve 20))
(when (and window-system (eq 'right (get-scroll-bar-mode)))
(setq reserve (- reserve 3)))
(propertize " "
'display `((space :align-to (- (+ right right-fringe right-margin) ,reserve)))
'face face))
@creichert
creichert / bash-cheatsheet.sh
Created September 22, 2018 04:45 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04