This file contains hidden or 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 net.tomasherman.replayvault.client.gui | |
import swing._ | |
import event.{EditDone, ButtonClicked} | |
import net.miginfocom.swing.MigLayout | |
import javax.swing.BorderFactory | |
import java.awt.Color | |
import java.util.Arrays | |
import akka.actor.Actor |
This file contains hidden or 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
/** | |
* Sorry about the mess in imports but i figured this in REPL and i didn't want to refactor it because i'm sure i would eff it up. | |
* First of all you need to import certificate into a keystore like so: | |
/opt/java/bin/keytool -import -alias ca -file ~/Desktop/www.ondrej.vostal.net -keystore cacerts | |
* This should create file castore. I'm not sure about the details of this but i'm sure it's fine ^_^ | |
* This code is basically a ripoff of the http://stackoverflow.com/questions/5206010/using-apache-httpclient-for-https | |
*/ | |
import dispatch._ | |
import java.security._ |
This file contains hidden or 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
object InfiList{ | |
def cons[A](x:A,f:(A)=>A) = { | |
new InfiList(x,f) | |
} | |
} | |
class InfiList[A](val init:A,gen: A=>A) { | |
var c:A = init | |
def next() = { | |
c = gen(c) |
This file contains hidden or 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 net.tomasherman.specus.server.grid | |
import org.specs2.mutable.Specification | |
import org.specs2.specification.Scope | |
import akka.actor.Channel | |
import org.specs2.mock._ | |
import net.tomasherman.specus.common.api.net.Packet | |
/** | |
* This file is part of Specus. |
This file contains hidden or 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 Logging { | |
def offTheRecords[A](f: => A):A = { | |
val lvl = loggingLevel // loggingLevel returns current logging leve; | |
disableLogging() | |
val result = f //invokes off-the-records function | |
setLoggingLevel(lvl) //undo of the disableLogging call | |
result | |
} |
This file contains hidden or 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
Tomas-Hermans-MacBook:specus tomasherman$ sbt | |
[info] Set current project to specus (in build file:/Users/tomasherman/workspace/specus/) | |
> test | |
[info] No tests to run. | |
[info] No tests to run. | |
[info] DecodingUtils should | |
[info] + decode byte | |
[info] + decode short | |
[info] + decode int | |
[info] + decode long |
This file contains hidden or 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
//This file is assumed to be in the server module | |
class ConfigImpl extends Config { | |
lazy val potSensor = new PotSensor | |
lazy val heater = new Heater | |
lazy val warmer = new Warmer(this) // this is where injection happens | |
} | |
CodecConfig.config = new ConfigImpl |
NewerOlder