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
/** | |
* LiveConnections are created for each window representation of the LivePage. This allows LiveChange lists to be | |
* trimmed and only include relevant changes for the specific window instance. Reloading a page will reset the | |
* LiveConnection. | |
*/ | |
class LiveConnection(created: Long = System.currentTimeMillis(), var lastUpdated: Long = System.currentTimeMillis()) { | |
private var changes = Vector.empty[LiveChange] | |
/** | |
* Retrieves all changes since lastId or Nil if no changes. |
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
package com.projectspeaker.pages | |
import com.projectspeaker.ProjectSpeakerPage | |
import org.powerscala.Color | |
import org.hyperscala.html._ | |
import org.hyperscala.html | |
import org.hyperscala.html.tag._ | |
import org.powerscala.property._ | |
import org.hyperscala.html.attributes.Target | |
import org.hyperscala.web.Scope |
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
trait Element | |
trait Parentable extends Element { | |
type P = Element | |
} | |
trait Childable extends Element { | |
type C = Element | |
} |
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
trait Test[T] { | |
def test[S <: T](value: S): Unit | |
} | |
object TestObject extends Test[String] { | |
private var s: String = _ | |
def test[String](value: String) = { | |
s = value | |
} |
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
package test | |
import collection.mutable.ListBuffer | |
/** | |
* @author Matt Hicks <mhicks@powerscala.org> | |
*/ | |
trait Element | |
trait Parentable extends Element { |
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 java.util.UUID | |
trait Communicator { | |
def id: UUID | |
final def send(message: Any) = { | |
// Sends messages to client | |
} | |
def receive(message: Any): Unit | |
} |
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
case class URL(method: Method = Method.Get, | |
protocol: String = "http", | |
host: String = null, | |
port: Int = 80, | |
path: String = "/", | |
parameters: Map[String, List[String]]) | |
sealed class Method(val value: String) extends EnumEntry[Method] | |
object Method extends Enumerated[Method] { |
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.jboss.netty.channel.ChannelHandlerContext; | |
import org.jboss.netty.channel.MessageEvent; | |
import org.jboss.netty.channel.SimpleChannelUpstreamHandler; | |
import org.jboss.netty.handler.codec.http.HttpChunk; | |
import org.jboss.netty.handler.codec.http.HttpRequest; | |
import org.jboss.netty.handler.codec.http.multipart.*; | |
/** | |
* HttpUploadHandler provides an easy-to-use abstract handler for parsing multipart form data on the server. | |
* |
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
package com.outr.webcommunicator.netty.handler | |
import com.outr.webcommunicator.netty.NettyWebapp | |
import org.jboss.netty.channel.{MessageEvent, ChannelHandlerContext} | |
import org.jboss.netty.handler.codec.http.{HttpChunk, HttpRequest} | |
import org.jboss.netty.handler.codec.http.multipart.{FileUpload, Attribute, DefaultHttpDataFactory, HttpPostRequestDecoder} | |
import scala.collection.JavaConversions._ | |
/** |
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.jboss.netty.channel.{ChannelFuture, Channel} | |
import org.jboss.netty.buffer.ChannelBuffers | |
import org.jboss.netty.util.CharsetUtil | |
import java.nio.charset.Charset | |
/** | |
* @author Matt Hicks <mhicks@outr.com> | |
*/ | |
class ChannelStringWriter(channel: Channel, buffer: Int = 512, charset: Charset = CharsetUtil.UTF_8) { | |
private val b = new StringBuilder |