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 controllers | |
import play.api.libs.iteratee._ | |
object Application extends Controller { | |
def echo = WebSocket.using[String] { request => | |
val out = Enumerator.imperative[String]() | |
val in = Iteratee.foreach[String](out.push(_)).mapDone(_ => println("Disconnected")) | |
(in, out) |
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
global | |
maxconn 4096 # Total Max Connections. This is dependent on ulimit | |
nbproc 1 | |
defaults | |
mode http | |
frontend all 0.0.0.0:80 | |
timeout client 86400000 | |
default_backend play_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
case class Hello { | |
def hello = "hello" | |
} | |
case class Hi { | |
def hi = "hi" | |
} | |
trait Greeting[C] { | |
def greet(c: C): String |
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 Inter[A](f: Int => A) { | |
def map[B](g: A => B): Inter[B] = | |
Inter(n => g(f(n))) | |
def flatMap[B](g: A => Inter[B]): Inter[B] = | |
Inter(n => g(f(n)).f(n)) | |
} | |
object Unitals { | |
def unitalOption[A](a: A): Option[A] = |
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
#apps/orkut:D/pages/login.rb | |
class LoginPage < Page | |
@username_field = ... | |
@password_field = ... | |
@submit_button = ... | |
end | |
#apps/orkut:D/flows/home.rb | |
class LoginPage < Flow | |
def login user, pwd |
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
17:52:35,952 INFO [org.jboss.as.logging] Restored bootstrap log handlers | |
17:52:35,958 INFO [com.arjuna.ats.jbossatx] ARJUNA32018: Destroying TransactionManagerService | |
17:52:35,960 INFO [com.arjuna.ats.jbossatx] ARJUNA32014: Stopping transaction recovery manager | |
17:52:35,963 INFO [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" stopped in 85ms | |
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
HTTP Status 500 - | |
type Exception report | |
message | |
description The server encountered an internal error () that prevented it from fulfilling this request. | |
exception |
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.scalatra._ | |
import java.net.URL | |
import scalate.ScalateSupport | |
class MyScalatraFilter extends ScalatraFilter with ScalateSupport { | |
get("/") { | |
<html> | |
<body> | |
<h1>Hello, world!</h1> |
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
root@li75-187:/usr/bin# npm install node-proxy | |
> node-proxy@0.5.1 install /usr/bin/node_modules/node-proxy | |
> make | |
BUILDING: C++ Component | |
/bin/sh: node-waf: not found | |
cp: cannot stat `src/build/default/node-proxy.node': No such file or directory | |
make: *** [all] Error 1 | |
npm ERR! error installing node-proxy@0.5.1 Error: node-proxy@0.5.1 install: `make` |
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
var timer = require('timers') | |
var http = require('http'); | |
var urlMatcher = /https?:\/\/([-\w\.]+)+:?(\d+)?(\/([-\w\/_\.]*(\?\S+)?)?)?/ | |
var updateInterval = 10000; | |
var updateWithNoUseMax = 50; | |
var cache = {} | |
function CacheEntry() { |