Skip to content

Instantly share code, notes, and snippets.

@timmytofu
timmytofu / ghcPkgUtils.sh
Last active June 6, 2020 12:02 — forked from simonmichael/gist:1185421
ghc-pkg-clean and ghc-pkg-reset compatible with both zsh and bash
# 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.
@timmytofu
timmytofu / foreignKeyTriggerInterference.sql
Created October 10, 2014 00:49
Breaking PostgreSQL foreign key referential integrity with triggers
--------------------------------------------------
-- setup
--------------------------------------------------
CREATE TABLE a (
id integer PRIMARY KEY
-- whatever else
);
CREATE TABLE b (
@timmytofu
timmytofu / bad-neo-import.csv
Created April 15, 2015 22:31
CSV with quote at beginning of line breaks neo4j importing
id thetext
1 This works fine
2 So does this
3 But this "does not"
@timmytofu
timmytofu / MyGeo.hs
Created September 2, 2015 03:10
A geometry idea for Zsolt
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
module MyGeo where
import Data.Vec.Nat
import GHC.Real (Ratio(..))