Skip to content

Instantly share code, notes, and snippets.

View nginx.conf
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
ssl_certificate ssl-bundle.crt;
ssl_certificate_key ssl-private.key;
ssl_session_timeout 5m;

Setup your own win64 version of the Haskell Platform

Things you need to have

  • MSYS
  • GHC 7.8.2 win64 build
  • Cabal 1.20 win build
  • FreeGlut
wraithm /
Last active Aug 29, 2015
Monad with modular implicits
module type Functor = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
let fmap (implicit F : Functor) =
implicit module FunctorList = struct
type 'a t = 'a list
let map =
wraithm / bifurcate.hs
Last active Aug 29, 2015
Bifurcate io-streams example
View bifurcate.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad (when)
import Data.Maybe (isJust)
import Data.ByteString.Char8 as C
import System.IO.Streams as Streams
View langs.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
module Langs where
import Data.Proxy
joefiorini / gist:1511971
Created Dec 22, 2011
Backbone + Stripe = AWESOME
View gist:1511971
class Stripe.TokenRequest extends Backbone.Model
validate: (attrs)->
error =
if !
attribute: "name"
message: "Please enter your name"
else if !
attribute: "email"
message: "Invalid email"
else if !Stripe.validateCardNumber(attrs.number)
kowey / gist:2420144
Created Apr 19, 2012 — forked from cartazio/gist:1655271
Haskell GTK on 64 bit MacOS X
View gist:2420144


  • on lion (and snow leopard i suppose), make sure you are using a 64 bit install of ghc. Also, unless you are suggesting an edit to these directions, please go ask people on the relevant mailing list or wiki for help :)
  • Tested on ghc 7.2.2, assumes you have standard developer things installed on mac, like x11 and stuff
  • Also tested on GHC 7.0.4 (Haskell Platform) with XCode 4.3.
  • These notes were originally brought to you by Carter Schonwald; the “I” probably refers to him. Eric Kow will refer to himself in the third person).

GHC 7.4.x

  • gtk2hs 0.12.2 won't build with ghc 7.4.1, but the current darcs repo for gtk2hs does build
View SwaggerExample.hs
{-# LANGUAGE DeriveGeneric, FlexibleInstances, ScopedTypeVariables, FlexibleContexts, DataKinds, TypeFamilies #-}
module SwaggerExample where
import Data.Proxy
import qualified GHC.Generics as G
import Generics.SOP
data Todo = Todo {
created :: Int
, description :: String
co-dan / .zshrc
Last active Dec 31, 2015
Cabal sandbox status in your ZSH prompt
View .zshrc
# This simple script displays whether you are in a cabal sandbox
# the the result of checking for a sandbox is cached, but now that I
# actually think about it, it was probably an unnecessary step.
# Don't forget to customize the PROMPT variable at the bottom
# Looks like this with my prompt:
function update_cabal_sandbox_info () {
View stack.yaml
flags: {}
- location: ./.
- location: /home/shahn/src/servant
- servant
- servant-client
extra-dep: true
- location: /home/shahn/src/crdt-tree-vector