View scalazTestHelpers.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.scalatest.Suite | |
import scalaz._ | |
import Scalaz._ | |
import org.scalatest.matchers._ | |
/** | |
* Helper matchers for hacking with Scalaz. | |
*/ |
View mysql-doobie.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert.transact(xa).attemptSomeSqlState { | |
case INTEGRITY_CONSTRAINT_VIOLATION => | |
ERR_PartnerEntryExists | |
}.run |
View TestStrings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestStrings { | |
public static void main(String[] args) { | |
String foo = "Foo " + "bar"; | |
String omg = "OMG" + "WTF" + "BBQ"; | |
String test = foo + omg; | |
} | |
} |
View scala time -> 2.8 patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pom.xml b/pom.xml | |
index ac0f723..32853f0 100644 | |
--- a/pom.xml | |
+++ b/pom.xml | |
@@ -30,7 +30,7 @@ | |
</scm> | |
<properties> | |
- <scala.version>2.7.4</scala.version> | |
+ <scala.version>2.8.0</scala.version> |
View gist:527992
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test Method | |
@Stache("unitTest", Some(3600)) def foo(x: Int) = { | |
println("Multiplying X (%s) by 2".format(x)) | |
x * 2 | |
} | |
// Compiler steps | |
var block = tree.find( _.isInstanceOf[Block] ) orElse tree.find( _.isInstanceOf[Apply] ) getOrElse(throw new IllegalArgumentException("Cannot find method body for Stache annotated DefDef '%s'. Was looking for either a code block or a one liner. Is method abstract or something else boneheaded?".format(dDef.name))) |
View noBlankRowsMatcher.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val notHaveBlankRows = new Matcher[Iterable[Map[String, String]]] { | |
def apply(x: => Iterable[Map[String, String]]) = { | |
(x().forall(row => row.forall(kv => kv._2 != null && kv._2 != "" && kv._2 != None)), | |
"No blank rows contained in Iterable.", | |
"Blank rows (all values in row are either '', null or None) found in Iterable.") | |
} | |
} |
View fixDecksetThemes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/usr/bin/env python | |
# | |
# Quick Script to Fix the Local Settings of Deckset Themes | |
# | |
# Deckset uses `xattr` metadata which isn't preserved | |
# by version control. | |
# | |
# Note that Vim will also overwrite your metadata unless you `set backupcopy=yes` | |
# | |
# Brendan McAdams <brendan@boldradius.com> |
View Homebrew for Scala 2.8.1 RC4.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Scala <Formula | |
homepage 'http://www.scala-lang.org/' | |
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.RC4.tgz' | |
version '2.8.1.RC4' | |
md5 '835f07e494004b33b82ded8f9b291cb1' | |
def install | |
rm_f Dir["bin/*.bat"] |
View scala2.8.1.final_homebrew.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Scala <Formula | |
homepage 'http://www.scala-lang.org/' | |
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.final.tgz' | |
version '2.8.1' | |
md5 '4fa66742341b5c9f6877ce64d409cb92' | |
def install | |
rm_f Dir["bin/*.bat"] |
View Oops.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] /Users/bwmcadams/code/mongodb/casbah/casbah-query/src/test/scala/DSLCoreOperatorsSpec.scala:1271: type mismatch; | |
[error] found : ((some other)$anon(in value <local DSLCoreOperatorsSpec>) forSome { type (some other)$anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDistance[T](radius: T)(implicit evidence$15: Numeric[T]): (some other)$anon(in value <local DSLCoreOperatorsSpec>)} }) | |
[error] required: $anon(in value <local DSLCoreOperatorsSpec>) where type $anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDistance[T](radius: T)(implicit evidence$15: Numeric[T]): $anon(in value <local DSLCoreOperatorsSpec>)} | |
[error] near must notBeNull | |
[error] ^ | |
((some other)$anon(in value <local DSLCoreOperatorsSpec>) forSome { type (some other)$anon(in value <local DSLCoreOperatorsSpec>) <: java.lang.Object with com.mongodb.casbah.commons.MongoDBObject{def $maxDista |
OlderNewer