Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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
wraithm / monad.ml
Last active August 29, 2015 14:12
Monad with modular implicits
module type Functor = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end
let fmap (implicit F : Functor) = F.map
implicit module FunctorList = struct
type 'a t = 'a list
let map = List.map
@wraithm
wraithm / bifurcate.hs
Last active August 29, 2015 14:16
Bifurcate io-streams example
{-# 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
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
module Langs where
import Data.Proxy
@joefiorini
joefiorini / gist:1511971
Created December 22, 2011 21:37
Backbone + Stripe = AWESOME
class Stripe.TokenRequest extends Backbone.Model
validate: (attrs)->
error =
if !attrs.name
attribute: "name"
message: "Please enter your name"
else if !attrs.email
attribute: "email"
message: "Invalid email"
else if !Stripe.validateCardNumber(attrs.number)
{-# 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
co-dan / .zshrc
Last active December 31, 2015 08:49
Cabal sandbox status in your ZSH prompt
#
# 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: https://files.app.net/rjphjAG9.png
#
function update_cabal_sandbox_info () {
flags: {}
packages:
- location: ./.
- location: /home/shahn/src/servant
subdirs:
- servant
- servant-client
extra-dep: true
- location: /home/shahn/src/crdt-tree-vector
@fizruk
fizruk / docker-push.sh
Created November 10, 2015 17:12
Push to Docker from Circle CI
#!/bin/sh
set -x
CIRCLE_TAG=`git name-rev --tags --name-only $(git rev-parse HEAD)`
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
if [ "$CIRCLE_TAG" -ne "undefined" ]; then
docker tag user/repo user/repo:$CIRCLE_TAG