Skip to content

Instantly share code, notes, and snippets.

@dstroot
dstroot / install_postgresql.sh
Created June 13, 2012 00:26
Install PostgreSQL on Amazon AMI
#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/???
# chmod 777 install_postgresql.sh
# ./install_postgresql.sh
###############################################
echo "*****************************************"
echo " Installing PostgreSQL"
echo "*****************************************"
@raichoo
raichoo / gist:1114605
Created July 29, 2011 20:01
Multiple dispatch experiment
class MMethod[M, A1, A2, R](f: (A1, A2) => R) {
def apply(a1: A1, a2: A2): R = f(a1, a2)
}
class MultiMethod {
def apply[A1, A2, R](a1: A1, a2: A2)
(implicit mm: MMethod[this.type, A1, A2, R]): R =
mm(a1, a2)
// use a singleton type to attach the resulting implicit to our multimethod