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
def index = Action { | |
Ok(Scalate("index.ssp").render('title -> "Hello World")); | |
} |
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 controllers | |
import play.api._ | |
import http.{Writeable, ContentTypeOf, ContentTypes} | |
import mvc.Codec | |
import play.api.Play.current | |
import org.fusesource.scalate.layout.DefaultLayoutStrategy | |
object Scalate { |
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
# Default Scalate template format (mustache, scaml, jade, ssp) | |
scalate.format=ssp // you can choose any supported template |
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
val appDependencies = Seq( | |
// Add your project dependencies here, | |
"org.fusesource.scalate" % "scalate-core_2.10" % "1.6.1" | |
) |
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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
server { | |
server_name .sandbox.com; | |
root /var/www; | |
# set expiration of assets to MAX for caching | |
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { | |
expires max; | |
log_not_found off; | |
} |
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
$update = array_keys($data); | |
unset($update['created_at']); | |
$this->db->set($data)->on_duplicate_update('product',$update); |
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 MY_Loader extends CI_Loader { | |
/** | |
* Database Loader | |
* | |
* @access public | |
* @param string the DB credentials | |
* @param bool whether to return the DB object | |
* @param bool whether to enable active record (this allows us to override the config setting) | |
* @return object |
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 MY_DB_mysqli_driver extends CI_DB_mysqli_driver | |
{ | |
final public function __construct($params) | |
{ | |
parent::__construct($params); | |
} | |
function _insert_on_duplicate_update($table, $update, $values) |
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 MY_DB_active_record extends CI_DB_active_record | |
{ | |
function on_duplicate_update($table = '',$fields = NULL,$set = NULL) | |
{ | |
if ( ! is_null($set)) | |
{ | |
$this->set($set); | |
} |