Skip to content

Instantly share code, notes, and snippets.

trait UnapplyMT[TC[_[_[_], _]], N[_], MTNA] {
/** the type constructor */
type MT[_[_], _]
/** The type that MT is applied to */
type A
/** The instance of the type class */
def TC: TC[MT]
(global-set-key (kbd "M-?") 'flash-active-buffer)
(make-face 'flash-active-buffer-face)
(set-face-attribute 'flash-active-buffer-face nil
:background "red"
:foreground "black")
(defun flash-active-buffer ()
(interactive)
(run-at-time "100 millisec" nil
(lambda (remap-cookie)
process, absent anything else, is strictly pull
you should think of run like a giant wheel that is spinning and pulling in some rope, which is the process
the other end of that rope MAY be attached to a queue
you're pulling from that queue
and there may be an observer sitting on the rope which pushes into another queue
// Creating a generic recursive data structure with autoclosure. (READ ALL NOTES; THIS MAY NOT DO WHAT YOU WANT.)
// Closures are reference types, so the size is known (? I think ?)
// Note that this is just because of unimplemented features in the compiler in Beta5
// There's no reason to think this is a long-term requirement.
// IMPORTANT: the closure will run every time you access this value, so if that has
// side effects, this won't work. It's only possible on pure value types.
// But the fact that this works as expected is actually kind of incredible.
// Think about what is required for it to work out the type for NestedList.Elem("first").
// An ADT+shapeless as a drop-in replacement for a standard Scala Enumeration.
//
// First the unsafe standard Scala Enumeration ...
//
object ScalaEnumDemo extends App {
// Example from scala.Enumeration scaladoc. Terse ...
object WeekDay extends Enumeration {
type WeekDay = Value
val Mon, Tue, Wed, Thu, Fri, Sat, Sun = Value
}
mvn -Dtest=MyTest test
mvn -pl specific_project goal
mvn -Dmaven.test.skip=true install
clone with following remote submodules:
git clone git://github.com/stevej/emacs.git .emacs.d --recursive
update repo following remote submodules:
git submodule update --init --recursive
checkout remote branch
git checkout -b local-name origin/remote-name
delete remote branch
@bigtoast
bigtoast / gist:787211
Created January 20, 2011 00:57
Notes on Scala Effective Enum patterns.
sealed abstract class MyEnum
object MyEnum {
def apply(str :String) :MyEnum { // do str conversions }
object Val1 extends MyEnum
object Val2 extends MyEnum
}
we need the abstract class for matching the enum type. It can't be a trait because the compiler gets confused with the apply method in the object.
@bigtoast
bigtoast / grails notes
Created February 24, 2011 00:55
random notes on grails n groovy
v. 1.2.2 plugin dependencies are declared in application.properties
v. 1.3.7 plugin dependencies are declared in BuildConfig.groovy
null safe object navigation obj?.value
condensed ternary operator obj.value ?: "else this"
comparison <=>
call method on all objects in list listofobjs*.method
add items to list lst << "new item"
ranges .. ..<
@bigtoast
bigtoast / gist:842527
Created February 24, 2011 17:43
jquery notes
child selector >
#parent > child
:last selector
#parent > *:last
selects the last child of parent