Skip to content

Instantly share code, notes, and snippets.

Avatar

Will Langstroth wlangstroth

View GitHub Profile
@byorgey
byorgey / Knotty.hs
Created Oct 13, 2012
Creating a tree with shared links back to parent nodes
View Knotty.hs
type AccountName = String
data Account = Account {
aname :: AccountName,
asubs :: [Account]
}
deriving Show
data Account2 = Account2 {
aname2 :: AccountName,
@GBH
GBH / gist:3452023
Last active Oct 9, 2015
Textmate snippet for `controllertest`. Scope `source.ruby`
View gist:3452023
require_relative '../test_helper'
class ${1:Model}sControllerTest < ActionController::TestCase
def setup
@${1/./\l$0/} = ${1/./\l$0/}s(:default)
end
def test_get_index
get :index
@GBH
GBH / gist:3451944
Last active Oct 9, 2015
Textmate snippet `controller`. Scope `source.ruby`
View gist:3451944
class ${1:Model}sController < ApplicationController
before_action :build_${1/./\l$0/}, only: [:new, :create]
before_action :load_${1/./\l$0/}, only: [:show, :edit, :update, :destroy]
def index
@${1/./\l$0/}s = ${1:Model}.page(params[:page])
end
def show
@simonmichael
simonmichael / gist:1185421
Created Sep 1, 2011
ghc-pkg-clean, ghc-pkg-reset
View gist:1185421
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.
You can’t perform that action at this time.