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 com.ticketfly.pillage; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.nio.channels.FileChannel; | |
public class LogfileReporter implements StatsReporter { |
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
# to install the latest stable version: | |
brew install play | |
# to install play-2.1-RC3: | |
# if you already have a version of play installed you will need to unlink it. | |
brew unlink play | |
brew install https://raw.github.com/gist/4675514/play.rb | |
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands): | |
brew switch play 2.0.4 |
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
import com.twitter.finagle.http.path._ | |
import com.twitter.finagle.http.service.RoutingService | |
import com.twitter.finagle.http.{Request, Response, RichHttp, Http} | |
import com.twitter.finagle.{Service, SimpleFilter} | |
import org.jboss.netty.handler.codec.http._ | |
import org.jboss.netty.handler.codec.http.HttpResponseStatus._ | |
import org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1 | |
import org.jboss.netty.buffer.ChannelBuffers.copiedBuffer | |
import org.jboss.netty.util.CharsetUtil.UTF_8 | |
import com.twitter.util.Future |
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
import akka.actor._ | |
import akka.dispatch._ | |
import akka.pattern.pipe | |
trait StuffService { | |
type Stuff | |
def doStuff :Future[Stuff] | |
} | |
case object DoStuff |
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
find open files from diva | |
sudo lsof -u j2ee-dva | |
on db machine. | |
mysql -e "show processlist" | grep diva | wc -l | |
sudo netstat -lptu |
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
class AvailablePool extends Actor { | |
var coordinationSequence = 0 | |
var allocatorSequence = 0 | |
var pool = 100 | |
def receive = { | |
case Get(count, coordSeq) if count <= pool => | |
if ( coordSeq >= coodinationSequence ) |
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
// create a file called datasources.config somewhere | |
// put in something like this | |
/* | |
datasource { | |
user = "atd" | |
pass = "chubs" | |
host = "localhost" | |
// yada yada |
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
import groovy.sql.* | |
// jdbc config properties | |
// http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html | |
// make sure your mysql driver is on the classpath | |
def uname = "" | |
def password = "" | |
def genDbName( String name ) { name + "_" + (new Date()).getTime() } | |
def dbname = genDbName("mytest") |
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
import sbt._ | |
import sbt.Keys._ | |
object build extends Build { | |
lazy val generate = Project( | |
id = "source-gen", | |
base = file("."), | |
settings = Defaults.defaultSettings ++ generateSourceSettings | |
) | |
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
var org_date_created; | |
var org_date_of_sale; | |
// zones ( local is for dev environments | |
local = org.joda.time.DateTimeZone.getDefault(); | |
cenZone = org.joda.time.DateTimeZone.forID('America/Chicago'); | |
// dates from db in central | |
dc = (new org.joda.time.DateTime( date_created )).withZoneRetainFields(cenZone); | |
dos = (new org.joda.time.DateTime( date_of_sale )).withZoneRetainFields(cenZone); |