Skip to content

Instantly share code, notes, and snippets.

@aktau
aktau / paths.svg
Created July 31, 2011 12:39
New paths
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aktau
aktau / gist:1560196
Created January 4, 2012 14:07
Akka SQL first try
package sql.akka
import akka.actor.Actor
import akka.dispatch.Future
import java.sql._
import sql._
// messages
@aktau
aktau / gist:1562427
Created January 4, 2012 22:04
Scala test of using + Future
//output:
/*
Here we go
closed: meee
closed: bloo
closed: bla
I feel used
I feel used
-----------
I feel used
@aktau
aktau / gist:1959603
Created March 2, 2012 16:50
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@aktau
aktau / Clock.java
Created June 6, 2012 08:12 — forked from jewelsea/Clock.java
Sample of an animated clock in JavaFX
import javafx.animation.*;
import javafx.application.Application;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.effect.Glow;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
@aktau
aktau / AppContext.scala
Created July 6, 2012 12:27
scalatra slow path
def application(req: HttpRequest): Option[ScalatraApp] = {
logger.debug("The registered applications:")
logger.debug("%s" format applications)
application(req.uri.getPath) map (_.mounted) flatMap {
case f: ScalatraApp if f.hasMatchingRoute(req) => {
logger.debug("We found an App")
Some(f)
}
case f: ScalatraApp => {
logger.debug("We found an App, But no matching route")
@aktau
aktau / scalatra-benchmark-results.txt
Created July 6, 2012 16:22
scalatra bencmark results
System:
Operating System
MS Windows XP Professional 32-bit SP3
CPU
Intel Core 2 Duo E7500 @ 2.93GHz 37 °C
Wolfdale 45nm Technology
RAM
4.00 GB Dual-Channel DDR3 @ 532MHz (7-7-7-20)
Motherboard
@aktau
aktau / build.sbt
Created July 9, 2012 14:49
scalatra assembly include other dirs
resourceGenerators in Compile <+= (resourceManaged, baseDirectory) map { (managedBase, base) =>
val webappBase = base / "src" / "main" / "webapp"
for {
(from, to) <- webappBase ** "*" x rebase(webappBase, managedBase / "main" / "webapp")
} yield {
Sync.copy(from, to)
to
}
}
@aktau
aktau / JettyMain.scala
Created July 10, 2012 09:08
jetty debugging fail
org.eclipse.jetty.util.log.Log.setLog(null);
//System.setProperty("DEBUG", "false")
System.setProperty("LEVEL", "WARN")
System.setProperty("org.eclipse.jetty.http.LEVEL", "WARN")
System.setProperty("org.eclipse.jetty.LEVEL", "WARN")
System.setProperty("org.eclipse.LEVEL", "WARN")
System.setProperty(".LEVEL", "WARN")
@aktau
aktau / gist:3712840
Created September 13, 2012 08:21
scala combinedtablemetadata
// doesn't work
class CombinedTableMetadata[A](op: (List[A], List[A]) => List[A]) {
val listInts1 : List[Int]
val listInts2 : List[Int]
val listStrings1: List[String]
val listStrings2: List[String]
def doThis : List[Int] = op(listInts1, listInts2)
def doThat : List[String] = op(listStrings1, listStrings2)