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
class Respond extends Service[Request, Response] with Logger { | |
def apply(request: Request) = { | |
try { | |
request.method -> Path(request.path) match { | |
case GET -> Root / "todos" => Future.value { | |
val data = Todos.allAsJson | |
debug("data: %s" format data) | |
Responses.json(data, acceptsGzip(request)) | |
} | |
case GET -> Root / "todos" / id => Future.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
#!/bin/bash | |
# must run as root!!! | |
RUBY_VERSION=1.9 | |
RUBY_PATCH=1.9.3-p429 | |
#RUBY_PATCH=1.9.3-p286 | |
#RUBY_PATCH=1.9.3-p194 | |
aptitude install -y build-essential libssl-dev libreadline-dev zlib1g-dev libyaml-dev libffi-dev |
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
libraryDependencies ++= { | |
Seq("drools-compiler", "drools-core","drools-jsr94", "drools-decisiontables", "knowledge-api") | |
.map("org.drools" % _ % "5.5.0.Final") | |
} |
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
resolvers ++= Seq("snapshots" at "http://oss.sonatype.org/content/repositories/snapshots", | |
"staging" at "http://oss.sonatype.org/content/repositories/staging", | |
"releases" at "http://oss.sonatype.org/content/repositories/releases", | |
"JBoss Thirdparty Releases" at "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases" | |
) |
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.sql.Connection; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.sql.Timestamp | |
import java.util.Date | |
import scala.slick.driver.MySQLDriver.simple._ | |
//import scala.slick.driver.H2Driver.simple._ | |
//MultipleDB examples, DAL included: https://github.com/slick/slick-examples/blob/2.0.0-M3/src/main/scala/com/typesafe/slick/examples/lifted/MultiDBExample.scala e https://github.com/slick/slick-examples/blob/2.0.0-M3/src/main/scala/com/typesafe/slick/examples/lifted/MultiDBCakeExample.scala |
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
config.vm.provider :virtualbox do |vb| | |
# # Don't boot with headless mode | |
# vb.gui = true | |
# | |
# # Use VBoxManage to customize the VM. For example to change memory: | |
vb.customize ["modifyvm", :id, "--memory", "1024"] #memory to 1GB | |
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] #limit the use of cpu to 50% | |
vb.customize ["modifyvm", :id, "--ioapic", "on"] #needed to use more cpus | |
vb.customize ["modifyvm", :id, "--cpus", "2"] #enable 2 cpus for the vm | |
end |
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
1033edge.com | |
11mail.com | |
123.com | |
123box.net | |
123india.com | |
123mail.cl | |
123qwe.co.uk | |
150ml.com | |
15meg4free.com | |
163.com |
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
replace in varchars fields | |
find: ([a-zA-Z0-9_]*)\s*varchar\(\d{2,4}\) | |
replace: replace(replace(t.$1,'|','-'),'"','¬') $1 | |
date format to YYYY/MM/DD HH:MM:SS | |
find: ([a-zA-Z0-9_]*)\s+(datetime|timestamp){1} | |
replace: TO_CHAR(t.$1,'YYYY/MM/DD HH24:MI:SS') $1 | |
clean other types | |
find: ([a-zA-Z0-9_]*)\s+(integer|bigint){1} |
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
#Download and unzip | |
wget http://download.redis.io/releases/redis-2.8.19.tar.gz | |
tar xzvf redis-2.8.19.tar.gz | |
#Deps to compile and test | |
sudo yum install gcc tcl | |
#Compile | |
cd redis-2.8.19 | |
cd deps |
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
#Download | |
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u75-b13/jdk-7u75-linux-x64.rpm" | |
#Install | |
rpm -Uvh jdk-7u75-linux-x64.rpm | |
#if you already had the openjdk installed before, you need to add the alternatives to this version of java. | |
#Check | |
java -version |
OlderNewer