Skip to content

Instantly share code, notes, and snippets.

java -jar -Dhudson.util.ProcessTreeKiller.disable=true hudson.war
NAME=projectname
PORT=port
ENVIRONMENT=staging
URI=$NAME.$ENVIRONMENT
DIRECTORY=/mnt/apps/$ENVIRONMENT/$NAME
case "$1" in
start)
lsof -i :$PORT
if [ $? -eq 0 ]; then
<target name="staging.deploy">
<echo message="Stopping the server"/>
<exec executable="${staging.directory}/etc/init.d/${staging.startstop}" dir="${staging.directory}">
<arg line="stop"/>
</exec>
<echo message="Cleaning the environment"/>
<exec executable="grails">
<env key="JAVA_HOME" value="/usr/lib/jvm/java-6-sun/"/>
<arg line="clean"/>
</exec>
module LearnBoost mongoose
module christkv node-mongodb-native 78a96e85963f4869a4440355b5bbfb93c8d449a6
mv modules/node-mongodb-native modules/mongoose/lib/support/
/**
* Module dependencies.
*/
var express = require('./../../lib/express'),
form = require('./../../support/connect-form'),
sys = require('sys');
var app = express.createServer(
{ error: null
, ended: false
, maxFieldsSize: 2097152
, keepExtensions: true
, uploadDir: '/tmp'
, encoding: 'utf-8'
, headers:
{ host: 'localhost:3000'
, connection: 'keep-alive'
, referer: 'http://localhost:3000/'
{ error: null
, ended: false
, maxFieldsSize: 2097152
, keepExtensions: true
, uploadDir: '/tmp'
, encoding: 'utf-8'
, headers:
{ host: 'localhost:3000'
, 'user-agent': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8'
, accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
@robb1e
robb1e / gist:798467
Created January 27, 2011 12:54
Node.JS connection to Guardian Content API
var connection = http.createClient(80, 'content.guardianapis.com');
var request = connection.request('GET', q.uri, {'host':'content.guardianapis.com'});
request.end();
request.on('response', function(response){
var apiData = "";
response.setEncoding('utf8');
response.on('data', function(chunk){
apiData += chunk;
});
response.on('end', function(){
@robb1e
robb1e / base.scala
Created November 13, 2011 22:01
Creating API docs for scalatra
class HttpMethod
object HttpPostMethod extends HttpMethod { override def toString = "POST" }
object HttpGetMethod extends HttpMethod { override def toString = "GET" }
object HttpDeleteMethod extends HttpMethod { override def toString = "DELETE" }
object HttpPutMethod extends HttpMethod { override def toString = "PUT" }
abstract class Param(){
val name: String
val description: String
@robb1e
robb1e / mixin.rb
Created September 5, 2012 03:40
Include and Extend Ruby mixin
module Foo
def say
'foo'
end
end
module Bar
def say
'bar'
end