Skip to content

Instantly share code, notes, and snippets.

View chonthu's full-sized avatar

Nithin Meppurathu chonthu

View GitHub Profile
@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
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",
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
handlebars: {
compile: {
options: {
namespace: "Handlebars.templates",
(function ($) {
/**
* @function
* @property {object} jQuery plugin which runs handler function once specified element is inserted into the DOM
* @param {function} handler A function to execute at the time when the element is inserted
* @param {bool} shouldRunHandlerOnce Optional: if true, handler is unbound after its first invocation
* @example $(selector).waitUntilExists(function);
*/