Skip to content

Instantly share code, notes, and snippets.

View lopex's full-sized avatar

Marcin Mielżyński lopex

View GitHub Profile
def blah: Int = {
val a: Option[Int] = Some(10)
a getOrElse {return 1}
2
}
public int blah();
Code:
0: new #16; //class java/lang/Object
class JmxView < StatefullServlet
env = java.util.Hashtable.new
env[javax.naming.Context::PROVIDER_URL] = "jnp://127.0.0.1:1099"
env[javax.naming.Context::INITIAL_CONTEXT_FACTORY] = "org.jnp.interfaces.NamingContextFactory"
@@srv = javax.naming.InitialContext.new(env).lookup("jmx/invoker/RMIAdaptor")
def index
if domain = request["domain"]
mbeans = @@srv.query_names(javax.management.ObjectName.new(domain+":*"),nil).sort_by{|m|m.key_property_list_string}
name = request["name"] || mbeans.to_a.first.key_property_list_string
prntln("foo");1
println("dupa");1
println("b")
class A
class B extends A
class C extends B
println("a")
object ar {
trait AroundFile {
def around[T](f: => T): T = f
def session[T](f: => T): T = f
}
trait SessionFile extends AroundFile {
abstract override def around[T](f: => T): T = this.session(super.around(f))
}
package pl.irc
import org.jibble.pircbot.PircBot
import util.parsing.json.{JSON, JSONObject, JSONArray, JSONType}
import dispatch._
import Http._
object Multibottest extends PircBot {
val BOTNAME = "multibot"
val BOTMSG = BOTNAME + ":"
package pl.irc
import org.jibble.pircbot.PircBot
import util.parsing.json.{JSON, JSONObject, JSONArray, JSONType}
import dispatch._
import Http._
object Multibottest extends PircBot {
val BOTNAME = "multibot"
val BOTMSG = BOTNAME + ":"
trait Num { type a[F[_], X] }
trait Zero extends Num { type a[F[_], X] = X }
trait One extends Num { type a[F[_], X] = F[X] }
trait Two extends Num { type a[F[_], X] = F[F[X]] }
trait Three extends Num { type a[F[_], X] = F[F[F[X]]] }
trait PApp[F[P[_], _], A[_]] {
type a[X] = F[A, X]
}
abstract class Tree[+A]
case class Node[A](x: A, l: Tree[A], r: Tree[A]) extends Tree[A]
case object Empty extends Tree[Nothing]
abstract class Direction[A](x: A, t: Tree[A])
case class Left[A](x: A, tree: Tree[A]) extends Direction(x, tree)
case class Right[A](x: A, tree: Tree[A]) extends Direction(x, tree)
case class Zipper[A](t: Tree[A], d: List[Direction[A]]) {