Skip to content

Instantly share code, notes, and snippets.

@Peaker
Peaker / test.hs
Created June 4, 2012 00:35 — forked from dtchepak/test.hs
Illegal instance declaration, flexible instances?
{-# LANGUAGE TypeFamilies #-}
class Collection c where
type Element c
insert :: Element c -> c -> c
instance Collection [a] where
type Element [a] = a
insert = (:)
@avdi
avdi / apology101.markdown
Created March 22, 2012 17:36
How to apologize

Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.

You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template:

[Fact]
public async Task can_recover_buyback()
{
//arrange
var buybackId = Guid.NewGuid();
InitialiseViewModel(true, buybackId);
_contractService.GetContract(buybackId).Returns(new CustomerBuybackDto { ContractItems = new ObservableCollection<ContractItemDto>() });
_buybackService.RecoverAsync(buybackId).Returns(TaskEx.Run(() => { }));
_uiService.AddResult(MessageBoxResult.Yes);
@mbbx6spp
mbbx6spp / ExitCodeTestsExample.hs
Created November 6, 2011 20:30
Cabal file with test-suite block and explanation in a USAGE.md file.
module Main where
import Test.QuickCheck (quickCheck)
import Your.Module (encrypt, decrypt)
prop_reverseReverse :: [Char] -> Bool
prop_reverseReverse s = (reverse . reverse) s == s
prop_encryptDecrypt :: [Char] -> Bool
prop_encryptDecrypt s = (encrypt . decrypt) s == s
@olsonjeffery
olsonjeffery / README.md
Created June 14, 2011 15:19
A crash-course in building out a badass ubuntu dev vm

Setting up a 64-bit ubuntu vm

VM creation and OS install

  1. Create a virtualbox 64bit ubuntu VM.. whatever you need (1024MB RAM and 1 proc work fine for me)
  2. Install Ubuntu Natty 11.04 Desktop amd64

Setup environment

  1. sudo apt-get update && sudo sudo apt-get upgrade .. make sure all updates are installed.
  2. sudo apt-get install git-core git-gui gitk curl build-essential autoconf automake bison screen openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev uuid-dev vim-gnome vim-nox exuberant-ctags libnspr4-dev mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm libmozjs-dev cmake-gui codeblocks-dbg codeblocks-contrib codeblocks doxygen