Skip to content

Instantly share code, notes, and snippets.

@jdanbrown
jdanbrown / gist:4747205
Last active January 30, 2019 10:44
Object algebras example in scala
#!/bin/bash
exec ~/src/scala/bin/scala -savecompiled "$0" "$@"
!#
// Example of object algebras, based on the scala example at http://ropas.snu.ac.kr/~bruno/oa/
// type Term = ∀A,O. O[A] -> A
trait Term[O[_]] {
def apply[A](o: O[A]): A
}
@jdanbrown
jdanbrown / boto-fab.py
Created September 25, 2012 20:40 — forked from marthakelly/boto-fab
Creating EC2 instance with Boto and Fabric
from fabric.api import *
from fabric.colors import green as _green, yellow as _yellow
import boto
import boto.ec2
from config import *
import time
def create_server():
"""
Creates EC2 Instance
ubuntu@ip-10-72-38-138:~$ sudo -u xncore lsof -p 18990 | cut -c72- | sort|uniq -c | sort -n
1 /
1 *:17071 (LISTEN)
1 *:44059 (LISTEN)
1 *:50343 (LISTEN)
1 anon_inode
1 /dev/null
1 /dev/random
1 /dev/urandom
1 *:http-alt (LISTEN)
@jdanbrown
jdanbrown / log-color
Created November 21, 2011 04:51
log4j logs in color!
#!/bin/bash -eu
#
# Color log4j-style logs for easier visual parsing.
#
# Usage:
# tail foo.log | log-color
# run-service | log-color
black="` tput setaf 0; tput bold`"
red="` tput setaf 1; tput bold`"