This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type AccountName = String | |
data Account = Account { | |
aname :: AccountName, | |
asubs :: [Account] | |
} | |
deriving Show | |
data Account2 = Account2 { | |
aname2 :: AccountName, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |