Skip to content

Instantly share code, notes, and snippets.

@timjstewart
timjstewart / cabal-init
Last active August 29, 2015 14:10
Quickly create a scratch cabal sandbox and project complete with hspec/QuickCheck tests.
#! /bin/bash
package_name=$(basename `pwd`)
log_file=./cabal-init.log
function fatal() {
echo "$1. Examine ${log_file} for more information." 2>&1
exit 1
}
@zmoazeni
zmoazeni / gist:a035f72f0c9d0931f471
Last active August 29, 2015 14:10
Run interpreter and REPL using cabal sandbox packages
cabal exec -- ghci # starts ghci with cabal sandbox set
cabal exec -- runghc ... # runs runghc with cabal sandbox set
@felixge
felixge / 10-ways-to-improve-github-issues.md
Created April 13, 2011 13:02
I love the new GitHub issues, here are some ideas to make it perfect, ordered by priority:

10 Ways to improve Github Issues

I love the new GitHub issues, here are some ideas to make it perfect, ordered by priority:

1. I should be able to pick the assignee and milestone via keyboard when creating a new ticket

2. Keyboard shortcuts should work everywhere. E.g. when viewing an existing issue, 'c' does not work.

3. After creating an issue, the assigned user / milestone should be remembered and pre-filled.

4. Allow assigning a different user while commenting. Right now this deletes my half-typed comment.

5. When typing the @ symbol to mention somebody, it should auto-complete the name.

6. Things feel a little sluggish right now, any speed improvements would be very welcome.

@basvandijk
basvandijk / TaglessSerialization.hs
Created September 8, 2012 10:31
Tagless, Applicative, bidirectional serialization combinators
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
import Control.Applicative
class Field a where
fieldType :: a -> String
fieldRead :: String -> a
@sjoerdvisscher
sjoerdvisscher / ADTShow.hs
Created September 9, 2012 14:57
Applicative, bidirectional serialization combinators
{-# LANGUAGE
RankNTypes
, TypeFamilies
, ConstraintKinds
, FlexibleInstances
, ScopedTypeVariables
, TypeSynonymInstances
#-}
import GHC.Prim (Constraint)
@snoyberg
snoyberg / test.xml
Created February 11, 2013 16:52
xml-conduit + lens
<foo>
<bar>
<baz>
<bin/>
</baz>
</bar>
<bar/>
</foo>
@puffnfresh
puffnfresh / Partiality.hs
Created August 13, 2013 16:11
Partiality monad in Haskell using Free Maybe.
module Partiality where
import Control.Monad.Free
type Partiality = Free Maybe
never :: Partiality a
never = Free $ Just never
bad :: Partiality a
@AndyMoreland
AndyMoreland / init.el
Created December 21, 2015 23:53
Typescript compiler error regexp for emacs M-x compile
(add-hook 'typescript-mode-hook
(lambda ()
(add-to-list 'compilation-error-regexp-alist
'("^\\([_.[:alnum:]-/]*.ts\\)(\\([[:digit:]]+\\),\\([[:digit:]]+\\)).*$" 1 2 3))))
@gauteh
gauteh / github-thread.py
Last active October 17, 2017 10:53
Open GitHub issue from Notmuch thread or Message ID
#! /usr/bin/env python
#
# Author: Gaute Hope <eg@gaute.vetsj.com> / 2017-10-08
import os, sys, os.path
import subprocess
import notmuch
import email
import email.parser
import email.policy
@grahamc
grahamc / nixos-on-dell-9560.org
Last active December 1, 2017 22:02
NixOS on a Dell 15" 9560 with the 4K screen.