Skip to content

Instantly share code, notes, and snippets.

View tlockney's full-sized avatar

Thomas Lockney tlockney

View GitHub Profile
@tlockney
tlockney / quick-haskell-emacs.applescript
Created November 11, 2011 01:39
Set up a frame for trying out simple haskell snippets
(defun make-quick-haskell-frame ()
"Creates a new frame running haskell-mode."
(make-frame '((name . "Quick Haskell")
(width . 120)
(height . 40)))
(select-frame-by-name "Quick Haskell")
(switch-to-buffer "Haskell")
(haskell-mode))
@tlockney
tlockney / ImplicitExample.scala
Created February 23, 2011 03:49
Here's a very simplified example of hiding an implicit in a companion object
// initial version
import scala.collection.immutable.TreeSet
class TreeMember[A] {
// some really important stuff here, of course! ;~)
}
class Main {
implicit val treeOrder = new Ordering[TreeMember[A]] {
def compare(a: TreeMember[A], b: TreeMember[A]) = {
// elided for simplicity's sake
}
class Sub extends Super {
@Override
public void foo(java.util.Map<Object,Object> bar) {}
}
# transform a java property file into valid shell variables
awk 'BEGIN{FS=OFS="="}{gsub(/\#.*/,"")}{gsub(/\./,"_",$1)}{sub(/..*/,"\"&\"",$2)}1' $1