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 util | |
import play.cache.CacheImpl | |
import models.salatContext._ | |
import scala.collection.JavaConversions.asJavaMap | |
import com.mongodb.casbah.Imports._ | |
import com.mongodb.WriteResult | |
import java.io._ | |
import play.jobs.{Every, Job} | |
import controllers.ErrorReporter |
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
return View.extend({ | |
initialize: function () { | |
this.el.attr("draggable", "true") | |
this.el.bind("dragstart", _.bind(this._dragStartEvent, this)) | |
}, | |
_dragStartEvent: function (e) { | |
var data | |
if (e.originalEvent) e = e.originalEvent | |
e.dataTransfer.effectAllowed = "copy" // default to copy |
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
#!/bin/bash | |
# chkconfig: 345 20 80 | |
# description: Play start/shutdown script | |
# processname: play | |
# | |
# Instalation: | |
# copy file to /etc/init.d | |
# chmod +x /etc/init.d/play | |
# chkconfig --add /etc/init.d/play | |
# chkconfig play on |
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
# Upstart script for a play application that binds to an unprivileged user. | |
# put this into a file like /etc/init/play.conf | |
# | |
# This could be the foundation for pushing play apps to the server using something like git-deploy | |
# By calling service play stop in the restart command and play-start in the restart command. | |
# | |
# Usage: | |
# start play | |
# stop play | |
# restart play |
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
sudo apt-get update | |
sudo apt-get install openjdk-6-jre-headless -f | |
sudo apt-get install curl | |
sudo apt-get install unzip | |
sudo apt-get install openssh-server | |
sudo curl -OL http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.zip | |
sudo unzip elasticsearch-* && rm elasticsearch-*.zip | |
cd elasticsearch-0.19.8 | |
sudo mkdir /usr/local/elasticsearch |
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
scala> import model._ | |
import model._ | |
scala> import org.bson.types.ObjectId | |
import org.bson.types.ObjectId | |
scala> import com.mongodb.casbah.Imports._ | |
import com.mongodb.casbah.Imports._ | |
scala> val _id = new ObjectId |
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
#!/bin/bash | |
# Definitely make sure you create a directory to run this in. | |
# Set this to match the mongodb link for your architecture | |
# http://www.mongodb.org/downloads | |
# arch="linux-i686" | |
# arch="osx-x86_64" | |
arch="linux-x86_64" |
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 module.db; | |
import com.mongodb.casbah.Imports._ | |
import java.text.DateFormat | |
import java.util.Date | |
import play.api.data.validation.ValidationError | |
import play.api.libs.json._ | |
object MongoJson { | |
def fromJson(json: JsValue) : JsResult[DBObject] = readDBObject.reads(json) |