Skip to content

Instantly share code, notes, and snippets.

View chonthu's full-sized avatar

Nithin Meppurathu chonthu

View GitHub Profile
@chonthu
chonthu / gist:1893494
Created February 23, 2012 16:15
on_duplicate_update 7
$update = array_keys($data);
unset($update['created_at']);
$this->db->set($data)->on_duplicate_update('product',$update);
@chonthu
chonthu / gist:1924447
Created February 27, 2012 15:09
nginx sample config
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;
}
@chonthu
chonthu / gist:2166526
Created March 23, 2012 03:40
nginx initd
#! /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
@chonthu
chonthu / libvips-installer.sh
Created October 21, 2015 20:37 — forked from h2non/libvips-installer.sh
libvips 7.42.x cross-platform simple installer script (supports OSX, Debian, Ubuntu, CentOS, Fedora, Amazon Linux)
#!/bin/sh
#
# Orinally made by Lovell Fuller for sharp
# https://github.com/lovell/sharp
#
# Usage:
# curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash -
#
val appDependencies = Seq(
// Add your project dependencies here,
"org.fusesource.scalate" % "scalate-core_2.10" % "1.6.1"
)
# Default Scalate template format (mustache, scaml, jade, ssp)
scalate.format=ssp // you can choose any supported template
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 {
def index = Action {
Ok(Scalate("index.ssp").render('title -> "Hello World"));
}
Route::group(array('before' => 'auth'), function()
{
Route::get('/dashboard', array('as' => 'dashboard', 'uses' => 'DashboardController@main'));
});
module.exports = function(grunt) {
grunt.initConfig({
//some...
handlebars: {
compile: {
options: {
namespace: "MyApp.Templates",