Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
MSGID=$(grep -i '^message-id' | head -n 1 | sed -e 's/Message-I[Dd]: /:/')
hsgtd add "$@" "$MSGID"
{-# LANGUAGE DeriveDataTypeable #-}
data HillKey = HkId
| HkMainNameInfo
-- and many more
| HkLatitude
| HkLongitude
deriving (Data, Typeable)
showKey :: HillKey -> String
#!/bin/bash
export http_proxy=proxy.brighton.ac.uk:80
cd ${HOME}/darcs.net
echo ======================================================================
echo building
echo ======================================================================
cabal configure -ftest
cabal build
echo ======================================================================
echo unit tests
#!/bin/bash
FAST_MACHINE=stanley
env | grep SSH_AGENT_PID
SSH_AGENT_CHECK_STATUS=$?
if [ $SSH_AGENT_CHECK_STATUS -ne 0 ]; then
eval `ssh-agent`
ssh-add
fi
Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
, bgColor = "#777777"
, fgColor = "#ee9a00"
, position = Top
, commands = [ Run Date "%a %_d %b %Y %H:%M" "date" 600
, Run Com "/home/me/opt/bin/count-gtd" ["ACTION"," "] "gtd-action" 600
, Run Com "/home/me/opt/bin/count-gtd" ["WAITING"," "] "gtd-waiting" 600
, Run StdinReader
]
, sepChar = "%"
import Control.Monad.Writer
import Control.Monad.Maybe
type FooM a = MaybeT (Writer [String]) a
test =
do print (runIt warningFail) -- I want [ 'failure' ]
print (runIt warningSuccess) -- I want [ 'success' ]
print (runIt (warningFail >> warningSuccess)) -- I want [ 'failure' ]
print (runIt (warningSuccess >> warningFail)) -- I want [ 'success', 'failure' ]
where
Index: src/uimacnew/ReconItem.m
===================================================================
--- src/uimacnew/ReconItem.m (revision 390)
+++ src/uimacnew/ReconItem.m (working copy)
@@ -824,8 +824,7 @@
{
if (!_parentImages) {
_parentImages = [[NSMutableDictionary alloc] init];
- _veryLightGreyColor = [[NSColor colorWithCalibratedRed:0.9 green:0.9 blue:0.9 alpha:1.0] retain];
- // [NSColor lightGrayColor]
@kowey
kowey / cmd
Created January 21, 2010 15:25
./heapgraph < example | dot -T pdf -o example.pdf
-- Rabhi and Lapalme, Algorithms: A Functional Programming Approach, pg 80
data BinTree a = Empty | NodeBT a (BinTree a) (BinTree a) deriving Show
ex = NodeBT 42 (NodeBT 4 Empty Empty) (NodeBT 2 Empty Empty)
comp'' x Empty = (Empty, 0)
comp'' x (NodeBT v lf rt) = ( NodeBT (fromIntegral v / fromIntegral x) p1 p2
, v + s1 + s2 )
where
{-# LANGUAGE FlexibleInstances #-}
module NLTG.NormaliseScores where
import System.Random
import Test.QuickCheck
-- | Given a lower and upper bound and a set of scores
-- Stretch the scores so that at least one of the bounds is reached
-- @normalise (-10,10) [-3,5,4] == [-6,10,8]@
normalise :: (Ord a, Fractional a) => (a,a) -> [a] -> [a]