Skip to content

Instantly share code, notes, and snippets.

@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
@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
[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);
@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:

@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 = (:)
@dtchepak
dtchepak / gist:3049721
Created July 4, 2012 21:54
What is OO?

I've been having a look around at various definitions of OO. Here's some of the ideas google turned up:

@tonymorris
tonymorris / gist:3088073
Created July 11, 2012 04:42
Semigroup/Monoid/Semigroupoid/Category/Endo
class Semigroupoid cat where
(<.>) ::
cat a b
-> cat b c
-> cat a c
class Semigroupoid cat => Category cat where
identity ::
cat a a
@seanparsons
seanparsons / SKI_Applicative.scala
Created August 2, 2012 09:06 — forked from tonymorris/SKI_Applicative.scala
Applicative Functor / SKI combinator calculus
object SKI_Applicative {
/*
First, let's talk about the SK combinator calculus and how it contributes to solving your problem.
The SK combinator calculus is made of two functions (aka combinators): S and K. It is sometimes called the SKI combinator calculus,
however, the I combinator can be derived from S and K. The key observation of SK is that it is a turing-complete system and therefore,
anything that can be expressed as SK is also turing-complete. Here is a demonstration that Scala's type system is turing-complete
(and therefore, undecidable) for example[1].
The K combinator is the most trivial of the two. It is sometimes called "const" (as in Haskell). There is also some discussion about
@tonymorris
tonymorris / Lens.cs
Created August 5, 2012 05:43
Lens library for C# (demonstration)
using System;
using System.Collections;
using System.Collections.Generic;
/*
A basic lens library for the purpose of demonstration.
Implements a lens as the costate comonad coalgebra.
This library is not complete.
A more complete lens library would take from
@liammclennan
liammclennan / blog_currying.md
Created September 6, 2012 10:48
CoffeeScript Currying

This is a function that does some currying:

add = (a,b) ->
  if not b?
    return (c) ->
      c + a
  a + b