Skip to content

Instantly share code, notes, and snippets.

View conikeec's full-sized avatar

Chetan Conikee conikeec

View GitHub Profile
@conikeec
conikeec / gist:1017320
Created June 9, 2011 18:02
maven install
mvn install:install-file -DgroupId=org.apache.http -DartifactId=httpcore-nio-4.1 -Dversion=4.1 -Dfile=httpcore-nio-4.1.jar -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -DgroupId=org.apache.http -DartifactId=httpcore-4.1 -Dversion=4.1 -Dfile=httpcore-4.1.jar -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -DgroupId=org.apache.http -DartifactId=httpclient-4.1 -Dversion=4.1 -Dfile=httpclient-4.1.jar -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -DgroupId=org.apache.http -DartifactId=httpclient-cache-4.1 -Dversion=4.1 -Dfile=httpclient-cache-4.1.jar -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -DgroupId=org.apache.http -DartifactId=httpmime-4.1 -Dversion=4.1 -Dfile=httpmime-4.1.jar -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -DgroupId=org.json.simple -DartifactId=json_simple-1.1 -Dversion=1.1 -Dfile=json_simple-1.1.jar -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -DgroupId=org.apache.lucene -DartifactId=lucene-analyzers-comm
@conikeec
conikeec / run-elephant.sh
Created June 24, 2011 18:18 — forked from stucchio/run-elephant.sh
A script to run elephantdb as a daemon
#!/bin/sh
if test -s /var/run/hadoop/elephantdb.pid;
then
OLDPID=`cat /var/run/hadoop/elephantdb.pid`
echo "Killing old elephant process, pid=$OLDPID"
kill $OLDPID
rm /var/run/hadoop/elephantdb.pid
fi;
nohup java elephantdb.main /elephant/global-conf.clj /usr/local/hadoop/conf/elephantdb-local-conf.clj "`date`" > /var/log/hadoop/elephantdb.log &
@conikeec
conikeec / CreateTwitterTable.java
Created August 11, 2011 19:07 — forked from naryad/CreateTwitterTable.java
Minimal implementation of twitter data layer using HBase
package hbase.sandbox;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.HBaseAdmin;
@conikeec
conikeec / controllers.scala
Created August 27, 2011 06:43 — forked from jeantil/controllers.scala
Play Scala adventures : WTF edition
package controllers
import play._
import libs.OpenID
import play.mvc._
object Application extends Controller {
import views.Application._
@conikeec
conikeec / fboauthakka.scala
Created September 20, 2011 05:59 — forked from buka/fboauthakka.scala
Connecting Facebook OAuth with Akka REST...
/**
* Garrick Evans
* 29 Dec 2010
*/
import akka.http._
import akka.actor._
import net.smartam.leeloo.client._
import net.smartam.leeloo.client.request.OAuthClientRequest
import net.smartam.leeloo.client.response. {OAuthAuthzResponse, GitHubTokenResponse}
@conikeec
conikeec / gist:1259910
Created October 3, 2011 18:55 — forked from mccv/gist:1259343
OAuth with finagle streaming
import java.net._
import java.util.UUID
import com.twitter.conversions.time._
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.util._
import java.nio.charset.Charset
import org.jboss.netty.buffer.{ChannelBuffers, ChannelBuffer}
import org.jboss.netty.handler.codec.http._
import com.twitter.finagle.stream.Stream
@conikeec
conikeec / gist:1379836
Created November 20, 2011 05:28 — forked from seratch/gist:1313140
unfiltered snippets #daimonscala 20
import unfiltered.request._
import unfiltered.response._
// Planify使ってpartial functionでintentの中だけ書く
val echo = unfiltered.filter.Planify {
case Path(Seg(p :: Nil)) => ResponseString(p)
}
unfiltered.jetty.Http.anylocal.filter(echo).run()
// Planを継承したobjectを作ってintentを定義する
@conikeec
conikeec / Controller.scala
Created December 6, 2011 01:55 — forked from bwmcadams/Controller.scala
Play 2.0 Scala + MongoDB via Salat
package controllers
import play.api._
import play.api.mvc._
import com.novus.salat._
import com.novus.salat.global._
import com.novus.salat.dao._
import util._
@conikeec
conikeec / gist:1459133
Created December 11, 2011 07:37 — forked from v6ak/gist:923233
Some ideas for Lift JSON intergation in Play! framework
object Foo0 extends Controller{
def bar = Json(createAnObject) // Default serialization is used.
def bar2 = Json(createAnObject, createAnotherFormats) // default formats are overriden
}
object Foo1 extends Controller{
@conikeec
conikeec / DBWrapper.scala
Created December 21, 2011 19:48 — forked from agnaldo4j/DBWrapper.scala
Usando Riak com Scala
package com.softsimples.social.persistence
import scala.collection.JavaConverters._
import com.basho.riak.client.{IRiakClient, RiakFactory}
import com.basho.riak.client.bucket.Bucket
class DBWrapper(private val riakClient:IRiakClient) {
def createHashWrapperFor( bucketName:String ): HashWrapper = {
HashWrapper.buildTableWrapper( buildBucket( bucketName ) )