Skip to content

Instantly share code, notes, and snippets.

View pk11's full-sized avatar

Peter Hausel pk11

  • Silicon Valley, CA
View GitHub Profile
@pk11
pk11 / gist:1011545
Created June 7, 2011 02:09
sbt executable
java -Dfile.encoding=UTF8 -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -jar /opt/local/lib/sbt/sbt-launch10.jar "$@"
@pk11
pk11 / gist:1011562
Created June 7, 2011 02:18
sbt example
name := "myproject"
organization := "com.booo"
version := "1.0"
scalaVersion := "2.8.1"
scalacOptions += "-deprecation"
@pk11
pk11 / gist:1011576
Created June 7, 2011 02:28
web plugin
resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"
//Following means libraryDependencies += "com.github.siasia" %% "xsbt-web-plugin" % <sbt version>
libraryDependencies <+= sbtVersion("com.github.siasia" %% "xsbt-web-plugin" % _)
@pk11
pk11 / gist:1011600
Created June 7, 2011 02:47
gitignore
target/
project/boot/*
project/target
project/plugins/target
project/plugins/project/*
.idea/*
@pk11
pk11 / gist:1472884
Created December 13, 2011 16:49
recent performance related improvements in scala
https://github.com/scala/scala/commit/4cfc633fc6cb2ab0f473c2e5141724017d444dc6
https://github.com/scala/scala/commit/c352105fa082f88163869c0ba86f3e32aff57fc7
https://github.com/scala/scala/commit/5fb26c6a889cf1609823338df8783bf880769b3f
https://github.com/scala/scala/commit/1b98d1fa2a54dc1d8fafed6d270534d729420c21
https://github.com/scala/scala/commit/989c0d0693e27d06d1f70524b66527d1ef12f5a2
https://lampsvn.epfl.ch/trac/scala/changeset/26042
https://github.com/scala/scala/pull/16
@pk11
pk11 / offline
Created June 22, 2012 21:33
offline
echo "[setup global]"
echo "credentials += Credentials(Path.userHome / \".ivy2\" / \".credentials\")" > ~/.sbt/global.sbt
echo "" >> ~/.sbt/global.sbt
echo "offline := true" >> ~/.sbt/global.sbt
rm -rf $PLAY_HOME/repository/local/play*
rm -rf $PLAY_HOME/repository/cache/play*
rm -rf $PLAY_HOME/repository/cache/scala_2.9.*/sbt_0.*.*/play
echo "[republish play]"
@pk11
pk11 / gist:3043883
Created July 3, 2012 22:38
using WHITESPACE only compilation level and pretty printing for an alternative closure CompilerOptions
//in Build.scala
//requires play 2.1!
import com.google.javascript.jscomp._
val defaultOptions = new CompilerOptions()
defaultOptions.closurePass = true
CompilationLevel.WHITESPACE_ONLY.setOptionsForCompilationLevel(defaultOptions)
defaultOptions.setProcessCommonJSModules(true)
val root = new java.io.File(".")
defaultOptions.setCommonJSModulePathPrefix(root.getCanonicalPath+"/app/assets/javascript/")
@pk11
pk11 / gist:3288020
Created August 7, 2012 18:19
print current threads
public static void printThreads() {
// Find the root thread group
ThreadGroup root = Thread.currentThread().getThreadGroup().getParent();
while (root.getParent() != null) {
root = root.getParent();
}
// Visit each thread group
visit(root, 0);
}
@pk11
pk11 / gist:3488129
Created August 27, 2012 12:49
playbench 2.10.0-M7 java7
[error]
[error] while compiling: /Users/phausel/workspace/playbench/src/main/scala/play/api/libs/concurrent/Promise.scala
[error] during phase: typer
[error] library version: version 2.10.0-M7
[error] compiler version: version 2.10.0-M7
[error] reconstructed args: -classpath /Users/phausel/workspace/playbench/target/scala-2.10/classes:/Users/phausel/.ivy2/cache/com.google.guava/guava/jars/guava-10.0.1.jar:/Users/phausel/.ivy2/cache/joda-time/joda-time/jars/joda-time-2.1.jar:/Users/phausel/.ivy2/cache/org.joda/joda-convert/jars/joda-convert-1.2.jar:/Users/phausel/.ivy2/cache/org.javassist/javassist/jars/javassist-3.16.1-GA.jar:/Users/phausel/.ivy2/cache/org.apache.commons/commons-lang3/jars/commons-lang3-3.1.jar:/Users/phausel/.ivy2/cache/org.apache.ws.commons/ws-commons-util/jars/ws-commons-util-1.0.1.jar:/Users/phausel/.ivy2/cache/junit/junit/jars/junit-3.8.1.jar:/Users/phausel/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.0.b2.jar:/Users/phausel/.ivy2/cache/io.netty/netty/bundles/ne
[ERROR] error: java.lang.reflect.InvocationTargetException
[INFO] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[INFO] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[INFO] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[INFO] at scala.tools.nsc.plugins.Plugin$.instantiate(Plugin.scala:150)
[INFO] at scala.tools.nsc.plugins.Plugins$$anonfun$loadRoughPluginsList$1.apply(Plugins.scala:34)
[INFO] at scala.tools.nsc.plugins.Plugins$$anonfun$loadRoughPluginsList$1.apply(Plugins.scala:34)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
[INFO] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)